-std=C++11 and strict ANSI compliance

Anton Shepelev anton.txt@gmail.com
Tue Jan 21 17:15:00 GMT 2020

Hello, all

Shall  -std=C++11 activate strict ANSI compliance by
means of __STRICT_ANSI__?  I have found only two op-
tions in the docs that activate it for C++ -- %-ansi
and -std=c++98.  Are there other ones?

I am asking this because in MinGW it does, so  that,
for  example,  _fileno -- the MS analog of the POSIX
fileno, is unavailable in stdio.h  with  -std=C++11.
The  MinGW  maintainers  maintain  an  opinion  that
-std=C++11 turns on __STRICT_ANSI__, for which  rea-
son  a  non-standard function shall not be available
in a standard header in standard C++11 mode,  simply
because it is not part of the standard but an exten-

On the other hand, fileno is available in stdio.h on
Linux  with  -std=C++11.  Is it a defect, a courtesy
of the developers, or a requirement for a POSIX OS?

In other words, is the programmer entitled to expect
fileno  (_fileno) and other POSIX (Microsoft) exten-
sions in stdio.h while compiling with -std=C++11  on
a  POSIX  (Microsoft) OS, or is through the mere ne-
glect or coutesy of the developers that it *happens*
to be available?

More information about the Gcc-help mailing list