This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/60083] Duplicate conversion warnings from negative integer to unsigned type (gcc-4.3 emits only one warning)
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 21 Feb 2018 21:52:57 +0000
- Subject: [Bug c/60083] Duplicate conversion warnings from negative integer to unsigned type (gcc-4.3 emits only one warning)
- Auto-submitted: auto-generated
- References: <bug-60083-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60083
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |manu at gcc dot gnu.org
Resolution|--- |FIXED
--- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
This probably got fixed when early folding was fixed:
gcc 8.0 -Wsign-conversion -Wparentheses -Wall -Wextra -Wconversion gives:
<source>:3:48: warning: suggest parentheses around comparison in operand of '^'
[-Wparentheses]
unsigned short s = ~0x4578ADBCAA1DE677LL ^ a == 0;
~~^~~~
<source>:3:44: warning: unsigned conversion from 'long long int' to 'short
unsigned int' changes value from '-5005942011641849463' to '6537' [-Woverflow]
unsigned short s = ~0x4578ADBCAA1DE677LL ^ a == 0;
~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
The fix-it notes for -Wparentheses and having some warnings enabled by default
would be nice, but they are a different topic altogether.