volatile struct {
int x, y;
} s;
int foo()
{
return (s.x > s.y); // undefined behavior:
// the order of volatile accesses
// is undefined in this statment
}
--
Summary: gcc should warn about undefined behaviour
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P2
Component: other
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pluto at pld-linux dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pld-linux
GCC host triplet: i686-pld-linux
GCC target triplet: i686-pld-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20531