[Fontconfig] fontconfig 2.10 and alignof(double) on AIX

Albert Chin fontconfig at mlists.thewrittenword.com
Wed Aug 21 14:19:16 PDT 2013


On Wed, Aug 21, 2013 at 02:33:08PM -0400, Behdad Esfahbod wrote:
> On 13-08-21 01:41 PM, Albert Chin wrote:
> > On Wed, Aug 21, 2013 at 01:45:12AM -0400, Behdad Esfahbod wrote:
> >> On 13-08-21 12:44 AM, Albert Chin wrote:
> >>> On AIX 32-bit and 64-bit, alignof(double) == 4. This isn't a
> >>> problem for 32-bit builds of fontconfig but for 64-bit builds,
> >>> the following assert in src/fcarch.c fails:
> >>>   FC_ASSERT_STATIC (0x08 + 1*FC_MAX(4,ALIGNOF_DOUBLE) == sizeof (FcValue));
> >>
> >> So, what *is* sizeof(FcValue)?  If alignof(double) is 4, double
> >> itself is 8, and enum is 4, then sizeof(FcValue) should be 12
> >> which is exactly what the assertion is trying to ensure.
> > 
> > This is the offending line above compiled with -E:
> >   typedef int _static_assert_on_line_59_failed[(((0x08 + 1*((4) > (4) ? (4) : (4)) == sizeof (FcValue))))?1:-1];
> > 
> > sizeof (FcValue) == 16.
> > 
> > typedef struct _FcValue {			// sizeof(type)
> >     FcType type;				4
> >     union {
> >         const FcChar8   *s;			8
> >         int              i;			4
> >         FcBool           b;			4
> >         double           d;			8
> >         const FcMatrix  *m;			8
> >         const FcCharSet *c;			8
> >         void            *f;			8
> >         const FcLangSet *l;			8
> >     } u;
> > } FcValue;					16
> 
> I see.  I wasn't expecting any 64bit system to have a 32bit double
> alignment. Pushed out a fix.  Please test.

Your fix builds on Solaris/SPARC, Solaris/x86, HP-UX/PA, HP-UX/IA, and
AIX. Thanks!

-- 
albert chin (china at thewrittenword.com)


More information about the Fontconfig mailing list