aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib.c
diff options
authorJohn Levon <levon@movementarian.org>2018-11-29 10:42:51 +0000
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-12-01 02:16:24 +0100
commit648380c13ecaaa95c9dfbd500039cd9007ec3c20 (patch)
tree3e6d634f8549a13d97bdbe0fba39aed97364eb9c /lib.c
parenta0f34e0fd2a44016ef668e19187a342c5f4edf45 (diff)
downloadsparse-dev-648380c13ecaaa95c9dfbd500039cd9007ec3c20.tar.gz
Conditionalize 'warning: non-ANSI function ...'
Sparse unconditionally issues warnings about non-ANSI function declarations & definitions. However, some environments have large amounts of legacy headers that are pre-ANSI, and can't easily be changed. These generate a lot of useless warnings. Fix this by using the options flags -Wstrict-prototypes & -Wold-style-definition to conditionalize these warnings. Signed-off-by: John Levon <levon@movementarian.org> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index 314b65e9..ada12ca7 100644
--- a/lib.c
+++ b/lib.c
@@ -270,6 +270,7 @@ int Wsparse_error = 0;
int Wmemcpy_max_count = 1;
int Wnon_pointer_null = 1;
int Wold_initializer = 1;
+int Wold_style_definition = 1;
int Wone_bit_signed_bitfield = 1;
int Woverride_init = 1;
int Woverride_init_all = 0;
@@ -283,6 +284,7 @@ int Wshadow = 0;
int Wshift_count_negative = 1;
int Wshift_count_overflow = 1;
int Wsizeof_bool = 0;
+int Wstrict_prototypes = 1;
int Wtautological_compare = 0;
int Wtransparent_union = 0;
int Wtypesign = 0;
@@ -707,6 +709,7 @@ static const struct flag warnings[] = {
{ "memcpy-max-count", &Wmemcpy_max_count },
{ "non-pointer-null", &Wnon_pointer_null },
{ "old-initializer", &Wold_initializer },
+ { "old-style-definition", &Wold_style_definition },
{ "one-bit-signed-bitfield", &Wone_bit_signed_bitfield },
{ "override-init", &Woverride_init },
{ "override-init-all", &Woverride_init_all },
@@ -718,6 +721,7 @@ static const struct flag warnings[] = {
{ "shift-count-negative", &Wshift_count_negative },
{ "shift-count-overflow", &Wshift_count_overflow },
{ "sizeof-bool", &Wsizeof_bool },
+ { "strict-prototypes", &Wstrict_prototypes },
{ "pointer-arith", &Wpointer_arith },
{ "sparse-error", &Wsparse_error },
{ "tautological-compare", &Wtautological_compare },