tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] Add max_align_t to stddef.h and C11


From: Christian Jullien
Subject: [Tinycc-devel] Add max_align_t to stddef.h and C11
Date: Tue, 8 Jan 2019 07:51:25 +0100

Hi all,

 

Last commit made by Petr Skocik introduces definition of max_align_t which is ISO/IEC 9899:2011

 

p. 286

“max_align_t

which is an object type whose alignment is as great as is supported by the implementation in all contexts”

 

But, currently, tcc is supposed to implement C99 (ISO/IEC 9899:1999)

 

        printf("%d\n", __STDC_VERSION__); => 199901

 

Hence, it should not be defined.

 

Now the REAL question:

It is not clear to me which C version tcc implements. It’s an incomplete C99 implementation, it lacks for example complex.

 

As it pretend to be 199901, we should take care that “most” C99 are implemented.

New C11 features already implemented should be only available with a new flag (like –std=c11)

 

For example, here are the __STDC_ macros that a compiler C99 should use or test:

 

       __STDC__ macro, 6.10.8

       __STDC_CONSTANT_MACROS macro, 7.18.4

       __STDC_FORMAT_MACROS macro, 7.8.1

       __STDC_HOSTED__ macro, 6.10.8

       __STDC_IEC_559__ macro, 6.10.8, F.1

       __STDC_IEC_559_COMPLEX__ macro, 6.10.8, G.1

       __STDC_ISO_10646__ macro, 6.10.8

       __STDC_LIMIT_MACROS macro, 7.18.2, 7.18.3

       __STDC_VERSION__ macro, 6.10.8

 

When we introduce a new tcc feature we should take care for which C version it is and correctly protect its implementation when the right –std flag is set.

 

Wdyt?

 

C.


reply via email to

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