This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/60083] Duplicate conversion warnings from negative integer to unsigned type (gcc-4.3 emits only one warning)


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]