[Bug c/63886] float will fit into int with abs - possible missing warning Wabsolute-value
manu at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Jul 31 22:44:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63886
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |easyhack
--- Comment #10 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Eric Gallager from comment #8)
> (In reply to Andreas Schwab from comment #4)
> > float f = 3.1f;
>
> Isn't there already -Wunsuffixed-float-constants for warnings with that kind
> of fix?
-Wfloat-conversion is not warning about the lack of suffix, but about the fact
that 3.1 does not fit into a double (3.5 does, so there is no warning).
float f;
double d;
f = 3.100000000000000088817841970012523233890533447265625; //
-Wfloat-conversion -Wunsuffixed-float-constants
d = 3.100000000000000088817841970012523233890533447265625; //
-Wunsuffixed-float-constants (not sure why!)
f = 3.5; // -Wunsuffixed-float-constants
d = 3.5; // -Wunsuffixed-float-constants (not sure why!)
f = 3.1f; // no warning
d = 3.1f; // no warning
More information about the Gcc-bugs
mailing list