aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Cerrors.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2017-02-09 15:54:31 +0100
committerBernhard Schommer <bschommer@users.noreply.github.com>2017-02-17 14:09:56 +0100
commit4a8f7dc7e9f3f57f08cca9ca2de19214cbe4dc77 (patch)
treedf6c6de13d537ace13ef299187986d04a8c08971 /cparser/Cerrors.ml
parent201ca60922ede81a0861e76f9399fc400fafb440 (diff)
downloadcompcert-4a8f7dc7e9f3f57f08cca9ca2de19214cbe4dc77.tar.gz
compcert-4a8f7dc7e9f3f57f08cca9ca2de19214cbe4dc77.zip
Extended unused vars check for params.
The test now also checks whether the parameter are used at all in the function body. Bug 19872
Diffstat (limited to 'cparser/Cerrors.ml')
-rw-r--r--cparser/Cerrors.ml6
1 files changed, 5 insertions, 1 deletions
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;