[Top][All Lists]

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

Re: AC_CHECK_ALIGNOF maximum ??

From: Russ Allbery
Subject: Re: AC_CHECK_ALIGNOF maximum ??
Date: Thu, 20 Jun 2013 10:51:24 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

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.

> 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.

Russ Allbery (address@hidden)             <>

reply via email to

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