public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-7942] options: Fix "Multiple different help strings" error diagnostic
@ 2022-03-31 18:30 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-03-31 18:30 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:6c0e2645933449461d44fd2dce4fedf94199838c
commit r12-7942-g6c0e2645933449461d44fd2dce4fedf94199838c
Author: Thomas Schwinge <thomas@codesourcery.com>
Date: Wed Mar 30 22:22:49 2022 +0200
options: Fix "Multiple different help strings" error diagnostic
This currently causes a confusing litany, for example:
options.cc:3245:2: error: #error Multiple different help strings for Wunused-result:
#error Multiple different help strings for Wunused-result:
^
options.cc:3246:2: error: 'Warn' was not declared in this scope
Warn if a caller of a function, marked with attribute warn_unused_result, does not use its return value.
^
options.cc:3246:7: error: expected '}' before 'if'
Warn if a caller of a function, marked with attribute warn_unused_result, does not use its return value.
^
options.cc:3246:7: error: expected ',' or ';' before 'if'
options.cc:3256:54: error: expected unqualified-id before ',' token
(unsigned short) -1, 0, CLVC_INTEGER, 0, -1, -1 },
^
[going on for several thousands of lines]
Fixed:
options.cc:3245:2: error: #error Multiple different help strings for Wunused-result:
#error Multiple different help strings for Wunused-result:
^
options.cc:3246:2: error: #error Warn if a caller of a function, marked with attribute warn_unused_result, does not use its return value.
#error Warn if a caller of a function, marked with attribute warn_unused_result, does not use its return value.
^
options.cc:3247:2: error: #error TEST.
#error TEST.
^
Fix-up for r187437/commit 71caddc5568f59a5990f39226f60979a7fe953ef
"optc-gen.awk: Error instead of warning for conflicting help".
gcc/
* optc-gen.awk <END>: Fix "Multiple different help strings" error
diagnostic.
Diff:
---
gcc/optc-gen.awk | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/gcc/optc-gen.awk b/gcc/optc-gen.awk
index f2198b253ad..b51688d284f 100644
--- a/gcc/optc-gen.awk
+++ b/gcc/optc-gen.awk
@@ -316,9 +316,12 @@ for (i = 0; i < n_opts; i++) {
flags[i + 1] = flags[i] " " flags[i + 1];
if (help[i + 1] == "")
help[i + 1] = help[i]
- else if (help[i] != "" && help[i + 1] != help[i])
+ else if (help[i] != "" && help[i + 1] != help[i]) {
print "#error Multiple different help strings for " \
- opts[i] ":\n\t" help[i] "\n\t" help[i + 1]
+ opts[i] ":"
+ print "#error " help[i]
+ print "#error " help[i + 1]
+ }
i++;
back_chain[i] = "N_OPTS";
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-31 18:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-31 18:30 [gcc r12-7942] options: Fix "Multiple different help strings" error diagnostic Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).