This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/26565] Unaligned accesses with __attribute__(packed) and memcpy



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-03-05 14:22 -------
Hmm:
&outdata->tv

isn't that semi wrong as the pointer just lost the alignment information?
A workaround is to do:
    memcpy((void*)&outdata->tv, tp, sizeof outdata->tv);


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]