Menu

#2188 WSL: stdio.h gratuitously uses _fileno() before declaring it

WSL
unread
nobody
None
Bug
none
Unknown
False
2014-02-25
2014-02-25
No

The problem lies in the inline function implementations for _lseeki64() and _telli64(), both of which use _fileno(), and both of which precede the prototype declaration for _fileno() itself, within the same header file; this causes a fatal error in C++ compilation units, because C++ requires the prototype to be in scope at point of use.

The obvious solution is to rearrange the header file, to ensure that all necessary function prototypes are already in scope, before implementing the inline functions.

Related

Issues: #2187

Discussion