[Bug c/60090] For expression without ~, gcc -O1 emits "comparison of promoted ~unsigned with unsigned"

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Feb 6 08:32:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60090

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
C++ folds while parsing and here for both -O0 -O we get

y.c: In function ‘int fn1(unsigned char, unsigned char)’:
y.c:3:18: warning: comparison of promoted ~unsigned with unsigned
[-Wsign-compare]
   return (l ^ a) != b;
                  ^


More information about the Gcc-bugs mailing list