[Top][All Lists]

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

Re: [Tinycc-devel] Add new _ISOCxx macros?

From: Michael Matz
Subject: Re: [Tinycc-devel] Add new _ISOCxx macros?
Date: Sat, 18 Jan 2020 02:34:49 +0100 (CET)
User-agent: Alpine 2.21 (LSU 202 2017-01-01)


On Thu, 16 Jan 2020, Christian Jullien wrote:

Pushed on mob.

The macros _ISOC99_SOURCE and _ISOC11_SOURCE are requests to enable c99 and c11 features of glibc. They are supposed to come at the request of users and are interpreted by <features.h> of glibc to set various other macros. They aren't defined by gcc.

Please note that those macros are defined by gcc only when _GNU_SOURCE is

They are defined by glibc itself with _GNU_SOURCE, yes. But also that is an explicit user request, the usage or non-usage of -std=c99/c11 doesn't come into play. The compiler communicates the level of C standard compliance by the __STDC_VERSION__ macro.


With tcc they are unconditionally defined except on Windows (which does not
use glibc at all).




From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=address@hidden]
On Behalf Of ian
Sent: Thursday, January 16, 2020 07:03
To: address@hidden
Subject: *** SPAM *** Re: [Tinycc-devel] Add new _ISOCxx macros?


Hi Christian,

It seems consistent to me.


Le 16/01/2020 à 06:55, Christian Jullien a écrit :

      Hi all,


      When we use tcc on Linux, we also use /usr/include/*.h.

      Some definitions are only visible for C11 and controlled by use
      of _ISOC11_SOURCE as used by glibc (see for example


      As tcc is C99 by default, I propose to also automatically set
      _ISOC99_SOURCE by default but _ISOC11_SOURCE when -std=c11 is






          _ISOC99_SOURCE (since glibc 2.1.3)

                     Exposes declarations consistent with the ISO C99


                     Earlier glibc 2.1.x versions recognized an
      equivalent macro

                     named _ISOC9X_SOURCE (because the C99 standard
      had not then

                     been finalized).  Although the use of this macro
      is obsolete,

                     glibc continues to recognize it for backward


                     Defining _ISOC99_SOURCE also exposes ISO C (1990)
      Amendment 1

                     ("C95") definitions.  (The primary change in C95
      was support

                     for international character sets.)


                     Invoking the C compiler with the option -std=c99
      produces the

                     same effects as defining this macro.


             _ISOC11_SOURCE (since glibc 2.16)

                     Exposes declarations consistent with the ISO C11

                     Defining this macro also enables C99 and C95
      features (like



                     Invoking the C compiler with the option -std=c11
      produces the

                     same effects as defining this macro.


Tinycc-devel mailing list



-- address@hidden
-- Développeur compulsif

reply via email to

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