autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AC_CHECK_ALIGNOF maximum ??


From: Nick Bowler
Subject: Re: AC_CHECK_ALIGNOF maximum ??
Date: Thu, 20 Jun 2013 14:06:24 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On 2013-06-20 10:51 -0700, Russ Allbery wrote:
> Nick Bowler <address@hidden> writes:
> > C11 also provides max_align_t, which is *probably* what you are looking
> > for but obviously isn't available everywhere.  Anyway, on older
> > implementations without max_align_t, the following type is probably a
> > "good enough" substitute for it:
> 
> >   union {
> >     char a;
> >     short b;
> >     int c;
> >     long d;
> >     long long e;
> >     float f;
> >     double g;
> >     long double h;
> >     void *i;
> >   }
> 
> I would add a function pointer, but yes.

Good idea.

> > You could use AC_CHECK_TYPE to test for max_align_t, then use
> > AC_CHECK_ALIGNOF on the above monster if it is not available.
> 
> > You may also want to test for long long availability before
> > including it in the union...
> 
> And long double, which IIRC is more of a portability issue than long long.

FWIW, the autoconf manual has the following to say in ยง5.9.1 "Particular
Type Checks"[1]:

  [AC_TYPE_LONG_DOUBLE] is obsolescent, as current C compilers support
  long double.  New programs need not use this macro.

[1] https://gnu.org/software/autoconf/manual/autoconf.html#Particular-Types

Cheers,
-- 
Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]