This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/53369] Integral promotion with ~ operator - Different behavior for signed and unsigned char.
- From: "rahulnitk2004 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 16 May 2012 09:09:07 +0000
- Subject: [Bug c/53369] Integral promotion with ~ operator - Different behavior for signed and unsigned char.
- Auto-submitted: auto-generated
- References: <bug-53369-4@http.gcc.gnu.org/bugzilla/>
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