diff mbox series

remove redundant check of _Bool bitsize

Message ID 20181220225208.27574-1-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series remove redundant check of _Bool bitsize | expand

Commit Message

Luc Van Oostenryck Dec. 20, 2018, 10:52 p.m. UTC
To test if a type is a variant of _Bool it is useless
to test is_bool_type(x) *and* test if 'x->bit_size == 1'
since the first implies the second.

So, remove the test of the bitsize.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 evaluate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/evaluate.c b/evaluate.c
index 4c8c002ee..8841a6e48 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -2207,7 +2207,7 @@  static struct symbol *evaluate_sizeof(struct expression *expr)
 		size = bits_in_char;
 	}
 
-	if (size == 1 && is_bool_type(type)) {
+	if (is_bool_type(type)) {
 		if (Wsizeof_bool)
 			warning(expr->pos, "expression using sizeof _Bool");
 		size = bits_in_char;