diff options
author | Dirk Zoller <duz@rtsffm.com> | 1999-09-30 06:19:54 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1999-09-30 00:19:54 -0600 |
commit | b843d2101e5b335f9ae87d5dea12372aca5fb5da (patch) | |
tree | 61b757d3537f8ed69955652a8d7feba76e9d7c6d /gcc/c-decl.c | |
parent | 1bdba2c09c51979c2ec3387637e87648b0ac1db6 (diff) | |
download | gcc-b843d2101e5b335f9ae87d5dea12372aca5fb5da.zip gcc-b843d2101e5b335f9ae87d5dea12372aca5fb5da.tar.gz gcc-b843d2101e5b335f9ae87d5dea12372aca5fb5da.tar.bz2 |
c-tree.h (warn_float_equal): Declare.
* c-tree.h (warn_float_equal): Declare.
* c-decl.c (warn_float_equal): Define.
(c_decode_option): Recognize -W[no-]float-equal.
* c-typeck.c (build_binary_op): Conditionally warn
about equality tests of floating point types.
* toplev.c (documented_lan_options): Add -W[no-]float-equal.
From-SVN: r29722
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 433030d..ca8f26b 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -446,6 +446,10 @@ int warn_unknown_pragmas = 0; /* Tri state variable. */ int warn_sign_compare = -1; +/* Warn about testing equality of floating point numbers. */ + +int warn_float_equal = 0; + /* Nonzero means warn about use of multicharacter literals. */ int warn_multichar = 1; @@ -724,6 +728,10 @@ c_decode_option (argc, argv) warn_sign_compare = 1; else if (!strcmp (p, "-Wno-sign-compare")) warn_sign_compare = 0; + else if (!strcmp (p, "-Wfloat-equal")) + warn_float_equal = 1; + else if (!strcmp (p, "-Wno-float-equal")) + warn_float_equal = 0; else if (!strcmp (p, "-Wmultichar")) warn_multichar = 1; else if (!strcmp (p, "-Wno-multichar")) |