bug-parted
[Top][All Lists]
Advanced

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

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


From: Matt Wilson
Subject: Re: [PATCH] allow -Werror on IA-64 with GPT enabled
Date: Thu, 11 Oct 2001 12:58:27 -0400
User-agent: Mutt/1.2.5i

This won't work on, say, alpha.

The correct way to do this (per C99):

#include <inttypes.h>

printf("%" PRIi64 "\n", llvalue);

Cheers,

Matt

On Fri, Oct 05, 2001 at 08:09:12PM -0500, address@hidden wrote:
> > What does #ifdef __LP64__ mean?  (my rather old gcc and libc 
> > info pages
> > don't mention it)  From looking on gcc archives, it means "32 bit int,
> > 64 bit longs and pointers")
> 
> Yes, exactly.
> 
> > 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.
> 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.
> :-)
> 
> Thanks,
> Matt
> 
> -- 
> Matt Domsch
> Sr. Software Engineer
> Dell Linux Solutions
> www.dell.com/linux
> #2 Linux Server provider with 17% in the US and 14% Worldwide (IDC)!
> #3 Unix provider with 18% in the US (Dataquest)!
> 
> _______________________________________________
> Bug-parted mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-parted



reply via email to

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