[Bug c/116082] -Wunterminated-string-initialization should not warn about strings that end with "\0" but should warn still for -Wc++-compat
uecker at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jul 25 05:55:12 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116082
uecker at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |uecker at gcc dot gnu.org
--- Comment #1 from uecker at gcc dot gnu.org ---
Should it?
Isnt't this a hack to get the same effect you now get more easily with
-Wunterminated-string-initialization? Then maybe the recommendation should be
to remove this and rely on the warning in the future.
I wonder also whether there are situation where you want to get the two null
bytes and the warning would still make sense (although
-Wtruncated-string-initialization would then make more sense as a name)
More information about the Gcc-bugs
mailing list