From 4a8f7dc7e9f3f57f08cca9ca2de19214cbe4dc77 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Thu, 9 Feb 2017 15:54:31 +0100 Subject: Extended unused vars check for params. The test now also checks whether the parameter are used at all in the function body. Bug 19872 --- cparser/Cerrors.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cparser/Cerrors.ml') diff --git a/cparser/Cerrors.ml b/cparser/Cerrors.ml index 8b2a4cd5..34fc4fcf 100644 --- a/cparser/Cerrors.ml +++ b/cparser/Cerrors.ml @@ -89,6 +89,7 @@ type warning_type = | CompCert_conformance | Inline_asm_sdump | Unused_variable + | Unused_parameter (* List of active warnings *) let active_warnings: warning_type list ref = ref [ @@ -137,6 +138,7 @@ let string_of_warning = function | CompCert_conformance -> "compcert-conformance" | Inline_asm_sdump -> "inline-asm-sdump" | Unused_variable -> "unused-variable" + | Unused_parameter -> "unused-parameter" (* Activate the given warning *) let activate_warning w () = @@ -181,7 +183,8 @@ let wall () = Unknown_pragmas; CompCert_conformance; Inline_asm_sdump; - Unused_variable + Unused_variable; + Unused_parameter ] let wnothing () = @@ -373,6 +376,7 @@ let warning_options = error_option CompCert_conformance @ error_option Inline_asm_sdump @ error_option Unused_variable @ + error_option Unused_parameter @ [Exact ("-Wfatal-errors"), Set error_fatal; Exact ("-fdiagnostics-color"), Ignore; (* Either output supports it or no color *) Exact ("-fno-diagnostics-color"), Unset color_diagnostics; -- cgit