在 2023/2/14 20:19, Christian Franke 写道:
If gets() is used without _FORTIFY_SOURCE, a warning should IMO be printed regardless of __MINGW_MSVC_COMPAT_WARNINGS etc.

It is the same warning text used if _FORTIFY_SOURCE is enabled and gets() is called instead of __gets_chk().

More strict handling would also be possible, but I'm not sure whether one of 
these should be added:
- Fail with attribute(error(...)) if gets() is used and C11/C++14 is enabled as these standards finally removed this function. - Fail with attribute(error(...)) if _FORTIFY_SOURCE is enabled and gets() is called instead of __gets_chk().



Yeah I agree that this always deserves a warning.

It's probably not good to make it a hard error. For some disposable, one-time use, experimental little programs, which require no proper error handling, `gets()` is probably fine.

So, this patch looks good to me. Pushed now. Thanks.


--
Best regards,
LIU Hao

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

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

Reply via email to