This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c/8715: '~' operator for unsigned char and conversion to bool
- From: jozef dot kosoru at pobox dot sk
- To: gcc-gnats at gcc dot gnu dot org
- Date: 26 Nov 2002 13:19:08 -0000
- Subject: c/8715: '~' operator for unsigned char and conversion to bool
- Reply-to: jozef dot kosoru at pobox dot sk
>Number: 8715
>Category: c
>Synopsis: '~' operator for unsigned char and conversion to bool
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Tue Nov 26 05:26:04 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Jozef Kosoru
>Release: gcc-3.2
>Organization:
>Environment:
>Description:
gcc gives the warning when compiling the following code with -Wall:
int main()
{
unsigned char b = '1';
bool x = ~b;
return 0;
}
test.cpp:5: warning: comparison of promoted ~unsigned with constant
g++ has the same behaviour.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: