Compiling options on HP-UX with gcc 3.2

Eljay Love-Jensen eljay@adobe.com
Thu Nov 20 16:31:00 GMT 2003


Hi Andrea,

That's a limitation of the HP-UX platform.  (And for many other platforms, too.)

Don't use odd memory addresses for data types that are not allowed to be accessed at odd memory locations.

For instance:
char s[10];
int* x = (int*)&s[1];
*x = 3; // !

! A *LOT* of platforms will bus error here.

UNLESS... you've found a bug where GCC is creating odd memory location data types that are not allowed to be accessed at odd memory locations, and it's not due to your own code's logic or structure packing __attribute__(()).

HTH,
--Eljay




More information about the Gcc-help mailing list