c/7543: Suggest new warning message for gcc
trt@sas.com
trt@sas.com
Thu Aug 8 09:06:00 GMT 2002
>Number: 7543
>Category: c
>Synopsis: Suggest new warning message for gcc
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Thu Aug 08 09:06:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Tom Truscott
>Release: gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-81)
>Organization:
>Environment:
>Description:
gcc currently does not warn about the logic error
in the following program:
int subr(int flags)
{
return (!flags & 0x80) ? 1 : 0;
}
It should have been (!(flags & 0x80))
>How-To-Repeat:
Compile the above program, with -W -Wall, whatever.
No warning message.
>Fix:
A patch to gcc which gives a warning in this situation appears in
http://gcc.gnu.org/ml/gcc-patches/2002-06/msg01523.html
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list