This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/24016] New: Missing "operation on xxx may be undefined" on obvious undefined code
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Sep 2005 17:14:25 -0000
- Subject: [Bug c/24016] New: Missing "operation on xxx may be undefined" on obvious undefined code
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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