* [Bug c++/103758] bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag]
2021-12-17 17:30 [Bug c++/103758] New: bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag] mpolacek at gcc dot gnu.org
@ 2021-12-17 17:31 ` jason at gcc dot gnu.org
2021-12-17 17:31 ` mpolacek at gcc dot gnu.org
` (16 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: jason at gcc dot gnu.org @ 2021-12-17 17:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103758
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2021-12-17
Ever confirmed|0 |1
--- Comment #1 from Jason Merrill <jason at gcc dot gnu.org> ---
Agreed.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103758] bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag]
2021-12-17 17:30 [Bug c++/103758] New: bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag] mpolacek at gcc dot gnu.org
2021-12-17 17:31 ` [Bug c++/103758] " jason at gcc dot gnu.org
@ 2021-12-17 17:31 ` mpolacek at gcc dot gnu.org
2021-12-17 19:27 ` mpolacek at gcc dot gnu.org
` (15 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-12-17 17:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103758
--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Incidentally, this
error ("%<decl-specifier%> invalid in condition");
in cp_parser_decl_specifier_seq should be adjusted as well.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103758] bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag]
2021-12-17 17:30 [Bug c++/103758] New: bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag] mpolacek at gcc dot gnu.org
2021-12-17 17:31 ` [Bug c++/103758] " jason at gcc dot gnu.org
2021-12-17 17:31 ` mpolacek at gcc dot gnu.org
@ 2021-12-17 19:27 ` mpolacek at gcc dot gnu.org
2022-01-03 21:27 ` cvs-commit at gcc dot gnu.org
` (14 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-12-17 19:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103758
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |mpolacek at gcc dot gnu.org
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103758] bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag]
2021-12-17 17:30 [Bug c++/103758] New: bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag] mpolacek at gcc dot gnu.org
` (2 preceding siblings ...)
2021-12-17 19:27 ` mpolacek at gcc dot gnu.org
@ 2022-01-03 21:27 ` cvs-commit at gcc dot gnu.org
2022-01-03 21:28 ` mpolacek at gcc dot gnu.org
` (13 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-03 21:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103758
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:bb936163e28fdbe1a751c55d5e5975e036322a3d
commit r12-6195-gbb936163e28fdbe1a751c55d5e5975e036322a3d
Author: Marek Polacek <polacek@redhat.com>
Date: Fri Dec 17 14:34:12 2021 -0500
c-family: Have -Wformat-diag accept "decl-specifier" [PR103758]
I'm tired of seeing
cp/parser.c:15923:55: warning: misspelled term 'decl' in format; use
'declaration' instead [-Wformat-diag]
cp/parser.c:15925:57: warning: misspelled term 'decl' in format; use
'declaration' instead [-Wformat-diag]
every time I compile cp/parser.c, which happens...a lot. I'd like my
compilation to be free of warnings, otherwise I'm going to miss some
important ones.
"decl-specifiers" is a C++ grammar term; it is not actual code, so
should not be wrapped with %< %>. I hope we can accept it as an exception
in check_tokens.
It was surrounded by %< %> in cp_parser_decl_specifier_seq, so fix that.
In passing, fix a misspelling in missspellings.
PR c++/103758
gcc/c-family/ChangeLog:
* c-format.c (check_tokens): Accept "decl-specifier*".
gcc/cp/ChangeLog:
* parser.c (cp_parser_decl_specifier_seq): Replace
%<decl-specifier%>
with %qD.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/constexpr-condition.C: Adjust dg-error.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103758] bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag]
2021-12-17 17:30 [Bug c++/103758] New: bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag] mpolacek at gcc dot gnu.org
` (3 preceding siblings ...)
2022-01-03 21:27 ` cvs-commit at gcc dot gnu.org
@ 2022-01-03 21:28 ` mpolacek at gcc dot gnu.org
2022-01-05 8:48 ` marxin at gcc dot gnu.org
` (12 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-01-03 21:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103758
--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed in GCC 12, will backport to GCC 11 around Jan 17.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103758] bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag]
2021-12-17 17:30 [Bug c++/103758] New: bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag] mpolacek at gcc dot gnu.org
` (4 preceding siblings ...)
2022-01-03 21:28 ` mpolacek at gcc dot gnu.org
@ 2022-01-05 8:48 ` marxin at gcc dot gnu.org
2022-01-05 15:14 ` mpolacek at gcc dot gnu.org
` (11 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-01-05 8:48 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103758
--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
Btw. can we remove the last 3 remaining warnings for x86_64 and enabled
-Werror=format-diag (at least for bootstrap on x86_64):
/home/marxin/Programming/gcc/gcc/c-family/c-pragma.c:774:60: warning: unquoted
identifier or keyword ‘ignored_attributes’ in format [-Wformat-diag]
/home/marxin/Programming/gcc/gcc/c-family/c-pragma.c:833:61: warning: unquoted
identifier or keyword ‘ignored_attributes’ in format [-Wformat-diag]
/home/marxin/Programming/gcc/gcc/gimple-ssa-warn-access.cc:2844:30: warning:
quoted ‘%s’ directive in format; use ‘%qs’ instead [-Wformat-diag]
We've got -Wformat-diag for quite some time, but we haven't enabled -Werror for
it yet.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103758] bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag]
2021-12-17 17:30 [Bug c++/103758] New: bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag] mpolacek at gcc dot gnu.org
` (5 preceding siblings ...)
2022-01-05 8:48 ` marxin at gcc dot gnu.org
@ 2022-01-05 15:14 ` mpolacek at gcc dot gnu.org
2022-01-05 15:32 ` jakub at gcc dot gnu.org
` (10 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-01-05 15:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103758
--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Yes, the one in gimple-ssa-warn-access.c looks trivial, the other two are mine,
and will probably need another exception.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103758] bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag]
2021-12-17 17:30 [Bug c++/103758] New: bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag] mpolacek at gcc dot gnu.org
` (6 preceding siblings ...)
2022-01-05 15:14 ` mpolacek at gcc dot gnu.org
@ 2022-01-05 15:32 ` jakub at gcc dot gnu.org
2022-01-05 15:33 ` jakub at gcc dot gnu.org
` (9 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-01-05 15:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103758
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
For ignored_attributes, I must say I don't really like the missing [x|y|z]
after ... wording, missing %<x%>, %<y%>, %<z%> after ... would be slightly less
compact, but more readable. All of that appears in c-pragma.c and not
elsewhere:
c-family/c-pragma.c: GCC_BAD ("missing [big-endian|little-endian|default]
after %<#pragma scalar_storage_order%>");
c-family/c-pragma.c: GCC_BAD ("expected [big-endian|little-endian|default]
after %<#pragma scalar_storage_order%>");
c-family/c-pragma.c: "missing
[error|warning|ignored|push|pop|ignored_attributes]"
c-family/c-pragma.c: "expected
[error|warning|ignored|push|pop|ignored_attributes]"
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103758] bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag]
2021-12-17 17:30 [Bug c++/103758] New: bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag] mpolacek at gcc dot gnu.org
` (7 preceding siblings ...)
2022-01-05 15:32 ` jakub at gcc dot gnu.org
@ 2022-01-05 15:33 ` jakub at gcc dot gnu.org
2022-01-05 15:38 ` mpolacek at gcc dot gnu.org
` (8 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-01-05 15:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103758
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
%<x>, %<y>, or %<z> after actually.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103758] bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag]
2021-12-17 17:30 [Bug c++/103758] New: bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag] mpolacek at gcc dot gnu.org
` (8 preceding siblings ...)
2022-01-05 15:33 ` jakub at gcc dot gnu.org
@ 2022-01-05 15:38 ` mpolacek at gcc dot gnu.org
2022-01-05 15:49 ` msebor at gcc dot gnu.org
` (7 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-01-05 15:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103758
--- Comment #9 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Sure, I can make that change!
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103758] bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag]
2021-12-17 17:30 [Bug c++/103758] New: bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag] mpolacek at gcc dot gnu.org
` (9 preceding siblings ...)
2022-01-05 15:38 ` mpolacek at gcc dot gnu.org
@ 2022-01-05 15:49 ` msebor at gcc dot gnu.org
2022-01-06 0:43 ` cvs-commit at gcc dot gnu.org
` (6 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: msebor at gcc dot gnu.org @ 2022-01-05 15:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103758
--- Comment #10 from Martin Sebor <msebor at gcc dot gnu.org> ---
The diagnostic kinds in the call:
warning_at (loc, OPT_Wpragmas,
"missing [error|warning|ignored|push|pop|ignored_attributes]"
" after %<#pragma GCC diagnostic%>");
should be quoted, just like the #pragma. (That's also what the message is
telling us.)
That said, rather than adding exceptions for every term of grammar that
triggers this warning, adding a new quoting directive will avoid the problem
and also let us annotate them in their own font (e.g., in italics).
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103758] bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag]
2021-12-17 17:30 [Bug c++/103758] New: bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag] mpolacek at gcc dot gnu.org
` (10 preceding siblings ...)
2022-01-05 15:49 ` msebor at gcc dot gnu.org
@ 2022-01-06 0:43 ` cvs-commit at gcc dot gnu.org
2022-01-17 18:33 ` cvs-commit at gcc dot gnu.org
` (5 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-06 0:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103758
--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:1935db296892bbd9fc597889237528bd7e080ab1
commit r12-6277-g1935db296892bbd9fc597889237528bd7e080ab1
Author: Marek Polacek <polacek@redhat.com>
Date: Wed Jan 5 17:53:30 2022 -0500
Avoid more -Wformat-diag warnings [PR103758]
Let's use "%<x>, %<y>, or %<z>" rather than "[x|y|z]" as in the rest of
our codebase.
PR c++/103758
gcc/c-family/ChangeLog:
* c-pragma.c (handle_pragma_scalar_storage_order): Use %< %> in
diagnostic messages.
(handle_pragma_diagnostic): Likewise.
gcc/testsuite/ChangeLog:
* gcc.dg/sso-6.c: Update dg-warning.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103758] bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag]
2021-12-17 17:30 [Bug c++/103758] New: bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag] mpolacek at gcc dot gnu.org
` (11 preceding siblings ...)
2022-01-06 0:43 ` cvs-commit at gcc dot gnu.org
@ 2022-01-17 18:33 ` cvs-commit at gcc dot gnu.org
2022-01-17 18:33 ` mpolacek at gcc dot gnu.org
` (4 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-17 18:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103758
--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Marek Polacek
<mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:a59360efef52468ad4648304f7ba56037f130a9a
commit r11-9472-ga59360efef52468ad4648304f7ba56037f130a9a
Author: Marek Polacek <polacek@redhat.com>
Date: Fri Dec 17 14:34:12 2021 -0500
c-family: Have -Wformat-diag accept "decl-specifier" [PR103758]
I'm tired of seeing
cp/parser.c:15923:55: warning: misspelled term 'decl' in format; use
'declaration' instead [-Wformat-diag]
cp/parser.c:15925:57: warning: misspelled term 'decl' in format; use
'declaration' instead [-Wformat-diag]
every time I compile cp/parser.c, which happens...a lot. I'd like my
compilation to be free of warnings, otherwise I'm going to miss some
important ones.
"decl-specifiers" is a C++ grammar term; it is not actual code, so
should not be wrapped with %< %>. I hope we can accept it as an exception
in check_tokens.
It was surrounded by %< %> in cp_parser_decl_specifier_seq, so fix that.
In passing, fix a misspelling in missspellings.
PR c++/103758
gcc/c-family/ChangeLog:
* c-format.c (check_tokens): Accept "decl-specifier*".
gcc/cp/ChangeLog:
* parser.c (cp_parser_decl_specifier_seq): Replace
%<decl-specifier%>
with %qD.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/constexpr-condition.C: Adjust dg-error.
(cherry picked from commit bb936163e28fdbe1a751c55d5e5975e036322a3d)
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103758] bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag]
2021-12-17 17:30 [Bug c++/103758] New: bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag] mpolacek at gcc dot gnu.org
` (12 preceding siblings ...)
2022-01-17 18:33 ` cvs-commit at gcc dot gnu.org
@ 2022-01-17 18:33 ` mpolacek at gcc dot gnu.org
2022-01-17 18:39 ` mpolacek at gcc dot gnu.org
` (3 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-01-17 18:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103758
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #13 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Now fixed in GCC 11 too.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103758] bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag]
2021-12-17 17:30 [Bug c++/103758] New: bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag] mpolacek at gcc dot gnu.org
` (13 preceding siblings ...)
2022-01-17 18:33 ` mpolacek at gcc dot gnu.org
@ 2022-01-17 18:39 ` mpolacek at gcc dot gnu.org
2022-01-17 18:45 ` jakub at gcc dot gnu.org
` (2 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-01-17 18:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103758
--- Comment #14 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Oops, that broke the build:
.../c-family/c-format.c:3229:22: error: ‘startswith’ was not declared in this
scope
3229 | && startswith (format_chars, "decl-specifier"))
I've reverted the patch.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103758] bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag]
2021-12-17 17:30 [Bug c++/103758] New: bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag] mpolacek at gcc dot gnu.org
` (14 preceding siblings ...)
2022-01-17 18:39 ` mpolacek at gcc dot gnu.org
@ 2022-01-17 18:45 ` jakub at gcc dot gnu.org
2022-01-17 18:47 ` mpolacek at gcc dot gnu.org
2022-01-17 21:27 ` cvs-commit at gcc dot gnu.org
17 siblings, 0 replies; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-01-17 18:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103758
--- Comment #15 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Just replace startswith (x, y) with strncmp (x, y, strlen (y)) == 0 for 11 and
earlier.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103758] bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag]
2021-12-17 17:30 [Bug c++/103758] New: bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag] mpolacek at gcc dot gnu.org
` (15 preceding siblings ...)
2022-01-17 18:45 ` jakub at gcc dot gnu.org
@ 2022-01-17 18:47 ` mpolacek at gcc dot gnu.org
2022-01-17 21:27 ` cvs-commit at gcc dot gnu.org
17 siblings, 0 replies; 19+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-01-17 18:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103758
--- Comment #16 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Yeah, I'm testing a patch which does just that.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug c++/103758] bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag]
2021-12-17 17:30 [Bug c++/103758] New: bogus warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag] mpolacek at gcc dot gnu.org
` (16 preceding siblings ...)
2022-01-17 18:47 ` mpolacek at gcc dot gnu.org
@ 2022-01-17 21:27 ` cvs-commit at gcc dot gnu.org
17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-17 21:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103758
--- Comment #17 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Marek Polacek
<mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:2c4b5bd4440292eca51de1f09ccce0d139ab981e
commit r11-9474-g2c4b5bd4440292eca51de1f09ccce0d139ab981e
Author: Marek Polacek <polacek@redhat.com>
Date: Mon Jan 17 16:26:01 2022 -0500
c-family: Have -Wformat-diag accept "decl-specifier" [PR103758]
I'm tired of seeing
cp/parser.c:15923:55: warning: misspelled term 'decl' in format; use
'declaration' instead [-Wformat-diag]
cp/parser.c:15925:57: warning: misspelled term 'decl' in format; use
'declaration' instead [-Wformat-diag]
every time I compile cp/parser.c, which happens...a lot. I'd like my
compilation to be free of warnings, otherwise I'm going to miss some
important ones.
"decl-specifiers" is a C++ grammar term; it is not actual code, so
should not be wrapped with %< %>. I hope we can accept it as an exception
in check_tokens.
It was surrounded by %< %> in cp_parser_decl_specifier_seq, so fix that.
In passing, fix a misspelling in missspellings.
PR c++/103758
gcc/c-family/ChangeLog:
* c-format.c (check_tokens): Accept "decl-specifier*".
gcc/cp/ChangeLog:
* parser.c (cp_parser_decl_specifier_seq): Replace
%<decl-specifier%>
with %qD.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/constexpr-condition.C: Adjust dg-error.
(cherry picked from commit bb936163e28fdbe1a751c55d5e5975e036322a3d)
^ permalink raw reply [flat|nested] 19+ messages in thread