This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/77671] missing -Wformat-length warning on sprintf overflow with "%s"
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 21 Sep 2016 07:09:03 +0000
- Subject: [Bug middle-end/77671] missing -Wformat-length warning on sprintf overflow with "%s"
- Auto-submitted: auto-generated
- References: <bug-77671-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77671
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That is because the latter is folded into strcpy early by
gimple_fold_builtin_sprintf (already during the gimplification).
I'm certainly surprised we do it even at -O0, IMHO we shouldn't. But whether
for -O and above we want to defer until after the lowering passes are done so
that your pass can do something about that is another thing.