* [PATCH] fix alignment for _Bool
@ 2007-05-25 3:57 Al Viro
0 siblings, 0 replies; only message in thread
From: Al Viro @ 2007-05-25 3:57 UTC (permalink / raw)
To: linux-sparse
_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@zeniv.linux.org.uk>
---
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2007-05-25 3:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-25 3:57 [PATCH] fix alignment for _Bool Al Viro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).