aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/options.c
diff options
context:
space:
mode:
authorBen Dooks <ben.dooks@codethink.co.uk>2018-10-30 10:36:26 +0000
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-10-05 12:56:10 +0200
commitefc02e9ee225d1327be004181da74f59f2aa2c11 (patch)
tree04803b041d535bde1eecd7aab2be20be38290721 /options.c
parent375690b61e8ec4735b19bcead756ba526edab57e (diff)
downloadsparse-efc02e9ee225d1327be004181da74f59f2aa2c11.tar.gz
evaluate: check variadic argument types against format stringformat-check
The variadic argument code did not check any of the variadic arguments as it did not previously know the possible type. Now we have the possible formatting information stored in the ctype, we can do some checks on the printf formatting types. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'options.c')
-rw-r--r--options.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/options.c b/options.c
index 294dfd3b..ffd11798 100644
--- a/options.c
+++ b/options.c
@@ -100,6 +100,7 @@ int Wdesignated_init = 1;
int Wdo_while = 0;
int Wenum_mismatch = 1;
int Wexternal_function_has_definition = 1;
+int Wformat = 0;
int Wimplicit_int = 1;
int Winit_cstring = 0;
int Wint_to_pointer_cast = 1;
@@ -840,6 +841,7 @@ static const struct flag warnings[] = {
{ "do-while", &Wdo_while },
{ "enum-mismatch", &Wenum_mismatch },
{ "external-function-has-definition", &Wexternal_function_has_definition },
+ { "format", &Wformat },
{ "implicit-int", &Wimplicit_int },
{ "init-cstring", &Winit_cstring },
{ "int-to-pointer-cast", &Wint_to_pointer_cast },