[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/5] stdalign-tests: new module
From: |
Bruno Haible |
Subject: |
Re: [PATCH 2/5] stdalign-tests: new module |
Date: |
Mon, 17 Oct 2011 23:11:27 +0200 |
User-agent: |
KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; ) |
Hi Paul,
> +# define CHECK_ALIGNAS(type) \
> + type alignas (1 << 3) type##_alignas; \
> + type _Alignas (1 << 3) type##_Alignas;
Can we check whether this alignas(8) specifier? I mean, inside main()
do
if ((uintptr_t) &type##_alignas % (1 << 3) != 0)
abort ();
The problem is that it's compiler-dependent whether 'alignas' works
at all, and the maximum alignment is CPU and toolchain dependent
(on m68k, for example, the maximum alignment is 2, I think, not 8).
Bruno
--
In memoriam The victims of the French police
<http://en.wikipedia.org/wiki/Paris_massacre_of_1961>