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/53369] Integral promotion with ~ operator - Different behavior for signed and unsigned char.


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

--- Comment #4 from Rahul Ramachandran <rahulnitk2004 at gmail dot com> 2012-05-16 09:09:07 UTC ---
So basically char value -128 is represented in integer as
11111111-11111111-11111111-10000000 and +128 as 10000000. So taking the
compliment will result in 0X7F and 0XFFFFFF7F.

Thanks for the explanation.

Rahul


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