Re: AC_CHECK_ALIGNOF maximum ??

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

 



On 2013-06-20 10:51 -0700, Russ Allbery wrote:
> Nick Bowler <nbowler@xxxxxxxxxxxxxxxx> 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/)

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf





[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux