On Sat, Mar 03, 2012 at 03:23:01PM +0100, Tobias Burnus wrote:
> GNU Fortran warns by default for code like the following:
> interface
>   subroutine sub (n)  bind (C)
>     integer :: n
>   end subroutine sub
> end interface
> Namely, it prints:
> Warning: Variable 'n' at (1) is a parameter to the BIND(C) procedure 
> 'sub' but may not be C interoperable
> That's on one hand correct: There is no defined relation between Fortran 
> default kinds (or any kind number) and the C types. Thus, the proper way 
> is to use the parameters defined in ISO_C_BINDING, such as "c_int".
> On the other hand, "integer" and "int" is the same on many (but not on 
> all systems) and, thus, many users simply use the default type.
> Compiling interfaces with hundreds of such definitions clutters the 
> screen with those warnings and makes it difficult to spot other warnings.
> Thus, this patch adds a warning flag for this purpose - and it also 
> excludes those warnings from the default setting. That's a bit in line 
> with Fortran 2008 and TS 29113, which remove more and more constraints 
> and force the users to ensure themselves that the variables are 
> interoperable. However, keeping it as default warning is also fine with me.
> Build and regtested on x86-64-linux.
> OK?



Reply via email to