Re: gcc 8.2.0: missing _fileno() for c++11

Anton Shepelev <[email protected]> Wed, 22 Jan 2020 00:46:41 +0300
Newsgroups gmane.comp.gnu.mingw.user
Message-ID <[email protected]>
Keith Marshall to Anton Shepelev:

> > Have you an idea why, then, fileno() is not rejected on
> > Linux with -std=c++11?
>
> One can only speculate that GLIBC headers are less
> rigorous in their interpretation of STRICT_ANSI__;
> opinions may differ on this, but in mine, that's a defect
> in GLIBC.

You are right.  A maintainer of GCC has confirmed his
intention actually to disable the automatic activation of
_GNU_SOURCE for all the -std options, which will make their
build of GCC behave like yours already does!

> _fileno() is not implemented as a function, in Microsoft's
> C-runtime library; it is defined as a macro in <stdio.h>,
> (or <cstdio> for use in C++ code).  The following works
> (tested on Manjaro-Linux, with my own self-built MinGW
> cross-compiler, and run under Wine):
> [...]

Thank you very much for the work-around.  I have forwarded
it to the maintainers.  Now they have have to solutions to
choose from.

> #define _fileno(__F) ((__F)->_file)

So FILE is not a truly opaque type in MinGW -- interesting.

_______________________________________________
MinGW-Users mailing list
[email protected]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.osdn.me/mailman/listinfo/mingw-users
Also: mailto:[email protected]?subject=unsubscribe