[Bug middle-end/77784] duplicate warning for snprintf when n > object size
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Sep 28 20:09:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77784
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The preexisting warning is not that misleading, because even if there is not
any buffer overflow, the program is still terminated whenever the user provided
buffer size is bigger than the __builtin_object_size provided size, without
actually trying to print anything into the buffer. If you want to suggest
different wording for the *snprintf* case, it could be changed, but I believe
it is the right spot for the warning - after all the GIMPLE optimizations,
regardless of what warning options are enabled or not.
More information about the Gcc-bugs
mailing list