Let's finally fix this issue.

gfortran tries to make sure that BIND(C) functions are really
compatible with C, e.g. by nagging (warning) when 'integer'
instead of 'integer(kind=c_int)' is used, with c_int coming
from the ISO_C_binding module.

While making sense, in general, to use those - it doesn't always
make sense & gfortan warns IMHO a bit too much.

However, it can be silenced - let's do this for libgomp's
compilation, silencing two warnings when compiling omp_lib.f90(.in).

Comments before I commit the attached patch later today?

Tobias

PS: For completeness, there are also OpenACC's Fortran modules,
which are now also compiled with the -Wno-* flag.
libgomp: Add -Wno-c-binding-type for omp_lib.f90 compilation

Silence the overeager "Warning: Variable 'depobj_list' at (1) is a dummy
argument of the BIND(C) procedure ... but may not be C interoperable
[-Wc-binding-type]" when compiling omp_lib.f90(.in).

The argument is of integer kind 'omp_depend_kind = @OMP_DEPEND_KIND@'.

libgomp/ChangeLog:

	* Makefile.am (%.mod): Add -Wno-c-binding-type.
	* Makefile.in: Regenerate.

 libgomp/Makefile.am | 2 +-
 libgomp/Makefile.in | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libgomp/Makefile.am b/libgomp/Makefile.am
index 855f0affddf..e3202aeb0e0 100644
--- a/libgomp/Makefile.am
+++ b/libgomp/Makefile.am
@@ -97,7 +97,7 @@ openacc_kinds.mod: openacc.mod
 openacc.mod: openacc.lo
 	:
 %.mod: %.f90
-	$(FC) $(FCFLAGS) -cpp -fopenmp -fsyntax-only $<
+	$(FC) $(FCFLAGS) -cpp -fopenmp -fsyntax-only -Wno-c-binding-type $<
 fortran.lo: libgomp_f.h
 fortran.o: libgomp_f.h
 env.lo: libgomp_f.h
diff --git a/libgomp/Makefile.in b/libgomp/Makefile.in
index 25cb6fcd3c1..2a0a842af52 100644
--- a/libgomp/Makefile.in
+++ b/libgomp/Makefile.in
@@ -1388,7 +1388,7 @@ openacc_kinds.mod: openacc.mod
 openacc.mod: openacc.lo
 	:
 %.mod: %.f90
-	$(FC) $(FCFLAGS) -cpp -fopenmp -fsyntax-only $<
+	$(FC) $(FCFLAGS) -cpp -fopenmp -fsyntax-only -Wno-c-binding-type $<
 fortran.lo: libgomp_f.h
 fortran.o: libgomp_f.h
 env.lo: libgomp_f.h

Reply via email to