[Bug c/20689] strict aliasing with temporary variable never gives warnings
varun0005 at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Mar 30 12:02:00 GMT 2005
------- Additional Comments From varun0005 at gmail dot com 2005-03-30 12:02 -------
I mean that since in case where you are doing "void *p=(void *)&i" then
according to strict-aliasing rules we get " warning: dereferencing type-punned
pointer will break strict-aliasing rules" , but same thing if done using a
temporary variable then why strict-aliasing warning doesn't appear.. According
to my understanding of strict aliasing if some unqualified version of pointer is
pointing to the address space(in out case void pointer pointing to int address
space) then it is violating strict aliasing rule. So in second case also void
pointer is pointing to the int address space then why strict aliasing rules are
not violated. If ther is some error in my understanding of strict aliasing then
please inform .
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20689
More information about the Gcc-bugs
mailing list