I had proposed a kernel patch to TASK_SIZE on x86_64 to eliminate 3,214 (!) sparse warnings in 2.6.11-rc2, but Andi thinks this is a sparse (data type) bug. Comments?
sparse warning:
include/linux/sched.h:1150:18: warning: constant 0x800000000000 is so big it is long
patch:
diff -Naurp ./include/asm-x86_64/processor.h~proc_task_size ./include/asm-x86_64/processor.h
--- ./include/asm-x86_64/processor.h~proc_task_size 2005-01-22 19:06:33.765150024 -0800
+++ ./include/asm-x86_64/processor.h 2005-01-22 21:40:48.884158072 -0800
@@ -162,7 +162,7 @@ static inline void clear_in_cr4 (unsigne
/*
* User space process size. 47bits.
*/
-#define TASK_SIZE (0x800000000000)
+#define TASK_SIZE (0x800000000000UL)
-------- Original Message -------- Subject: Re: [PATCH] x86_64: use UL on TASK_SIZE Date: Sun, 23 Jan 2005 11:59:03 +0100 From: Andi Kleen <[EMAIL PROTECTED]> To: Randy.Dunlap <[EMAIL PROTECTED]> CC: lkml <[email protected]>, akpm <[EMAIL PROTECTED]>, [EMAIL PROTECTED] References: <[EMAIL PROTECTED]>
On Sat, Jan 22, 2005 at 10:56:17PM -0800, Randy.Dunlap wrote:
Use UL on large constant (kills 3214 sparse warnings :)
include/linux/sched.h:1150:18: warning: constant 0x800000000000 is so big it is long
Sounds more like a sparse bug to me. The C99 standard says the type of the constant is the first in which the constant can be represented. And that list includes unsigned long and even unsigned long long.
-Andi - To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
