[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1232723900.3504.4.camel@localhost.localdomain>
Date: Fri, 23 Jan 2009 20:48:20 +0530
From: Jaswinder Singh Rajput <jaswinder@...nel.org>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: David Miller <davem@...emloft.net>, mingo@...e.hu, x86@...nel.org,
linux-kernel@...r.kernel.org, Sam Ravnborg <sam@...nborg.org>,
Arnd Bergmann <arnd@...db.de>
Subject: Re: Confusion in usr/include/asm-generic/fcntl.h
On Tue, 2009-01-20 at 16:48 -0800, H. Peter Anvin wrote:
> David Miller wrote:
> > From: Jaswinder Singh Rajput <jaswinder@...nel.org>
> > Date: Wed, 21 Jan 2009 05:34:17 +0530
> >
> >> usr/include/asm-generic/fcntl.h is giving 2 'make headers_check' warnings:
> >> usr/include/asm-generic/fcntl.h:127: leaks CONFIG_64BIT to userspace where it is not valid
> >> usr/include/asm-generic/fcntl.h:149: leaks CONFIG_64BIT to userspace where it is not valid
> >>
> >> usr/include/asm-generic/fcntl.h:
> > ...
> >> #ifndef CONFIG_64BIT will always be true for userspace. So what is the use of #ifndef CONFIG_64BIT ?
> >
> > Good catch.
> >
> > This file needs to test for 64-bit'ness using some non-CONFIG_*
> > test. And the standard built-in CPP macros which can be used
> > to check for that are different on every platform.
> >
>
> There are a few ways to check for 64-bitness that are
> platform-independent, unfortunately each of them have drawbacks.
>
So who wins the race for CONFIG_64BIT and will be right candidate for
usr/include/asm-generic/fcntl.h:
1. #if BITS_PER_LONG == 64
OR
2. #if __BITS_PER_LONG == 64
OR
3. #ifdef __LP64__
OR
4. #if __SIZEOF_POINTER__ == 8
OR
5. #if LONG_MAX > 2147483647L
OR
6. #ifdef __64BIT
Thanks
--
JSR
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists