------- Comment #10 from hubicka at gcc dot gnu dot org  2006-01-19 00:14 
-------
My understanding of C type based aliasing rules always was that char, as an
exception, might alias with everything.  Perhaps I lived in false belief for a
while, but at least -Wstrict-aliasing seems to think so:
ibm:~ # more t.c
char a[10];
short b[10];
main()
{
  *(int *)a=5;
  *(int *)b=5;
}
ibm:~ # gcc -O2 -Wstrict-aliasing t.c
t.c: In function main:
t.c:6: warning: dereferencing type-punned pointer will break strict-aliasing
rules


-- 


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

Reply via email to