diff options
Diffstat (limited to 'gcc/c-opts.c')
-rw-r--r-- | gcc/c-opts.c | 47 |
1 files changed, 1 insertions, 46 deletions
diff --git a/gcc/c-opts.c b/gcc/c-opts.c index 3de89e488f6..7febbf315a1 100644 --- a/gcc/c-opts.c +++ b/gcc/c-opts.c @@ -102,8 +102,6 @@ static size_t include_cursor; static void missing_arg (enum opt_code); static void set_Wimplicit (int); -static void complain_wrong_lang (size_t, int); -static void write_langs (char *, int); static void print_help (void); static void handle_OPT_d (const char *); static void set_std_cxx98 (int); @@ -245,7 +243,7 @@ c_common_handle_option (size_t scode, const char *arg, int value) { const struct cl_option *option = &cl_options[scode]; enum opt_code code = (enum opt_code) scode; - int result = 1, lang_mask; + int result = 1; if (code == N_OPTS) { @@ -259,13 +257,6 @@ c_common_handle_option (size_t scode, const char *arg, int value) return 1; } - lang_mask = lang_flags[(c_language << 1) + flag_objc]; - if (!(option->flags & lang_mask)) - { - complain_wrong_lang (code, value); - return 1; - } - if (arg == NULL && (option->flags & (CL_JOINED | CL_SEPARATE))) { missing_arg (code); @@ -1511,42 +1502,6 @@ handle_OPT_d (const char *arg) } } -/* Write a slash-separated list of languages in FLAGS to BUF. */ -static void -write_langs (char *buf, int flags) -{ - *buf = '\0'; - if (flags & CL_C) - strcat (buf, "C"); - if (flags & CL_ObjC) - { - if (*buf) - strcat (buf, "/"); - strcat (buf, "ObjC"); - } - if (flags & CL_CXX) - { - if (*buf) - strcat (buf, "/"); - strcat (buf, "C++"); - } -} - -/* Complain that switch OPT_INDEX does not apply to this front end. */ -static void -complain_wrong_lang (size_t opt_index, int on) -{ - char ok_langs[60], bad_langs[60]; - int ok_flags = cl_options[opt_index].flags; - - write_langs (ok_langs, ok_flags); - write_langs (bad_langs, ~ok_flags); - /* Eventually this should become a hard error. */ - warning ("\"-%c%s%s\" is valid for %s but not for %s", - cl_options[opt_index].opt_text[0], on ? "" : "no-", - cl_options[opt_index].opt_text + 1, ok_langs, bad_langs); -} - /* Handle --help output. */ static void print_help (void) |