Re: [Mingw-w64-public] [PATCH] stdio.h: Don't use ms_* and gnu_* format attributes on clang.
On 01/21/2018 05:26 PM, Kai Tietz via Mingw-w64-public wrote: > Patch is ok. But this is indeed problematic that clang doesn't support > different scanf/printf warning API. > For C99 printf/canf formatter diagnostic the produced warnings will be > wrong for this compiler. Yeah, I hope it will be fixed in clang at some point. I pushed my patch for now. Thanks for reviews. Jacek -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] [PATCH] stdio.h: Don't use ms_* and gnu_* format attributes on clang.
Patch is ok. But this is indeed problematic that clang doesn't support different scanf/printf warning API. For C99 printf/canf formatter diagnostic the produced warnings will be wrong for this compiler. Thanks Kai 2018-01-21 12:15 GMT+01:00 Martin Storsjö: > On Sun, 21 Jan 2018, Jacek Caban wrote: > >> clang doesn't support it, so it emits tons of warnings. >> >> Signed-off-by: Jacek Caban >> --- >> mingw-w64-headers/crt/stdio.h | 21 + >> 1 file changed, 13 insertions(+), 8 deletions(-) > > > LGTM > > // Martin > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > Mingw-w64-public mailing list > Mingw-w64-public@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] [PATCH] stdio.h: Don't use ms_* and gnu_* format attributes on clang.
On Sun, 21 Jan 2018, Jacek Caban wrote: clang doesn't support it, so it emits tons of warnings. Signed-off-by: Jacek Caban--- mingw-w64-headers/crt/stdio.h | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) LGTM // Martin -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
[Mingw-w64-public] [PATCH] stdio.h: Don't use ms_* and gnu_* format attributes on clang.
clang doesn't support it, so it emits tons of warnings. Signed-off-by: Jacek Caban--- mingw-w64-headers/crt/stdio.h | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/mingw-w64-headers/crt/stdio.h b/mingw-w64-headers/crt/stdio.h index c0243ec1..357549f1 100644 --- a/mingw-w64-headers/crt/stdio.h +++ b/mingw-w64-headers/crt/stdio.h @@ -217,15 +217,24 @@ extern int __cdecl __stdio_common_vfscanf(unsigned __int64 options, FILE *file, const char *format, _locale_t locale, va_list valist); #endif +#undef __MINGW_PRINTF_FORMAT +#undef __MINGW_SCANF_FORMAT + +#if defined(__clang__) +#define __MINGW_PRINTF_FORMAT printf +#define __MINGW_SCANF_FORMAT scanf +#elif defined(__USE_MINGW_ANSI_STDIO) +#define __MINGW_PRINTF_FORMAT gnu_printf +#define __MINGW_SCANF_FORMAT gnu_scanf +#else +#define __MINGW_PRINTF_FORMAT ms_printf +#define __MINGW_SCANF_FORMAT ms_scanf +#endif #if __USE_MINGW_ANSI_STDIO /* * User has expressed a preference for C99 conformance... */ -#undef __MINGW_PRINTF_FORMAT -#undef __MINGW_SCANF_FORMAT -#define __MINGW_PRINTF_FORMAT gnu_printf -#define __MINGW_SCANF_FORMAT gnu_scanf #ifdef _GNU_SOURCE __mingw_ovr @@ -404,10 +413,6 @@ int vsnprintf (char *__stream, size_t __n, const char *__format, __builtin_va_li #else /* !__USE_MINGW_ANSI_STDIO */ -#undef __MINGW_PRINTF_FORMAT -#undef __MINGW_SCANF_FORMAT -#define __MINGW_PRINTF_FORMAT ms_printf -#define __MINGW_SCANF_FORMAT ms_scanf #undef __builtin_vsnprintf #undef __builtin_vsprintf -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public