Within the implementation of __gets_chk(), we call gets(), in cases that should be safe (or as safe as they possibly can).
As cases within the build of the CRT itself can be considered well checked, disable this warning for those cases. With Clang it is also possible to silence this warning inline with a #pragma GCC diagnostic ignored "-Wattribute-warning", but GCC doesn't support any specific -Wno-<diag> option for silencing an explicit __attribute__((warning)). Signed-off-by: Martin Storsjö <[email protected]> --- mingw-w64-headers/crt/stdio.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mingw-w64-headers/crt/stdio.h b/mingw-w64-headers/crt/stdio.h index 93c5db5d3..d8eedacaa 100644 --- a/mingw-w64-headers/crt/stdio.h +++ b/mingw-w64-headers/crt/stdio.h @@ -601,7 +601,10 @@ int vsnprintf (char *__stream, size_t __n, const char *__format, __builtin_va_li int __cdecl getchar(void); _CRTIMP int __cdecl _getmaxstdio(void); char *__cdecl gets(char *_Buffer) - __attribute__((__warning__("Using gets() is always unsafe - use fgets() instead"))); +#ifndef _CRTBLD + __attribute__((__warning__("Using gets() is always unsafe - use fgets() instead"))) +#endif +; int __cdecl _getw(FILE *_File); #ifndef _CRT_PERROR_DEFINED #define _CRT_PERROR_DEFINED -- 2.43.0 _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
