[Bug c/80619] bad fix-it hint for GCC %lu directive with int argument: %wu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80619 Martin Sebor changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED Target Milestone|--- |10.0 --- Comment #7 from Martin Sebor --- Fixed by r274385.
[Bug c/80619] bad fix-it hint for GCC %lu directive with int argument: %wu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80619 --- Comment #6 from Martin Sebor --- Author: msebor Date: Tue Aug 13 15:55:40 2019 New Revision: 274385 URL: https://gcc.gnu.org/viewcvs?rev=274385&root=gcc&view=rev Log: PR c/80619 - bad fix-it hint for GCC %lu directive with int argument: %wu gcc/c-family/ChangeLog: PR c/80619 * c-format.c (printf_length_specs): Set FMT_LEN_w for "w". (asm_fprintf_length_spec): Same. * c-format.h (format_lengths): Add FMT_LEN_w. gcc/testsuite/ChangeLog: PR c/80619 * gcc.dg/format/pr80619.c: New test. Added: trunk/gcc/testsuite/gcc.dg/format/pr80619.c Modified: trunk/gcc/c-family/ChangeLog trunk/gcc/c-family/c-format.c trunk/gcc/c-family/c-format.h trunk/gcc/testsuite/ChangeLog
[Bug c/80619] bad fix-it hint for GCC %lu directive with int argument: %wu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80619 Martin Sebor changed: What|Removed |Added Keywords||patch --- Comment #5 from Martin Sebor --- Patch: https://gcc.gnu.org/ml/gcc-patches/2019-08/msg00286.html
[Bug c/80619] bad fix-it hint for GCC %lu directive with int argument: %wu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80619 Martin Sebor changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |msebor at gcc dot gnu.org --- Comment #4 from Martin Sebor --- No, the bug is still there. This patch fixes it without braking any of the format.exp tests. diff --git a/gcc/c-family/c-format.c b/gcc/c-family/c-format.c index 6363fa4f686..1fa551957d9 100644 --- a/gcc/c-family/c-format.c +++ b/gcc/c-family/c-format.c @@ -497,7 +497,7 @@ static const format_length_info printf_length_specs[] = static const format_length_info asm_fprintf_length_specs[] = { { "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C89, 0 }, - { "w", FMT_LEN_none, STD_C89, NO_FMT, 0 }, + { "w", FMT_LEN_w, STD_C89, NO_FMT, 0 }, { NO_FMT, NO_FMT, 0 } }; @@ -505,7 +505,7 @@ static const format_length_info asm_fprintf_length_specs[] = static const format_length_info gcc_diag_length_specs[] = { { "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C89, 0 }, - { "w", FMT_LEN_none, STD_C89, NO_FMT, 0 }, + { "w", FMT_LEN_w, STD_C89, NO_FMT, 0 }, { NO_FMT, NO_FMT, 0 } }; diff --git a/gcc/c-family/c-format.h b/gcc/c-family/c-format.h index 972ba46f109..6aa68dfe883 100644 --- a/gcc/c-family/c-format.h +++ b/gcc/c-family/c-format.h @@ -36,6 +36,7 @@ enum format_lengths FMT_LEN_H, FMT_LEN_D, FMT_LEN_DD, + FMT_LEN_w, /* GCC's HOST_WIDE_INT. */ FMT_LEN_MAX };
[Bug c/80619] bad fix-it hint for GCC %lu directive with int argument: %wu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80619 --- Comment #3 from Eric Gallager --- Did you do anything about this with your -Wformat-diag changes, Martin?
[Bug c/80619] bad fix-it hint for GCC %lu directive with int argument: %wu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80619 Eric Gallager changed: What|Removed |Added CC||dmalcolm at gcc dot gnu.org, ||dodji at gcc dot gnu.org --- Comment #2 from Eric Gallager --- cc-ing diagnostics maintainers
[Bug c/80619] bad fix-it hint for GCC %lu directive with int argument: %wu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80619 Eric Gallager changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2017-08-01 CC||egallager at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Eric Gallager --- Confirmed.