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]

c/7543: Suggest new warning message for gcc


>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:


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