[Mingw-users] gcc 8.2.0: missing _fileno() for c++11

Anton Shepelev anton****@gmail*****
Tue Jan 21 04:26:21 JST 2020


I wrote:

> After an upgrade to 8.2.0, gcc can no longer find the
> _fileno function.  The following program:
>
> #include <stdio.h>
>
> int main( void )
> {  FILE *f;
>    _fileno( f );
>    return 0;
> }
>
> saved in test.cpp, will not compile with:
>
>     gcc -std=c++11 test.cpp

Here is the full gcc output when building as C++11:

test.cpp: In function 'int main()':
test.cpp:5:4: error: '_fileno' was not declared in this scope
    _fileno( f );
    ^~~~~~~
test.cpp:5:4: note: suggested alternative: '_filbuf'
    _fileno( f );
    ^~~~~~~
    _filbuf

According to:
  https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/fileno
_fileno() shall be declared in stdio.h .



More information about the MinGW-Users mailing list