This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: compiler directive to disable warnings


On 06/01/2012 02:03 PM, Andy May wrote:
I'm wondering if there is a Gfortran equivalent to GCC pragmas for switching off compiler warnings inside the code, i.e.:
http://gcc.gnu.org/onlinedocs/gcc-4.6.0/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas


? If not, I think that it would be nice to have similar compiler directives for Fortran, eg.:

!GCC$ diagnostic warning "-Wconversion"

I concur that it should be supported, but it isn't. Currently only those directives listed in the gfortran manual are supported. There are plans to extend the support, but currently no one works on this. Cf. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41209


Note that warning directives aren't that simple: They can be selectively enabled and disabled; thus, one needs to track where the directive became effective and until when. Additionally, both the frond-end's warnings (i.e. the Fortran part) but as also the middle-/back-end's warnings are affected, which increases the complexity.

Tobias

PS: I have filled a PR for your feature request: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53552


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]