[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] Add max_align_t to stddef.h and C11
From: |
Petr Skočík |
Subject: |
Re: [Tinycc-devel] Add max_align_t to stddef.h and C11 |
Date: |
Tue, 8 Jan 2019 12:38:23 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 |
Hi,
adding that one line was bad snap judgment on my part. I didn't realize
max_align_t was C11 and since C99 doesn't appear to properly reserve all
*_t names (out of C99, only {,u}int*_t names are reserved (by
stdint.h)), let's revert it.
tinycc supports some C11 features like _Generic, but since _Generic is a
reserved word in all contexts, there are no name conflicts. max_align_t
is conflicting, IMO.
I've reverted the patch.
Thanks.
Best regards,
Petr Skocik
On 1/8/19 7:51 AM, Christian Jullien wrote:
> 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.
>
>
> _______________________________________________
> Tinycc-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>
- [Tinycc-devel] Add max_align_t to stddef.h and C11, Christian Jullien, 2019/01/08
- Re: [Tinycc-devel] Add max_align_t to stddef.h and C11,
Petr Skočík <=
- Re: [Tinycc-devel] Add max_align_t to stddef.h and C11, Christian Jullien, 2019/01/08
- Re: [Tinycc-devel] Add max_align_t to stddef.h and C11, uso ewin, 2019/01/08
- Re: [Tinycc-devel] Add max_align_t to stddef.h and C11, Christian Jullien, 2019/01/08
- Re: [Tinycc-devel] Add max_align_t to stddef.h and C11, uso ewin, 2019/01/08
- Re: [Tinycc-devel] Add max_align_t to stddef.h and C11, Christian Jullien, 2019/01/08
- Re: [Tinycc-devel] Add max_align_t to stddef.h and C11, uso ewin, 2019/01/10
- Re: [Tinycc-devel] Add max_align_t to stddef.h and C11, Christian Jullien, 2019/01/10
- Re: [Tinycc-devel] Add max_align_t to stddef.h and C11, uso ewin, 2019/01/10
- Re: [Tinycc-devel] Add max_align_t to stddef.h and C11, Petr Skočík, 2019/01/10
- Re: [Tinycc-devel] Add max_align_t to stddef.h and C11, Christian Jullien, 2019/01/11