diff options
author | Neil Booth <neil@daikokuya.co.uk> | 2003-06-25 20:43:11 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2003-06-25 20:43:11 +0000 |
commit | f18754d6403e23cb34e62bb6e09a15a357fa2782 (patch) | |
tree | 25f8abe318d6c95cb74e8c8f0c6880e9b296e4bf /gcc/toplev.c | |
parent | 37f2200463a45c51ccb631f74439475b135907cf (diff) | |
download | gcc-f18754d6403e23cb34e62bb6e09a15a357fa2782.zip gcc-f18754d6403e23cb34e62bb6e09a15a357fa2782.tar.gz gcc-f18754d6403e23cb34e62bb6e09a15a357fa2782.tar.bz2 |
c-opts.c (complain_wrong_lang, [...]): Remove.
* c-opts.c (complain_wrong_lang, write_langs): Remove.
(c_common_handle_option): Complaints about wrong language are
handled in opts.c now.
* opts.c (complain_wrong_lang, write_langs, handle_options): New.
(find_opt): Fix thinko.
(handle_option): Update prototype. Complain about switches for
a different front end.
* opts.h (lang_names, handle_options): New.
(handle_option): Remove.
* opts.sh: Write out language names array.
* toplev.c (parse_options_and_default_flags): Use handle_options.
From-SVN: r68495
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r-- | gcc/toplev.c | 53 |
1 files changed, 1 insertions, 52 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c index c36bb6b..68fbb29 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -4735,58 +4735,7 @@ parse_options_and_default_flags (int argc, char **argv) OPTIMIZATION_OPTIONS (optimize, optimize_size); #endif - /* Perform normal command line switch decoding. */ - for (i = 1; i < argc;) - { - int processed; - - /* Give the language a chance to decode the option for itself. */ - processed = handle_option (argc - i, argv + i, lang_mask); - - if (processed) - i += processed; - else - { - 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 - possibility 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 < ARRAY_SIZE (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 (j != ARRAY_SIZE (documented_lang_options)) - { - if (extra_warnings) - { - warning ("ignoring command line option '%s'", argv[i]); - if (lang) - warning - ("(it is valid for %s but not the selected language)", - lang); - } - } - else if (argv[i][0] == '-' && argv[i][1] == 'g') - warning ("`%s': unknown or unsupported -g option", &argv[i][2]); - else - error ("unrecognized option `%s'", argv[i]); - - i++; - } - } + handle_options (argc, argv, lang_mask); if (flag_pie) flag_pic = flag_pie; |