The error message is a political statement, not an actual truth.
Since _close
is claimed to be "ISO C++ conformant", the insinuation is that the POSIX close
naming is not ISO C++ conformant.
That is complete rubbish.
The names with underscores is simply how Microsoft has implemented an imitation of a subset of POSIX in their library, for decades. (With extensions, such as the _spawn*
family of functions, which make up for the lack of fork
).
The names are ISO C and C++ conforming in the sense that they are confined to a reserved namespace. If you, the programmer, uses an identifier like _close
as an external name, then the behavior is undefined. But that doesn't mean it's a good idea for language implementors to use such identifiers for their public API's. They are useful for internal (perhaps undocumented) identifiers. Microsoft made a regrettable choice to create some API's with ugly names once upon a time, and later crafted a compiler error message to retroactively justify it.
But, look, the Windows API is chock full of identifiers which are not confined to the _[a-zA-Z0-9_]*
namespace, such as CreateWindow
, and WaitForSingleObject
.
If close
is not "ISO C++ conformant", then neither are these!
In fact ISO C and C++ allow implementors to have additional library functions with names in the ordinary namespace, such as close
or WaitForSingleObject
. A name like _close
only conforms in the sense that no future ISO C or C++ standard will likely use it. But that's also true, practically speaking, of the identifiers of any major API, like POSIX or Windows.
If you're a minor player in the world of system API's, and you give a function some short name (that is, say, an English dictionary word) even if it doesn't clash with ISO C now, a future standard could run its proverbial bulldozer over it. There is no danger of that happening to the POSIX functions.