summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authornickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4>1999-10-19 13:02:39 +0000
committernickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4>1999-10-19 13:02:39 +0000
commit050964ce469ea77d2e1dc6d76f4aa9838579e648 (patch)
treef5ad6f3f61643dca3f71111700483edc3f24317a /gcc
parent231d1a2b3a4a04b41c8bbad742fc6e955e1519e8 (diff)
downloadgcc-050964ce469ea77d2e1dc6d76f4aa9838579e648.tar.gz
Do not generate error message about unrecognised command line switches of
other languages. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30085 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/toplev.c35
2 files changed, 41 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7be360ddcb3..54dc7154700 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+Tue Oct 19 14:01:34 1999 Nick Clifton <nickc@cygnus.com>
+
+ * toplev.c (main): Do not generate an error message if an
+ unrecognised command line switch is recognisable by another
+ language. If extra_warnings are enabled, then generate a
+ warning message instead.
+
Tue Oct 19 11:41:12 1999 Mumit Khan <khan@xraylith.wisc.edu>
* c-pragma.h (PRAGMA_INSERT_ATTRIBUTES): Delete macro.
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 753d65d65cf..95bda3d7c3b 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -5414,7 +5414,40 @@ main (argc, argv)
? lang_processed : indep_processed);
else
{
- warning ("ignoring option `%s'", argv[i]);
+ const char * option = NULL;
+ const char * lang = NULL;
+ unsigned int j;
+
+ /* It is possible that the command line switch is not valid for the
+ current language, but it is valid for another language. In order
+ to be compatible with previous versions of the compiler (which
+ did not issue an error message in this case) we check for this
+ possibilty here. If we do find a match, then if extra_warnings
+ is set we generate a warning message, otherwise we will just
+ ignore the option. */
+ for (j = 0; j < NUM_ELEM (documented_lang_options); j++)
+ {
+ option = documented_lang_options[j].option;
+
+ if (option == NULL)
+ lang = documented_lang_options[j].description;
+ else if (! strncmp (argv[i], option, strlen (option)))
+ break;
+ }
+
+ if (option)
+ {
+ if (extra_warnings)
+ {
+ warning ("Ignoring command line option '%s'", argv[i]);
+ if (lang)
+ warning ("\
+(It is valid for %s but not the selected langauge)", lang);
+ }
+ }
+ else
+ error ("Unrecognised option `%s'", argv[i]);
+
i++;
}
}