[PATCH] fix alignment for _Bool

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

 



_Bool ends up with 0 for alignment, which means that _Bool member in a struct
resets the next field offset to 0.  Should be (at least) 1...

Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
---
 symbol.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/symbol.c b/symbol.c
index 45d40ee..20a04f3 100644
--- a/symbol.c
+++ b/symbol.c
@@ -832,7 +832,7 @@ void init_ctype(void)
 		struct symbol *sym = ctype->ptr;
 		unsigned long bit_size = ctype->bit_size ? *ctype->bit_size : -1;
 		unsigned long maxalign = ctype->maxalign ? *ctype->maxalign : 0;
-		unsigned long alignment = bit_size >> 3;
+		unsigned long alignment = (bit_size + 7) >> 3;
 
 		if (alignment > maxalign)
 			alignment = maxalign;
-- 
1.5.0-rc2.GIT


-
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