[RFC/PATCH 2/2] sparse: Use native sizes for data types

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

 



From: Pekka Enberg <penberg@xxxxxxxxxx>

This patch is needed to fix the sparsec LLVM backend data type sizes.

Cc: Christopher Li <sparse@xxxxxxxxxxx>
Cc: Jeff Garzik <jgarzik@xxxxxxxxxx>
Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx>
---
 target.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/target.c b/target.c
index 6a535bc..009002f 100644
--- a/target.c
+++ b/target.c
@@ -17,9 +17,9 @@ int max_alignment = 16;
 int bits_in_bool = 8;
 int bits_in_char = 8;
 int bits_in_short = 16;
-int bits_in_int = 32;
-int bits_in_long = 32;
-int bits_in_longlong = 64;
+int bits_in_int = sizeof(int) * 8;
+int bits_in_long = sizeof(long) * 8;
+int bits_in_longlong = sizeof(long long) * 8;
 int bits_in_longlonglong = 128;
 
 int max_int_alignment = 4;
@@ -36,8 +36,8 @@ int max_fp_alignment = 8;
 /*
  * Pointer data type
  */
-int bits_in_pointer = 32;
-int pointer_alignment = 4;
+int bits_in_pointer = sizeof(void *) * 8;
+int pointer_alignment = sizeof(void *); 
 
 /*
  * Enum data types
-- 
1.7.6.4

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