diff options
author | 2017-08-16 12:24:49 +0000 | |
---|---|---|
committer | 2017-08-16 12:24:49 +0000 | |
commit | 72baf39bf3dc6572659536feb4e055c59a9816a8 (patch) | |
tree | 989686bc35e3e1e540232f39227902f730327747 | |
parent | Add -d flag to display-panes to specify timeout, and make 0 mean no (diff) | |
download | wireguard-openbsd-72baf39bf3dc6572659536feb4e055c59a9816a8.tar.xz wireguard-openbsd-72baf39bf3dc6572659536feb4e055c59a9816a8.zip |
have -Wno-* work the same on gcc3 as well.
old patch, belated test by aoyama@, okay aoyama@
-rw-r--r-- | gnu/usr.bin/gcc/gcc/c-opts.c | 18 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/gcc/toplev.c | 7 |
2 files changed, 23 insertions, 2 deletions
diff --git a/gnu/usr.bin/gcc/gcc/c-opts.c b/gnu/usr.bin/gcc/gcc/c-opts.c index 193b6f16f1b..d20dec4cf5c 100644 --- a/gnu/usr.bin/gcc/gcc/c-opts.c +++ b/gnu/usr.bin/gcc/gcc/c-opts.c @@ -520,6 +520,15 @@ c_common_init_options (lang) warn_sign_compare = -1; } +static char *bad_option; + +void +do_final_options () +{ + if (bad_option) + error ("unrecognized command line option %s", bad_option); +} + /* Handle one command-line option in (argc, argv). Can be called multiple times, to handle multiple sets of options. Returns number of strings consumed. */ @@ -576,7 +585,14 @@ c_common_decode_option (argc, argv) lang_flag = lang_flags[(c_language << 1) + flag_objc]; opt_index = find_opt (opt + 1, lang_flag); if (opt_index == N_OPTS) - goto done; + { + if (result == 0 && !on && opt[1] == 'W') + { + bad_option = argv[0]; + result = 1; + } + goto done; + } result = 1; option = &cl_options[opt_index]; diff --git a/gnu/usr.bin/gcc/gcc/toplev.c b/gnu/usr.bin/gcc/gcc/toplev.c index 673b3d31346..ed64a04c528 100644 --- a/gnu/usr.bin/gcc/gcc/toplev.c +++ b/gnu/usr.bin/gcc/gcc/toplev.c @@ -5519,6 +5519,8 @@ do_compile () It is not safe to call this function more than once. */ +extern void do_final_options (); + int toplev_main (argc, argv) int argc; @@ -5536,7 +5538,10 @@ toplev_main (argc, argv) do_compile (); if (errorcount || sorrycount) - return (FATAL_EXIT_CODE); + { + do_final_options (); + return (FATAL_EXIT_CODE); + } return (SUCCESS_EXIT_CODE); } |