[PATCH 06/17] big-shift: use the base type for shift-too-big warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Without this, instead of having a warning message like
'shift to big for int', we can have a message like:
'shift to big for int [addressable] x' once we also
check shift expression where only the amount is a constant.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 expand.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/expand.c b/expand.c
index 449dac05b..3009cbb03 100644
--- a/expand.c
+++ b/expand.c
@@ -162,6 +162,8 @@ static void check_shift_count(struct expression *expr, struct symbol *ctype, uns
 {
 	if (count < ctype->bit_size)
 		return;
+	if (ctype->type == SYM_NODE)
+		ctype = ctype->ctype.base_type;
 	warning(expr->pos, "shift too big (%u) for type %s", count, show_typename(ctype));
 }
 
-- 
2.18.0

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux