This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/26565] Unaligned accesses with __attribute__(packed) and memcpy
- From: "falk at debian dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Mar 2006 14:40:09 -0000
- Subject: [Bug middle-end/26565] Unaligned accesses with __attribute__(packed) and memcpy
- References: <bug-26565-2744@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from falk at debian dot org 2006-03-05 14:40 -------
(In reply to comment #1)
> Hmm:
> &outdata->tv
>
> isn't that semi wrong as the pointer just lost the alignment information?
I'm not sure what you mean.
> A workaround is to do:
> memcpy((void*)&outdata->tv, tp, sizeof outdata->tv);
That doesn't change anything.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26565