Niels Möller <nisse(a)lysator.liu.se> writes:
> João Gomes writes:
>
>> In file included from nettle-meta.h:37:0, from non-nettle.h:38,
>> from non-nettle.c:43:
>> nettle-types.h:70:3: error: expected specifier-qualifier-list before ‘_Alignas’
>> In file included from ocb.h:38:0,
>> from non-nettle.h:39,
>> from non-nettle.c:43:
>> aes.h:71:3: error: expected specifier-qualifier-list before ‘_Alignas’
>> aes.h:92:3: error: expected specifier-qualifier-list before ‘_Alignas’
>> aes.h:113:3: error: expected specifier-qualifier-list before ‘_Alignas’
>> make[1]: *** [Makefile:322: non-nettle.o] Error 1
>
> Related to this note in NEWS:
>
> In addition, support for alignof and alignas is required; these are
> part of C11, but intention is that this is the only required C11
> feature.
>
>> For your information, I can compile it without any errors on x86-x64, but not on ARM anymore.
>
> Which compiler and compiler options did you have this problem with? It's
> somewhat odd that you appear to have stdalign.h, and a macro alignas
> expanding to _Alignas, but the latter not working as expected.
Apparently, this was with gcc-4.5.3, used in some build framework for
embedded systems. This version was released in April 2011. I think
support for stdalign.h was added in to GCC in version 4.7.0, released
one year later, March 2012.
I'm not that surprised that people doing embedded systems are sometimes
using pretty old tool chains. I'm also told that Microsoft's C compiler
didn't get stdalign.h until 2019.
So my questions is: Are there others who are stuck with older compilers
and getting trouble with Nettle's use of alignas/alignof? Is it somewhat
common, or rather obscure?
It's possible to add a --disable-align configure option, but it would
get a bit complex since that option must control what goes into the
installed header files. So I wonder if that's worth the effort?
Regards,
/Niels
--
Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677.
Internet email is subject to wholesale government surveillance.