summaryrefslogtreecommitdiff
path: root/gcc/opts.c
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-02 11:41:22 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-02 11:41:22 +0000
commit67089c6ba213c45df206f3516b3f5507e36c166b (patch)
tree963a2e047cab0d224c64b2b3500d48fa1fd9039f /gcc/opts.c
parent61344f2daf012d8141a0460a5386df1541b84d1c (diff)
downloadgcc-67089c6ba213c45df206f3516b3f5507e36c166b.tar.gz
PR driver/44076
* opts.h (struct cl_option): Add alias_arg, neg_alias_arg and alias_target fields. * opt-functions.awk (opt_sanitized_name): Don't handle finline-limit=, Wlarger-than= and ftemplate-depth= specially. * optc-gen.awk: Generate alias fields. * opth-gen.awk: Explicitly give values for OPT_* enum constants. Don't generate such constants for aliases. * opts-common.c (generate_canonical_option): New. (decode_cmdline_option): Handle aliases. Use generate_canonical_option for known options instead of copying the input option text. * doc/options.texi (Alias): Document. * common.opt (W, Wlarger-than-, aux-info=, finline-limit-, fstack-check, specs): Mark as aliases. * gcc.c (driver_handle_option): Canonicalize -L options to joined arguments. (driver_handle_option): Don't handle OPT_specs. * opts.c (common_handle_option): Don't handle options marked as aliases. (enable_warning_as_error): Handle aliases. * stor-layout.c (layout_decl): Use OPT_Wlarger_than_ instead of OPT_Wlarger_than_eq. * tree-optimize.c (tree_rest_of_compilation): Use OPT_Wlarger_than_ instead of OPT_Wlarger_than_eq. c-family: * c.opt (Wcomments, Werror-implicit-function-declaration, ftemplate-depth-, std=c89, std=c9x, std=gnu89, std=gnu9x, std=iso9899:1990, std=iso9899:1999, std=iso9899:199x): Mark as aliases. * c-common.c (option_codes): Use OPT_Wcomment instead of OPT_Wcomments. * c-opts.c (warning_as_error_callback, c_common_handle_option): Don't handle options marked as aliases. java: * lang.opt (CLASSPATH, bootclasspath, classpath, encoding, fCLASSPATH=): Mark as Java options and as aliases. * jvspec.c (jvgenmain_spec): Don't handle -fCLASSPATH*. (lang_specific_driver): Don't handle options marked as aliases. * lang.c (java_handle_option): Don't handle OPT_fCLASSPATH_. testsuite: * gcc.dg/cpp/warn-comments-3.c: New. Based on warn-comments-2.c but using -Werror=comment. * gcc.dg/cpp/warn-comments.c, gcc.dg/cpp/warn-comments-2.c: Adjust expected error messages. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163770 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/opts.c')
-rw-r--r--gcc/opts.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/gcc/opts.c b/gcc/opts.c
index 7425fa4c34e..ab7b45d5244 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -1598,11 +1598,6 @@ common_handle_option (const struct cl_decoded_option *decoded,
break;
case OPT_Wlarger_than_:
- /* This form corresponds to -Wlarger-than-.
- Kept for backward compatibility.
- Don't use it as the first argument of warning(). */
-
- case OPT_Wlarger_than_eq:
larger_than_size = value;
warn_larger_than = value != -1;
break;
@@ -1643,7 +1638,6 @@ common_handle_option (const struct cl_decoded_option *decoded,
break;
case OPT_aux_info:
- case OPT_aux_info_:
aux_info_file_name = arg;
flag_gen_aux_info = 1;
break;
@@ -1754,7 +1748,6 @@ common_handle_option (const struct cl_decoded_option *decoded,
break;
case OPT_finline_limit_:
- case OPT_finline_limit_eq:
set_param_value ("max-inline-insns-single", value / 2);
set_param_value ("max-inline-insns-auto", value / 2);
break;
@@ -1943,18 +1936,6 @@ common_handle_option (const struct cl_decoded_option *decoded,
warning (0, "unknown stack check parameter \"%s\"", arg);
break;
- case OPT_fstack_check:
- /* This is the same as the "specific" mode above. */
- if (value)
- flag_stack_check = STACK_CHECK_BUILTIN
- ? FULL_BUILTIN_STACK_CHECK
- : STACK_CHECK_STATIC_BUILTIN
- ? STATIC_BUILTIN_STACK_CHECK
- : GENERIC_STACK_CHECK;
- else
- flag_stack_check = NO_STACK_CHECK;
- break;
-
case OPT_fstack_limit:
/* The real switch is -fno-stack-limit. */
if (value)
@@ -2377,8 +2358,11 @@ enable_warning_as_error (const char *arg, int value, unsigned int lang_mask,
}
else
{
+ const struct cl_option *option = &cl_options[option_index];
const diagnostic_t kind = value ? DK_ERROR : DK_WARNING;
+ if (option->alias_target != N_OPTS)
+ option_index = option->alias_target;
diagnostic_classify_diagnostic (global_dc, option_index, kind,
UNKNOWN_LOCATION);
if (kind == DK_ERROR)