This is strange... This bug has been fixed a while ago ... Try to lower optimization to -O
Cheers, ~d On Friday 09 December 2005 21:06, Andrew Paulsen wrote: > I'm using mspgcc from 20051026 with an MSP430F1611 and compiling with > the -Os flag. > > I have noticed that memcpy() sometimes works incorrectly if the source > or destination pointer does not lie on a 2-byte boundary. If both of > the variables in question are global, the linker complains of a > "warning: internal error: unsupported relocation error", but if one of > the variables is local I get no complaint at all. > > So, is memcpy() unsafe to use when dealing with byte arrays? > > For example: > > #include <stdlib.h> > > int main(void) { > unsigned uint16 = 0; > unsigned char uint8[3] = {1,2,3}; > > // This one works > memcpy(&uint16, &uint8[0], sizeof(uint16)); > > // This one sometimes does not > memcpy(&uint16, &uint8[1], sizeof(uint16)); > } > > > Regards, > Andrew > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_idv37&alloc_id865&opÌk > _______________________________________________ > Mspgcc-users mailing list > Mspgcc-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mspgcc-users