Pali Rohár <[email protected]> wrote:

> In my opinion MS underscored functions should do what MS implementation
> is doing, including all those MS bugs. If somebody needs POSIX behavior
> then should use POSIX functions which are without leading underscore.
> That is why underscored functions are untouched.

I agree; the underscored versions should provide Microsoft's behavior whenever 
possible. Functions with standard names such as `stat` should behave according 
to standard they came from, which is POSIX in case of `stat`.

I'd like to mention that Microsoft deprecated[1] standard names of functions 
which also have a version with an underscore.

More, when using MSVC's option /Zc:__STDC__[2], which causes __STDC__ macro be 
defined to 1 for C compilations, it will not expose those deprecated names. 
This effect can be reverted by defining `_CRT_DECLARE_NONSTDC_NAMES`. However, 
in C++ mode, it will always expose those deprecated names.

If someone needs to use Microsoft's version of some function, they should 
always call an underscored version.

[1] https://learn.microsoft.com/en-us/cpp/c-runtime-library/compatibility
[2] https://learn.microsoft.com/en-us/cpp/build/reference/zc-stdc

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to