From: "Manuel López-Ibáñez" <lopezibanez@gmail.com>
To: Gcc Patch List <gcc-patches@gcc.gnu.org>
Cc: "Joseph S. Myers" <joseph@codesourcery.com>,
Arnaud Charlet <charlet@adacore.com>
Subject: make conflicting help text an error
Date: Sun, 13 May 2012 09:05:00 -0000 [thread overview]
Message-ID: <CAESRpQAS8m0Gyy3LLZkiVjwoOs4OUYTzZAd3aHTdAwm-JH0F2Q@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 835 bytes --]
Hi,
These warnings are invisible when building but they may help to detect
if an option is duplicated somewhere else with different purpose , so
it would be better to make this an error,
Only 2 options in Ada trigger this warning, and their help text has no
effect, since it gest overridden by the ones in c.opt. Fixing this
properly would require language-specific namespace, so two options
with the same name in different languages can have completely
different help text (and Init() and other flags). Not something I am
planning to work on in the future.
OK?
2012-05-13 Manuel López-Ibáñez <manu@gcc.gnu.org>
gcc/
* optc-gen.awk: Error instead of warning for conflicting help.
ada/
* gcc-interface/lang.opt (I): Comment out help text with no effect.
(nostdinc): Comment out help text with no effect.
[-- Attachment #2: p.diff --]
[-- Type: application/octet-stream, Size: 1572 bytes --]
Index: gcc/optc-gen.awk
===================================================================
--- gcc/optc-gen.awk (revision 187427)
+++ gcc/optc-gen.awk (working copy)
@@ -186,13 +186,13 @@ for (i = 0; i < n_opts; i++) {
while( i + 1 != n_opts && opts[i] == opts[i + 1] ) {
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])
- print "warning: multiple different help strings for " \
- opts[i] ":\n\t" help[i] "\n\t" help[i + 1] \
- | "cat 1>&2"
+ print "#error Multiple different help strings for " \
+ opts[i] ":\n\t" help[i] "\n\t" help[i + 1]
+
i++;
back_chain[i] = "N_OPTS";
indices[opts[i]] = j;
}
j++;
Index: gcc/ada/gcc-interface/lang.opt
===================================================================
--- gcc/ada/gcc-interface/lang.opt (revision 187427)
+++ gcc/ada/gcc-interface/lang.opt (working copy)
@@ -46,11 +46,11 @@ Ada AdaWhy Alias(nostdinc)
-no-standard-libraries
Ada AdaWhy Alias(nostdlib)
I
Ada AdaWhy Joined Separate
--I <dir>. Add <dir> to the end of the main source path
+; Documented in C but it should be: -I <dir>. Add <dir> to the end of the main source path
Wall
Ada AdaWhy
Enable most warning messages
@@ -58,11 +58,11 @@ k8
Driver
Synonym of -gnatk8
nostdinc
Ada AdaWhy RejectNegative
-Do not look for source files in standard path
+; Documented in C but it should be: Do not look for source files in standard path
nostdlib
Ada AdaWhy
Do not look for object files in standard path
next reply other threads:[~2012-05-13 9:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-13 9:05 Manuel López-Ibáñez [this message]
2012-05-13 11:03 ` Joseph S. Myers
2022-03-30 21:09 ` options: Clarifications around option definition records' help texts (was: make conflicting help text an error) Thomas Schwinge
2022-03-31 17:18 ` Joseph Myers
2022-03-30 20:42 ` options: Fix "Multiple different help strings" error diagnostic " Thomas Schwinge
2022-03-31 17:17 ` Joseph Myers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAESRpQAS8m0Gyy3LLZkiVjwoOs4OUYTzZAd3aHTdAwm-JH0F2Q@mail.gmail.com \
--to=lopezibanez@gmail.com \
--cc=charlet@adacore.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=joseph@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).