This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Explosion of noise from -Wall
- From: "N.M. Maclaren" <nmm1 at cam dot ac dot uk>
- To: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- Cc: fortran at gcc dot gnu dot org
- Date: 22 Aug 2012 09:04:43 +0100
- Subject: Re: Explosion of noise from -Wall
- References: <20120821212234.GA9677@troutmask.apl.washington.edu>
On Aug 21 2012, Steve Kargl wrote:
While I can appreciate the value of the new warnings
recently added to gfortran, it seems the automatic
inclusion of these options when -Wall is used causes
an explosion of noise.
-Wall at one time was usable to find questionable code.
Now one needs to do '-Wall -Wno-conversion -Wno-compare-real'
to silence a large amount of false positives. I don't
have CP2K or Damian's code available, it may be interesting
to see what happens with a fairly modern codebase.
I disagree in the case of the conversions. I have just run a
check on which ones it warns about, and they are all common
causes of serious errors. Better languages, like Algol 68,
made implicit narrowing coercions an error - so you would HAVE
to fix them. The only reason that any reasonable Fortran
programmer ever uses them is because of the utterly ghastly
specification of the INT, REAL and COMPLEX intrinsics.
Real and complex comparison is more moot, and there is a good
case for putting it in -Wextra. While 90% of such cases are
questionable code, there are a fair number of reasonable uses.
The same applies to underflow, for very similar reasons, and
the trapping of that lost out in the 1970s.
Regards,
Nick Maclaren.