This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug regression/40665] dereferencing type-punned pointer warnings cannot be disabled
- From: "mikulas at artax dot karlin dot mff dot cuni dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Jul 2009 19:40:02 -0000
- Subject: [Bug regression/40665] dereferencing type-punned pointer warnings cannot be disabled
- References: <bug-40665-1600@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #12 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-07-07 19:40 -------
So if there was char *buffer = malloc(512) instead of char buffer[512], would
it be correct to cast it to the pointer to structure?
> And it is not about the cast between the pointer types which causes it to be
> undefined but rather the accesses.
What is considered the "access" in that code? Is it the "->" operator? "&"
operator? "=" operator? Cast operator? Or anything else?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40665