Hi GNU autotools went more than 20 years forward from the old C89/c90 compatibility checks to C11 and C99 before C89/C90.
First try is with compiler default settings, next try is with "-std=gnu11". tcc fail with both, but using CFLAGS="-std=c11" works for the first check (__STDC_VERSION__) Next check is _Alignas. tcc is broken, but i commited a fix The current test is strange. It has a failure message and only works with tcc. tcc -m32 and tcc -m64 have the same results as gcc -m64 (1 1 1 1), but the result with gcc -m32 is different: 1 0 1 1 What should we do? Attached are a patch for the additional tests to verify my implementation changes for _Alignas. -- Bye bye ... Detlef
From edb7f281c4a44654de6984bf35a3e1515865a1c0 Mon Sep 17 00:00:00 2001 From: Detlef Riekenberg <wine....@web.de> Date: Thu, 28 Jul 2022 18:39:56 +0200 Subject: [PATCH 1/1] Tests for _Alignas(0), _Alignas(1) and more Used by newer configure scripts from GNU autotools -- bye bye, Detlef --- tests/tests2/102_alignas.c | 12 ++++++++++++ tests/tests2/102_alignas.expect | 1 + 2 files changed, 13 insertions(+) diff --git a/tests/tests2/102_alignas.c b/tests/tests2/102_alignas.c index 62d3ed2..bd8dabe 100644 --- a/tests/tests2/102_alignas.c +++ b/tests/tests2/102_alignas.c @@ -14,6 +14,13 @@ int16aligned_t i7; corresponding attribute _does_ apply to type-name, though not in some clang versions. */ int _Alignas(int __attribute__((aligned(16)))) i8; +char _Alignas (0) c0; +char _Alignas (1) c1; +char _Alignas (2) c2; +char _Alignas (short) cs; +char _Alignas (float) cf; +char _Alignas (0) _Alignas (long) two; + extern int printf(const char*, ...); #ifdef _MSC_VER #define alignof(x) (int)__alignof(x) @@ -25,5 +32,10 @@ int main() printf("%d %d %d %d\n", alignof(i1) == 16, alignof(i4) == alignof(double), alignof(i5) == alignof(int) , alignof(i8) == 16); + printf("%d %d %d %d %d %d\n", + alignof(c0) == 1, alignof(c1) == 1, alignof(c2) == 2 , + alignof(cs) == alignof(short), alignof(cf) == alignof(float), + alignof(two) == alignof(long)); + return 0; } diff --git a/tests/tests2/102_alignas.expect b/tests/tests2/102_alignas.expect index b458e07..697ea5d 100644 --- a/tests/tests2/102_alignas.expect +++ b/tests/tests2/102_alignas.expect @@ -1,2 +1,3 @@ 102_alignas.c:4: warning: type defaults to int 1 1 1 1 +1 1 1 1 1 1 -- 2.34.1
_______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel