-std=C++11 and strict ANSI compliance

Jonathan Wakely jwakely.gcc@gmail.com
Wed Jan 22 09:51:00 GMT 2020


On Wed, 22 Jan 2020 at 09:05, Anton Shepelev <anton.txt@gmail.com> wrote:
>
> Jonathan Wakely to Anton Shepelev:
>
> > > Thank  you  for the explanation.  Is it possible
> > > to make the current GCC with -std=CNN behave  as
> > > you intend it to? Will, for example, the follow-
> > > ing suffice:    gcc -std=c++11 -U_GNU_SOURCE   ?
> >
> > No, if it was that easy it would  have  been  done
> > long ago.
> >
> > The   reason   g++  defines  _GNU_SOURCE  is  that
> > libstdc++ relies on GNU extensions.
>
> No good.

It's perfectly fine for the GNU C++ standard library to rely on
extensions in the GNU C standard library.

The problem is exposing *all* those extensions to user code, when we
only need a few.


> > Until that changes, _GNU_SOURCE needs  to  be  de-
> > fined.
>
> Thank you for the explanation, Jonathan.
>



More information about the Gcc-help mailing list