Skip to content

Commit fae703e

Browse files
committed
Fix unused dummy argument warnings
1 parent 09762b3 commit fae703e

4 files changed

Lines changed: 37 additions & 1 deletion

File tree

examples/fortran/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FC = gfortran
2-
FFLAGS = -Wall -Wextra -O0 -g -ffree-line-length-none -Wno-unused-dummy-argument
2+
FFLAGS = -Wall -Wextra -O0 -g -ffree-line-length-none
33
PINEAPPL_LIBS != pkg-config pineappl_capi --libs
44
LHAPDF_LIBS != pkg-config lhapdf --libs
55

examples/fortran/lhapdf_example-deprecated.f90

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ function xfx_test1(pdg_id, x, q2, state) bind(c)
5858
type(c_ptr), value, intent(in) :: state
5959
real(c_double) :: xfx_test1
6060

61+
! ignore unused argument
62+
associate(state => state); end associate
63+
6164
call lhapdf_xfxq2(0, 0, pdg_id, x, q2, xfx_test1)
6265
end function
6366

@@ -87,6 +90,9 @@ function alphas_test1(q2, state) bind(c)
8790
type(c_ptr), value, intent(in) :: state
8891
real(c_double) :: alphas_test1
8992

93+
! ignore unused argument
94+
associate(state => state); end associate
95+
9096
call lhapdf_alphasq2(0, 0, q2, alphas_test1)
9197
end function
9298

examples/fortran/test-deprecated.f90

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,11 @@ function xfx1_test(pdg_id, x, q2, state) bind(c)
190190
type(c_ptr), value, intent(in) :: state
191191
real(c_double) :: xfx1_test
192192

193+
! ignore unused arguments
194+
associate(pdg_id => pdg_id); end associate
195+
associate(q2 => q2); end associate
196+
associate(state => state); end associate
197+
193198
xfx1_test = x
194199
end function
195200

@@ -203,6 +208,11 @@ function xfx2_test(pdg_id, x, q2, state) bind(c)
203208
type(c_ptr), value, intent(in) :: state
204209
real(c_double) :: xfx2_test
205210

211+
! ignore unused arguments
212+
associate(pdg_id => pdg_id); end associate
213+
associate(q2 => q2); end associate
214+
associate(state => state); end associate
215+
206216
xfx2_test = -x
207217
end function
208218

@@ -215,6 +225,9 @@ function alphas_test(q2, state) bind(c)
215225
type(c_ptr), value, intent(in) :: state
216226
real(c_double) :: alphas_test
217227

228+
! ignore unused argument
229+
associate(state => state); end associate
230+
218231
alphas_test = q2
219232
end function
220233

examples/fortran/test.f90

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ function xfx_test(pdg_id, x, q2, state) bind(c)
229229
real(c_double) :: xfx_test
230230
integer, pointer :: state_array(:)
231231

232+
! ignore unused arguments
233+
associate(pdg_id => pdg_id); end associate
234+
associate(q2 => q2); end associate
235+
232236
call c_f_pointer(state, state_array, [2])
233237
xfx_test = merge(x, -x, state_array(1).eq.0)
234238
end function
@@ -243,6 +247,11 @@ function xfx1_test(pdg_id, x, q2, state) bind(c)
243247
type(c_ptr), value, intent(in) :: state
244248
real(c_double) :: xfx1_test
245249

250+
! ignore unused arguments
251+
associate(pdg_id => pdg_id); end associate
252+
associate(q2 => q2); end associate
253+
associate(state => state); end associate
254+
246255
xfx1_test = x
247256
end function
248257

@@ -256,6 +265,11 @@ function xfx2_test(pdg_id, x, q2, state) bind(c)
256265
type(c_ptr), value, intent(in) :: state
257266
real(c_double) :: xfx2_test
258267

268+
! ignore unused arguments
269+
associate(pdg_id => pdg_id); end associate
270+
associate(q2 => q2); end associate
271+
associate(state => state); end associate
272+
259273
xfx2_test = -x
260274
end function
261275

@@ -268,6 +282,9 @@ function alphas_test(q2, state) bind(c)
268282
type(c_ptr), value, intent(in) :: state
269283
real(c_double) :: alphas_test
270284

285+
! ignore unused argument
286+
associate(state => state); end associate
287+
271288
alphas_test = q2
272289
end function
273290

0 commit comments

Comments
 (0)