linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] sparse: Bump up sizeof(_Bool) to 8 bits
@ 2011-09-26 14:47 Pekka Enberg
  2011-09-26 14:47 ` [PATCH 2/2] sparse, llvm: Add support for logical ops Pekka Enberg
  0 siblings, 1 reply; 2+ messages in thread
From: Pekka Enberg @ 2011-09-26 14:47 UTC (permalink / raw)
  To: linux-sparse; +Cc: Pekka Enberg, Christopher Li, Jeff Garzik, Linus Torvalds

From: Pekka Enberg <penberg@kernel.org>

We need sizeof(_Bool) to be one byte to generate code for boolean expressions
in the LLVM backend.

Cc: Christopher Li <sparse@chrisli.org>
Cc: Jeff Garzik <jgarzik@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
---
 target.c                 |    2 +-
 validation/sizeof-bool.c |    6 +-----
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/target.c b/target.c
index 17b228a..6a535bc 100644
--- a/target.c
+++ b/target.c
@@ -14,7 +14,7 @@ int max_alignment = 16;
 /*
  * Integer data types
  */
-int bits_in_bool = 1;
+int bits_in_bool = 8;
 int bits_in_char = 8;
 int bits_in_short = 16;
 int bits_in_int = 32;
diff --git a/validation/sizeof-bool.c b/validation/sizeof-bool.c
index 6c68748..71ae1bc 100644
--- a/validation/sizeof-bool.c
+++ b/validation/sizeof-bool.c
@@ -4,9 +4,5 @@ static int a(void)
 }
 /*
  * check-name: sizeof(_Bool) is valid
- * check-description: sizeof(_Bool) was rejected because _Bool is not an even
- * number of bytes
- * check-error-start
-sizeof-bool.c:3:16: warning: expression using sizeof bool
- * check-error-end
+ * check-description: sizeof(_Bool) is valid
  */
-- 
1.7.6.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-09-26 14:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-26 14:47 [PATCH 1/2] sparse: Bump up sizeof(_Bool) to 8 bits Pekka Enberg
2011-09-26 14:47 ` [PATCH 2/2] sparse, llvm: Add support for logical ops Pekka Enberg

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).