From 201ca60922ede81a0861e76f9399fc400fafb440 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Thu, 9 Feb 2017 11:07:06 +0100 Subject: Added a simple check for unused variables. The check test whether the identifier is used at all in the function and if not issue a warning. It is not tested whether the usage is reachable at all, so int i; if (0) i; would not generate a warning. This is the same as gcc/clang does. The warning is disabled per default, but is active if -Wall is given. Bug 19872 --- cparser/Checks.mli | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cparser/Checks.mli') diff --git a/cparser/Checks.mli b/cparser/Checks.mli index 1566d6e4..4d61a5b8 100644 --- a/cparser/Checks.mli +++ b/cparser/Checks.mli @@ -14,3 +14,5 @@ (* *********************************************************************) val unknown_attrs_program: C.program -> unit + +val unused_variables: C.program -> unit -- cgit