public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* make conflicting help text an error
@ 2012-05-13  9:05 Manuel López-Ibáñez
  2012-05-13 11:03 ` Joseph S. Myers
  2022-03-30 20:42 ` options: Fix "Multiple different help strings" error diagnostic " Thomas Schwinge
  0 siblings, 2 replies; 6+ messages in thread
From: Manuel López-Ibáñez @ 2012-05-13  9:05 UTC (permalink / raw)
  To: Gcc Patch List; +Cc: Joseph S. Myers, Arnaud Charlet

[-- 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
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-03-31 17:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-13  9:05 make conflicting help text an error Manuel López-Ibáñez
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

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).