Hey,

while trying to get everything to build with UCRT in MSYS2 we noticed
quite a few errors that come down to the following:

// gcc -D__USE_MINGW_ANSI_STDIO=1 a.c
#define snprintf _snprintf
#include <stdio.h>
int main (){return 0;}

i.e. snprintf is defined before stdio.h, messing it up

I see that stdio.h already includes the following pattern to work
around this in other cases:

#pragma push_macro("snprintf")
#pragma push_macro("vsnprintf")
# undef snprintf
# undef vsnprintf
...
#pragma pop_macro ("vsnprintf")
#pragma pop_macro ("snprintf")

Would it make sense to extend this to the UCRT code paths as well?


_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to