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/51371] New: compilation should produce warning


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

             Bug #: 51371
           Summary: compilation should produce warning
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gideon425.gb5@mailnull.com


unsigned long l;
unsigned long l2;

void x()
{
  if (l >= 0) l2 = 1;
}


compiling the above code with -Wlogical-op should give a warning
as l can never be negative


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