diff options
author | Geoff Keating <geoffk@cygnus.com> | 2000-02-19 01:37:31 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@gcc.gnu.org> | 2000-02-19 01:37:31 +0000 |
commit | 488d3985f2ab4b8bb4fe09c1e1a3e269b62d133b (patch) | |
tree | a5a521b789a2bbe4528620b430f00bcfe4f656f8 /gcc | |
parent | c8d8ed65a5366c075cce9ee64e871d815fd1f33d (diff) | |
download | gcc-488d3985f2ab4b8bb4fe09c1e1a3e269b62d133b.zip gcc-488d3985f2ab4b8bb4fe09c1e1a3e269b62d133b.tar.gz gcc-488d3985f2ab4b8bb4fe09c1e1a3e269b62d133b.tar.bz2 |
invoke.texi (Warning Options): Add an explanation of why you might want the -Wfloat-equal flag.
* invoke.texi (Warning Options): Add an explanation of why
you might want the -Wfloat-equal flag.
From-SVN: r32061
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/invoke.texi | 11 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0be42ce..0c66734 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-02-18 Geoff Keating <geoffk@cygnus.com> + + * invoke.texi (Warning Options): Add an explanation of why + you might want the -Wfloat-equal flag. + Fri Feb 18 20:08:57 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * bitmap.c (bitmap_operation): Avoid using -1 for index since unsigned. diff --git a/gcc/invoke.texi b/gcc/invoke.texi index dbae221..09cbfc9 100644 --- a/gcc/invoke.texi +++ b/gcc/invoke.texi @@ -1724,6 +1724,17 @@ struct s x = @{ 3, 4 @}; @item -Wfloat-equal Warn if floating point values are used in equality comparisons. +The idea behind this is that sometimes it is convenient (for the +programmer) to consider floating-point values as approximations to +infinitely precise real numbers. If you are doing this, then you need +to compute (by analysing the code, or in some other way) the maximum or +likely maximum error that the computation introduces, and allow for it +when performing comparisons (and when producing output, but that's a +different problem). In particular, instead of testing for equality, you +would check to see whether the two values have ranges that overlap; and +this is done with the relational operators, so equality comparisons are +probably mistaken. + @item -Wtraditional (C only) Warn about certain constructs that behave differently in traditional and ANSI C. |