aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/evaluate.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2014-02-26 19:19:25 -0800
committerChristopher Li <sparse@chrisli.org>2014-02-27 12:39:44 -0800
commit2667c2d4ab3342b54283d16f1d62e6d715f3b373 (patch)
treea5ae6428d932b074f47f41fb734e1a24f163bbb1 /evaluate.c
parent67a7f893b14526002afc0b478a744cfb4acbfebe (diff)
downloadsparse-2667c2d4ab3342b54283d16f1d62e6d715f3b373.tar.gz
sparse: Allow override of sizeof(bool) warning
Allow an override to emit or not the sizeof(bool) warning. Add a "-Wsizeof-bool" description to the manpage. Signed-off-by: Joe Perches <joe@perches.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'evaluate.c')
-rw-r--r--evaluate.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/evaluate.c b/evaluate.c
index 66556150..a45f59ba 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -2057,7 +2057,8 @@ static struct symbol *evaluate_sizeof(struct expression *expr)
}
if (size == 1 && is_bool_type(type)) {
- warning(expr->pos, "expression using sizeof bool");
+ if (Wsizeof_bool)
+ warning(expr->pos, "expression using sizeof bool");
size = bits_in_char;
}