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/24016] New: Missing "operation on xxx may be undefined" on obvious undefined code


Take the following example:
void f(int *a)
{
  *a++ = __extension__ ({ int bb = *a; bb; });
}
---
We don't warn for the operation on a.  This is most likely we don't look into a BLOCK or a statement list, 
I don't know which one.  If I remove the declation of bb, it works, so I am going to assume we don't 
look into BLOCKs.

This was reduced from the following code with glibc and -O1:
#include <ctype.h>
void strtolower(char *data) { while (*data != '\0') *data++ = tolower(*data); }

-- 
           Summary: Missing "operation on xxx may be undefined" on obvious
                    undefined code
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: enhancement
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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