Dear all,

while -Wcompare-reals is a useful option to find bugs, practical experience and the discussion here and on c.l.f has shown that this option has too many false positives. Hence, it is not suitable for -Wall.

With patch, -Wall no longer implies -Wcompare-reals.

Build on x86-64-linux.
OK for the trunk?

Tobias

PS: I will update wiki/GFortran#news after the committal.
2012-08-26  Tobias Burnus  <bur...@net-b.de>

	* options.c (set_Wall): Don't set for -Wcompare-reals.
	* invoke.texi (-Wall, -Wcompare-reals): -Wall no longer
	implies -Wcompare-reals.

diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index dfd4ca7..d5fdee3 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -727,7 +727,7 @@ warnings.
 Enables commonly used warning options pertaining to usage that
 we recommend avoiding and that we believe are easy to avoid.
 This currently includes @option{-Waliasing}, @option{-Wampersand},
-@option{-Wconversion}, @option{-Wcompare-reals}, @option{-Wsurprising},
+@option{-Wconversion}, @option{-Wsurprising},
 @option{-Wintrinsics-std}, @option{-Wno-tabs}, @option{-Wintrinsic-shadow},
 @option{-Wline-truncation}, @option{-Wtarget-lifetime},
 @option{-Wreal-q-constant} and @option{-Wunused}.
@@ -939,7 +939,6 @@ allocatable variable; this includes scalars and derived types.
 @item -Wcompare-reals
 @opindex @code{Wcompare-reals}
 Warn when comparing real or complex types for equality or inequality.
-Enabled by @option{-Wall}.
 
 @item -Wtarget-lifetime
 @opindex @code{Wtargt-lifetime}
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index cbec705..764f570 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -475,7 +475,6 @@ set_Wall (int setting)
   gfc_option.warn_character_truncation = setting;
   gfc_option.warn_real_q_constant = setting;
   gfc_option.warn_unused_dummy_argument = setting;
-  gfc_option.warn_compare_reals = setting;
   gfc_option.warn_target_lifetime = setting;
 
   warn_return_type = setting;

Reply via email to