This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: compiler directive to disable warnings
- From: Tobias Burnus <burnus at net-b dot de>
- To: Andy May <MayAJ1 at cardiff dot ac dot uk>
- Cc: fortran at gcc dot gnu dot org
- Date: Fri, 01 Jun 2012 14:58:31 +0200
- Subject: Re: compiler directive to disable warnings
- References: <4FC8AF7B.6080306@cardiff.ac.uk>
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