Ralf Wildenhues wrote: > > *************** > > *** 81,86 **** > > --- 92,101 ---- > > /* Work around a HP-UX 10.20 cc bug with enums constants defined as > > offsetof > > values. */ > > # define sa_alignof(type) (sizeof (type) <= 4 ? 4 : 8) > > + #elif defined _AIX > > + /* Work around an AIX 3.2.5 xlc bug with enums constants defined as > > offsetof > > + values. */ > > + # define sa_alignof(type) 4 > > #else > > # define sa_alignof(type) offsetof (struct { char __slot1; type __slot2; > > }, __slot2) > > #endif > > It looks rather scary to me, ... > But second, newer AIX versions may align 'long long' on an 8 byte > boundary. So, if sa_alignof needs only mention an upper bound (which I > don't know, as I don't know this code), then that should be 8.
You're right; I didn't think at newer versions of AIX. I'm applying the appended patch. > But maybe it's either not worth catering for AIX 3.2.5 any more (hey, AIX > 4.3.3 has reached end of service life for a while) I cared about it as long as an AIX 3.2.5 machine was part of my zoo of machine. Maybe Nelson Beebe still has one in his zoo. > What was the original bug report that prompted this, by the way? It > should affect some Autoconf proper code as well. Noticed it while building gettext or libiconv. I didn't bother to report a bug to myself :-) - I don't see any autoconf code use the equivalent of __alignof__. Bruno 2006-08-07 Bruno Haible <[EMAIL PROTECTED]> * allocsa.h (sa_alignof) [_AIX]: Also consider 'long long' in newer versions of AIX. Reported by Ralf Wildenhues. *** lib/allocsa.h.bak 2006-07-22 15:52:09.000000000 +0200 --- lib/allocsa.h 2006-08-08 02:47:00.000000000 +0200 *************** *** 1,5 **** /* Safe automatic memory allocation. ! Copyright (C) 2003-2005 Free Software Foundation, Inc. Written by Bruno Haible <[EMAIL PROTECTED]>, 2003. This program is free software; you can redistribute it and/or modify --- 1,5 ---- /* Safe automatic memory allocation. ! Copyright (C) 2003-2006 Free Software Foundation, Inc. Written by Bruno Haible <[EMAIL PROTECTED]>, 2003. This program is free software; you can redistribute it and/or modify *************** *** 95,101 **** #elif defined _AIX /* Work around an AIX 3.2.5 xlc bug with enums constants defined as offsetof values. */ ! # define sa_alignof(type) 4 #else # define sa_alignof(type) offsetof (struct { char __slot1; type __slot2; }, __slot2) #endif --- 95,101 ---- #elif defined _AIX /* Work around an AIX 3.2.5 xlc bug with enums constants defined as offsetof values. */ ! # define sa_alignof(type) (sizeof (type) <= 4 ? 4 : 8) #else # define sa_alignof(type) offsetof (struct { char __slot1; type __slot2; }, __slot2) #endif