[patch, fortran] Reduce Explosion of noise from -Wall

Thomas Koenig tkoenig@netcologne.de
Wed Aug 22 20:47:00 GMT 2012


Am 22.08.2012 11:18, schrieb Tobias Burnus:

> Regarding -Wcompare-real, I wonder whether it makes sense to either
> ignore comparisions against zero or to put them into a different flag
> (-Wcompare-real-zero);

Here is a patch to not warn for comparisons against zero.
Regression-tested, also tested with make info and make dvi.

OK for trunk?

	Thomas

012-08-22  Thomas König  <tkoenig@gcc.gnu.org>

         PR fortran/54298
         * invoke.texi:  Document that -Wcompare-reals does not warn for
         comparison against zero.
         * resolve.c (is_real_zero):  New function.
         (is_complex_zero):  New function.
         (resolve_operator):  If the comparison is against real or complex
         zero, don't warn about equality/inequality comparisions.
         Document how to suppress the warning in the error message.

2012-08-22  Thomas König  <tkoenig@gcc.gnu.org>

         PR fortran/54298
         * gfortran.dg/compare_real_2.f90:  New test.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: zero-2.diff
Type: text/x-patch
Size: 2085 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120822/2f56af37/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: real_compare_2.f90
Type: text/x-fortran
Size: 670 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120822/2f56af37/attachment-0001.bin>


More information about the Gcc-patches mailing list