[Top][All Lists]

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

Re: [PATCH] allow -Werror on IA-64 with GPT enabled

From: Andrew Clausen
Subject: Re: [PATCH] allow -Werror on IA-64 with GPT enabled
Date: Sat, 6 Oct 2001 11:38:37 +1000
User-agent: Mutt/1.2.5i

On Fri, Oct 05, 2001 at 08:09:12PM -0500, address@hidden wrote:
> > Shouldn't we be checking for something like #if sizeof(int) 
> > == 8 instead?
> sizeof(long), but that didn't work for me.  gcc errored out on such a
> consruct.

In #ifdef's?  You can still autoconfuse it...

> The simple:
>       touch foo.c
>       gcc -dM -E foo.c
> spits out all the #defines set by gcc for you.  __LP64__ is the best of
> those.   BITS_PER_LONG is what I'd use in the kernel, but it isn't set from
> user space.  __LP64__ accurately describes what we're looking for.  If longs
> are 64 bits, print with %lx.  Otherwise, print with %llx.  Works fine until
> we get to >64 bit computing, which will be necessary within our lifetime.
> :-)

sizeof(long) isn't interesting.  The idea is: if int's are too small, then
use longs (and assume they are big enough).  If you type-cast to the bigger
size, then it should do automatic type conversion, right?

In fact, can't you just typecast everything to long long, and not worry about
#ifdef's at all?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]