aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@gcc.gnu.org>2000-05-17 08:15:29 +0000
committerAndrew Cagney <cagney@gcc.gnu.org>2000-05-17 08:15:29 +0000
commit078721e1a2e6f361f4c7ed6b9017b6fb0d7211a1 (patch)
tree2543ce057f160b4e63e78f64be913189cbabb8e5 /gcc
parentef94b7f541f59ed3d9f5953a86e026cb217615b6 (diff)
downloadgcc-078721e1a2e6f361f4c7ed6b9017b6fb0d7211a1.zip
gcc-078721e1a2e6f361f4c7ed6b9017b6fb0d7211a1.tar.gz
gcc-078721e1a2e6f361f4c7ed6b9017b6fb0d7211a1.tar.bz2
Add options -Wunused-variable, -Wunused-function, -Wunused-label,
-Wunused-parameter. Retain existing -Wunused behavour. Document. From-SVN: r33953
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog31
-rw-r--r--gcc/c-decl.c6
-rw-r--r--gcc/c-typeck.c4
-rw-r--r--gcc/ch/ChangeLog6
-rw-r--r--gcc/ch/decl.c4
-rw-r--r--gcc/cp/ChangeLog9
-rw-r--r--gcc/cp/decl.c2
-rw-r--r--gcc/cp/decl2.c2
-rw-r--r--gcc/cp/typeck.c4
-rw-r--r--gcc/f/ChangeLog5
-rw-r--r--gcc/f/top.c2
-rw-r--r--gcc/flags.h12
-rw-r--r--gcc/function.c6
-rw-r--r--gcc/gcc.153
-rw-r--r--gcc/invoke.texi43
-rw-r--r--gcc/java/ChangeLog8
-rw-r--r--gcc/java/decl.c2
-rw-r--r--gcc/java/lang.c2
-rw-r--r--gcc/stmt.c7
-rw-r--r--gcc/toplev.c49
20 files changed, 215 insertions, 42 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 17dd13d..425ab78 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,34 @@
+Wed May 17 17:27:44 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * flags.h (warn_unused_function, warn_unused_label,
+ warn_unused_parameter, warn_unused_variable, warn_unused_value):
+ Replace ``warn_unused''.
+ (set_Wunused): Add declaration.
+ * toplev.c (set_Wunused): New function.
+ (warn_unused_function, warn_unused_label, warn_unused_parameter,
+ warn_unused_variable, warn_unused_value): New variables.
+ (W_options): Add -Wunused-function, -Wunused-function,
+ -Wunused-label, -Wunused-parameter, -Wunused-variable and
+ -Wunused-value. Delete -Wunused. Handled in decode_W_option.
+
+ * toplev.c (decode_W_option): Update -Wunused flags by calling
+ set_Wunused.
+ * c-decl.c (c_decode_option): Ditto for -Wall.
+
+ * stmt.c (expand_expr_stmt, expand_expr_stmt,
+ warn_about_unused_variables): Replace warn_unused with more
+ explicit warn_unused_value et.al.
+ * function.c (expand_function_end): Ditto.
+ * c-typeck.c (internal_build_compound_expr,
+ internal_build_compound_expr): Ditto.
+ * c-decl.c (poplevel, pop_label_level): Ditto.
+ * toplev.c (check_global_declarations): Replace warn_unused with
+ check for either warn_unused_function or warn_unused_variable.
+
+ * gcc.1, invoke.texi (Warning Options): Document
+ -Wunused-function, -Wunused-function, -Wunused-label,
+ -Wunused-parameter, -Wunused-variable and -Wunused-value options.
+
2000-05-16 Richard Henderson <rth@cygnus.com>
* config/ia64/crtbegin.asm (__dso_handle): Mark hidden if the
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 301a322..040b695 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -754,7 +754,7 @@ c_decode_option (argc, argv)
warn_implicit_int = 1;
mesg_implicit_function_declaration = 1;
warn_return_type = 1;
- warn_unused = 1;
+ set_Wunused (1);
warn_switch = 1;
warn_format = 1;
warn_char_subscripts = 1;
@@ -1121,7 +1121,7 @@ poplevel (keep, reverse, functionbody)
define_label (input_filename, lineno,
DECL_NAME (label));
}
- else if (warn_unused && !TREE_USED (label))
+ else if (warn_unused_label && !TREE_USED (label))
warning_with_decl (label, "label `%s' defined but not used");
IDENTIFIER_LABEL_VALUE (DECL_NAME (label)) = 0;
@@ -1282,7 +1282,7 @@ pop_label_level ()
define_label (input_filename, lineno,
DECL_NAME (TREE_VALUE (link)));
}
- else if (warn_unused && !TREE_USED (TREE_VALUE (link)))
+ else if (warn_unused_label && !TREE_USED (TREE_VALUE (link)))
warning_with_decl (TREE_VALUE (link),
"label `%s' defined but not used");
IDENTIFIER_LABEL_VALUE (DECL_NAME (TREE_VALUE (link))) = 0;
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 25c19e2..0f01c57 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -3531,7 +3531,7 @@ internal_build_compound_expr (list, first_p)
/* The left-hand operand of a comma expression is like an expression
statement: with -W or -Wunused, we should warn if it doesn't have
any side-effects, unless it was explicitly cast to (void). */
- if ((extra_warnings || warn_unused)
+ if ((extra_warnings || warn_unused_value)
&& ! (TREE_CODE (TREE_VALUE (list)) == CONVERT_EXPR
&& TREE_TYPE (TREE_VALUE (list)) == void_type_node))
warning ("left-hand operand of comma expression has no effect");
@@ -3546,7 +3546,7 @@ internal_build_compound_expr (list, first_p)
side-effects, but computes a value which is not used. For example, in
`foo() + bar(), baz()' the result of the `+' operator is not used,
so we should issue a warning. */
- else if (warn_unused)
+ else if (warn_unused_value)
warn_if_unused_value (TREE_VALUE (list));
return build (COMPOUND_EXPR, TREE_TYPE (rest), TREE_VALUE (list), rest);
diff --git a/gcc/ch/ChangeLog b/gcc/ch/ChangeLog
index 45262b3..a491bb3 100644
--- a/gcc/ch/ChangeLog
+++ b/gcc/ch/ChangeLog
@@ -1,3 +1,9 @@
+Wed May 17 17:27:44 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * decl.c (c_decode_option): Update -Wall unused flags by
+ calling set_Wunused.
+ (poplevel): Replace warn_unused with warn_unused_label.
+
2000-05-09 Zack Weinberg <zack@wolery.cumb.org>
* ch-tree.h: Update prototypes. Remove prototypes for
diff --git a/gcc/ch/decl.c b/gcc/ch/decl.c
index 9d5fd0d..45f2656 100644
--- a/gcc/ch/decl.c
+++ b/gcc/ch/decl.c
@@ -799,7 +799,7 @@ c_decode_option (argc, argv)
warn_uninitialized = 2;
warn_implicit = 1;
warn_return_type = 1;
- warn_unused = 1;
+ set_Wunused (1);
warn_char_subscripts = 1;
warn_parentheses = 1;
warn_missing_braces = 1;
@@ -2973,7 +2973,7 @@ poplevel (keep, reverse, functionbody)
define_label (input_filename, lineno,
DECL_NAME (label));
}
- else if (warn_unused && !TREE_USED (label))
+ else if (warn_unused_label && !TREE_USED (label))
warning_with_decl (label, "label `%s' defined but not used");
IDENTIFIER_LABEL_VALUE (DECL_NAME (label)) = 0;
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 1400181..d6b8431 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,12 @@
+Wed May 17 17:27:44 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * decl.c (pop_label): Replace warn_unused with warn_unused_label.
+ * typeck.c (build_x_compound_expr): Replace warn_unused with
+ warn_unused_value.
+
+ * decl2.c (lang_decode_option): Update -Wall unused flags by
+ calling set_Wunused.
+
2000-05-16 Mark Mitchell <mark@codesourcery.com>
* cp-treeh (BINFO_NEW_VTABLE_MARKED): Update documentation.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index e32f243..6f09a7a 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -1194,7 +1194,7 @@ pop_label (link)
/* Avoid crashing later. */
define_label (input_filename, 1, DECL_NAME (label));
}
- else if (warn_unused && !TREE_USED (label))
+ else if (warn_unused_label && !TREE_USED (label))
cp_warning_at ("label `%D' defined but not used", label);
}
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 39faa5d..fb399db 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -773,7 +773,7 @@ lang_decode_option (argc, argv)
else if (!strcmp (p, "all"))
{
warn_return_type = setting;
- warn_unused = setting;
+ set_Wunused (setting);
warn_implicit = setting;
warn_switch = setting;
warn_format = setting;
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 671a666..45c14453 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -5058,13 +5058,13 @@ build_x_compound_expr (list)
/* the left-hand operand of a comma expression is like an expression
statement: we should warn if it doesn't have any side-effects,
unless it was explicitly cast to (void). */
- if ((extra_warnings || warn_unused)
+ if ((extra_warnings || warn_unused_value)
&& !(TREE_CODE (TREE_VALUE(list)) == CONVERT_EXPR
&& TREE_TYPE (TREE_VALUE(list)) == void_type_node))
warning("left-hand operand of comma expression has no effect");
}
#if 0 /* this requires a gcc backend patch to export warn_if_unused_value */
- else if (warn_unused)
+ else if (warn_unused_value)
warn_if_unused_value (TREE_VALUE(list));
#endif
diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog
index c33a790..9eb3cce 100644
--- a/gcc/f/ChangeLog
+++ b/gcc/f/ChangeLog
@@ -1,3 +1,8 @@
+Wed May 17 17:27:44 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * top.c (ffe_decode_option): Update -Wall unused flags by calling
+ set_Wunused.
+
2000-05-09 Zack Weinberg <zack@wolery.cumb.org>
* com.c (ffecom_subscript_check_): Constify array_name
diff --git a/gcc/f/top.c b/gcc/f/top.c
index c48e9f1..91db6d0 100644
--- a/gcc/f/top.c
+++ b/gcc/f/top.c
@@ -510,7 +510,7 @@ ffe_decode_option (argc, argv)
warning about not using it without also specifying -O. */
if (warn_uninitialized != 1)
warn_uninitialized = 2;
- warn_unused = 1;
+ set_Wunused (1);
}
else
return 0;
diff --git a/gcc/flags.h b/gcc/flags.h
index 9ca120c..3c543bc 100644
--- a/gcc/flags.h
+++ b/gcc/flags.h
@@ -71,9 +71,17 @@ extern int inhibit_warnings;
extern int extra_warnings;
-/* Nonzero to warn about unused local variables. */
+/* Nonzero to warn about unused variables, functions et.al. Use
+ set_Wunused() to update the -Wunused-* flags that correspond to the
+ -Wunused option. */
-extern int warn_unused;
+extern void set_Wunused PARAMS ((int setting));
+
+extern int warn_unused_function;
+extern int warn_unused_label;
+extern int warn_unused_parameter;
+extern int warn_unused_variable;
+extern int warn_unused_value;
/* Nonzero to warn about code which is never reached. */
diff --git a/gcc/function.c b/gcc/function.c
index 9fd40cc..0f6785b 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -6492,7 +6492,11 @@ expand_function_end (filename, line, end_bindings)
}
/* Warn about unused parms if extra warnings were specified. */
- if (warn_unused && extra_warnings)
+ /* Either ``-W -Wunused'' or ``-Wunused-parameter'' enables this
+ warning. WARN_UNUSED_PARAMETER is negative when set by
+ -Wunused. */
+ if (warn_unused_parameter > 0
+ || (warn_unused_parameter < 0 && extra_warnings))
{
tree decl;
diff --git a/gcc/gcc.1 b/gcc/gcc.1
index d9543fa..e190751 100644
--- a/gcc/gcc.1
+++ b/gcc/gcc.1
@@ -20,7 +20,7 @@
.if n .sp
.if t .sp 0.4
..
-.Id $Id: gcc.1,v 1.13 1999/11/02 10:23:46 law Exp $
+.Id $Id: gcc.1,v 1.14 2000/04/11 06:01:52 loewis Exp $
.TH GCC 1 "\*(Dt" "GNU Tools" "GNU Tools"
.SH NAME
gcc, g++ \- GNU project C and C++ Compiler (gcc-2.96)
@@ -206,6 +206,11 @@ in the following sections.
\-Wtrigraphs
\-Wuninitialized
\-Wunused
+\-Wunused-function
+\-Wunused-label
+\-Wunused-parameter
+\-Wunused-variable
+\-Wunused-value
\-Wwrite\-strings
.TP
.B Debugging Options
@@ -1694,10 +1699,50 @@ return-value in a function whose return-type is not \c
.B void\c
\&.
.TP
+.B \-Wunused\-function
+Warn whenever a static function is declared but not defined or a
+non\-inline static function is unused.
+.TP
+.B \-Wunused\-label
+Warn whenever a label is declared but not used.
+
+To suppress this warning use the
+.B unused
+attribute.
+.TP
+.B \-Wunused\-parameter
+Warn whenever a function parameter is unused aside from its declaration.
+
+To suppress this warning use the
+.B unused
+attribute.
+.TP
+.B \-Wunused\-variable
+Warn whenever a local variable or non\-constant static variable
+is unused aside from its declaration
+
+To suppress this warning use the
+.B unused
+attribute.
+.TP
+.B \-Wunused\-value
+Warn whenever a statement computes a result that is explicitly not used.
+
+To suppress this warning cast the expression to
+.B void\c
+\&.
+.TP
.B \-Wunused
-Warn whenever a local variable is unused aside from its declaration,
-whenever a function is declared static but never defined, and whenever
-a statement computes a result that is explicitly not used.
+All all the above `\|\c
+.B \-Wunused\c
+\&\|' options combined.
+
+In order to get a warning about an unused function parameter, you must
+either specify `\|\c
+.B \-W \-Wunused\c
+\&\|' or separatly specify `\|\c
+.B \-Wunused\-parameter\c
+\&\|'.
.TP
.B \-Wswitch
Warn whenever a \c
diff --git a/gcc/invoke.texi b/gcc/invoke.texi
index c008ed0..4261cc6 100644
--- a/gcc/invoke.texi
+++ b/gcc/invoke.texi
@@ -132,7 +132,8 @@ in the following sections.
-Wparentheses -Wpointer-arith -Wredundant-decls
-Wreturn-type -Wshadow -Wsign-compare -Wswitch
-Wtrigraphs -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code
--Wunused -Wwrite-strings
+-Wunused -Wunused-function -Wunused-label -Wunused-parameter
+-Wunused-variable -Wunused-value -Wwrite-strings
@end smallexample
@item C-only Warning Options
@@ -1538,19 +1539,41 @@ provoke warnings when this option is used.
@item -Wtrigraphs
Warn if any trigraphs are encountered (assuming they are enabled).
-@item -Wunused
-Warn whenever a variable is unused aside from its declaration,
-whenever a function is declared static but never defined, whenever a
-label is declared but not used, and whenever a statement computes a
-result that is explicitly not used.
+@item -Wunused-function
+Warn whenever a static function is declared but not defined or a
+non\-inline static function is unused.
-In order to get a warning about an unused function parameter, you must
-specify both @samp{-W} and @samp{-Wunused}.
+@item -Wunused-label
+Warn whenever a label is declared but not used.
+
+To suppress this warning use the @samp{unused} attribute
+(@pxref{Variable Attributes}).
+
+@item -Wunused-parameter
+Warn whenever a function parameter is unused aside from its declaration.
+
+To suppress this warning use the @samp{unused} attribute
+(@pxref{Variable Attributes}).
-To suppress this warning for an expression, simply cast it to void. For
-unused variables, parameters and labels, use the @samp{unused} attribute
+@item -Wunused-variable
+Warn whenever a local variable or non-constant static variable is unused
+aside from its declaration
+
+To suppress this warning use the @samp{unused} attribute
(@pxref{Variable Attributes}).
+@item -Wunused-value
+Warn whenever a statement computes a result that is explicitly not used.
+
+To suppress this warning cast the expression to @samp{void}.
+
+@item -Wunused
+All all the above @samp{-Wunused} options combined.
+
+In order to get a warning about an unused function parameter, you must
+either specify @samp{-W -Wunused} or separatly specify
+@samp{-Wunused-parameter}.
+
@item -Wuninitialized
Warn if an automatic variable is used without first being initialized or
if a variable may be clobbered by a @code{setjmp} call.
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 2f7aff9..f30afab 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,4 +1,10 @@
-2000-05-09 Zack Weinberg <zack@wolery.cumb.org>
+Wed May 17 17:27:44 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * lang.c (lang_decode_option): Update -Wunused flags by calling
+ set_Wunused.
+ * decl.c (poplevel): Replace warn_unused with warn_unused_label.
+
+2000-04-19 Tom Tromey &lt;tromey@cygnus.com&gt;
* check_init.c (check_init): Constify local char *.
* class.c (push_class): Constify local char *.
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index 5757b2c..a79bb91 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -1387,7 +1387,7 @@ poplevel (keep, reverse, functionbody)
define_label (input_filename, lineno,
DECL_NAME (label));
}
- else if (warn_unused && !TREE_USED (label))
+ else if (warn_unused[UNUSED_LABEL] && !TREE_USED (label))
warning_with_decl (label, "label `%s' defined but not used");
IDENTIFIER_LABEL_VALUE (DECL_NAME (label)) = 0;
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index 4bef553..2a1d142 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -258,7 +258,7 @@ lang_decode_option (argc, argv)
flag_redundant = 1;
/* When -Wall given, enable -Wunused. We do this because the C
compiler does it, and people expect it. */
- warn_unused = 1;
+ set_Wunused (1);
return 1;
}
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 0626e2c..a3b72ea 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -1857,12 +1857,13 @@ expand_expr_stmt (exp)
except inside a ({...}) where they may be useful. */
if (expr_stmts_for_value == 0 && exp != error_mark_node)
{
- if (! TREE_SIDE_EFFECTS (exp) && (extra_warnings || warn_unused)
+ if (! TREE_SIDE_EFFECTS (exp)
+ && (extra_warnings || warn_unused_value)
&& !(TREE_CODE (exp) == CONVERT_EXPR
&& TREE_TYPE (exp) == void_type_node))
warning_with_file_and_line (emit_filename, emit_lineno,
"statement with no effect");
- else if (warn_unused)
+ else if (warn_unused_value)
warn_if_unused_value (exp);
}
@@ -3575,7 +3576,7 @@ warn_about_unused_variables (vars)
{
tree decl;
- if (warn_unused)
+ if (warn_unused_variable)
for (decl = vars; decl; decl = TREE_CHAIN (decl))
if (TREE_CODE (decl) == VAR_DECL
&& ! TREE_USED (decl)
diff --git a/gcc/toplev.c b/gcc/toplev.c
index bcb81f3..470a6ab 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1289,9 +1289,30 @@ int extra_warnings = 0;
int warnings_are_errors = 0;
-/* Nonzero to warn about unused local variables. */
+/* Nonzero to warn about unused variables, functions et.al. */
-int warn_unused;
+int warn_unused_function;
+int warn_unused_label;
+int warn_unused_parameter;
+int warn_unused_variable;
+int warn_unused_value;
+
+void
+set_Wunused (setting)
+ int setting;
+{
+ warn_unused_function = setting;
+ warn_unused_label = setting;
+ /* Unused function parameter warnings are reported when either ``-W
+ -Wunused'' or ``-Wunused-parameter'' is specified. Differentiate
+ -Wunused by setting WARN_UNUSED_PARAMETER to -1 */
+ if (!setting)
+ warn_unused_parameter = 0;
+ else if (!warn_unused_parameter)
+ warn_unused_parameter = -1;
+ warn_unused_variable = setting;
+ warn_unused_value = setting;
+}
/* Nonzero to warn about code which is never reached. */
@@ -1354,7 +1375,11 @@ int warn_padded;
lang_independent_options W_options[] =
{
- {"unused", &warn_unused, 1, "Warn when a variable is unused" },
+ {"unused-function", &warn_unused_function, 1, "Warn when a function is unused" },
+ {"unused-label", &warn_unused_label, 1, "Warn when a label is unused" },
+ {"unused-parameter", &warn_unused_parameter, 1, "Warn when a function parameter is unused" },
+ {"unused-variable", &warn_unused_variable, 1, "Warn when a variable is unused" },
+ {"unused-value", &warn_unused_value, 1, "Warn when an expression value is unused" },
{"error", &warnings_are_errors, 1, ""},
{"shadow", &warn_shadow, 1, "Warn when one local variable shadows another" },
{"switch", &warn_switch, 1,
@@ -1905,7 +1930,7 @@ check_global_declarations (vec, len)
because many programs have static variables
that exist only to get some text into the object file. */
if (TREE_CODE (decl) == FUNCTION_DECL
- && (warn_unused
+ && (warn_unused_function
|| TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
&& DECL_INITIAL (decl) == 0
&& DECL_EXTERNAL (decl)
@@ -1926,9 +1951,10 @@ check_global_declarations (vec, len)
/* Warn about static fns or vars defined but not used,
but not about inline functions or static consts
since defining those in header files is normal practice. */
- if (warn_unused
- && ((TREE_CODE (decl) == FUNCTION_DECL && ! DECL_INLINE (decl))
- || (TREE_CODE (decl) == VAR_DECL && ! TREE_READONLY (decl)))
+ if (((warn_unused_function
+ && TREE_CODE (decl) == FUNCTION_DECL && ! DECL_INLINE (decl))
+ || (warn_unused_variable
+ && TREE_CODE (decl) == VAR_DECL && ! TREE_READONLY (decl)))
&& ! DECL_IN_SYSTEM_HEADER (decl)
&& ! DECL_EXTERNAL (decl)
&& ! TREE_PUBLIC (decl)
@@ -3685,6 +3711,7 @@ display_help ()
W_options[i].string, description);
}
+ printf (" -Wunused Enable unused warnings\n");
printf (" -Wid-clash-<num> Warn if 2 identifiers have the same first <num> chars\n");
printf (" -Wlarger-than-<number> Warn if an object is larger than <number> bytes\n");
printf (" -p Enable function profiling\n");
@@ -3995,6 +4022,14 @@ decode_W_option (arg)
if (larger_than_size != -1)
warn_larger_than = 1;
}
+ else if (!strcmp (arg, "unused"))
+ {
+ set_Wunused (1);
+ }
+ else if (!strcmp (arg, "no-unused"))
+ {
+ set_Wunused (0);
+ }
else
return 0;