------- Comment #9 from pinskia at gcc dot gnu dot org 2010-09-08 19:01 ------- >If it's an illegal program, gcc should at least emit a warning, if not an error.
It is not an invalid program, it is just undefined at runtime. There was a defect report against the C standard asking if a diagnostic can be required for undefined behavior and it was rejected. Oh there is a patch to enable warnings for this case already. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45600