The outdated name is deprecated, not a function, and only in Visual Studio, not in POSIX.
Basically, the reason is that mkdir not defined as a function of the runtime library in the ISO C ++ standard, and it is expected that the functions of the non-standard runtime library will begin with an underscore. Accordingly, Microsoft added underscores to all non-standard function names in the runtime library. Most of them are POSIX-like functions, although there are a few specific ones for Windows.
The section of the standard that defines the identifiers reserved for use by the implementation is 2.10, paragraph 3. As far as I know, the standard does not explicitly indicate that the implementation cannot use other identifiers, but, apparently, this implies that such an implementation cannot create a legitimate C ++ program that will use the same name in an incompatible way.
In this particular case, this is true only if the program contains the appropriate headers defined for implementation, so I'm not sure that C ++ ISO really requires Visual Studio to reject the old names, but it looks like Microsoft either believed that it did, or that using reserved identifiers is best practice. (Or that the ability to compile a POSIX as-is source should be discouraged, take your choice!)
Additional note. I would suggest that a name conflict can also cause linking problems for more complex programs, even if the headers defined by the implementation are not included. However, it is not clear that function depreciation really helps in this case, since the old names are still present in the library. (They, however, are in a different .lib file and may be improving something.)
Here you can download the November 2014 working draft of the current ISO C ++ standard.
Harry johnston
source share