[Top][All Lists]

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

Re: [PATCH 1/7]: Fix sparc64 setjmp implementation.

From: Javier Martín
Subject: Re: [PATCH 1/7]: Fix sparc64 setjmp implementation.
Date: Wed, 04 Mar 2009 16:58:22 +0100

El mié, 04-03-2009 a las 03:36 -0800, David Miller escribió:
> From: Vesa Jääskeläinen <address@hidden>
> Date: Wed, 04 Mar 2009 13:34:46 +0200
> > David Miller wrote:
> > > diff --git a/include/grub/sparc64/setjmp.h b/include/grub/sparc64/setjmp.h
> > > index 12d8e01..183a820 100644
> > > --- a/include/grub/sparc64/setjmp.h
> > > +++ b/include/grub/sparc64/setjmp.h
> > > @@ -19,8 +19,7 @@
> > >  #define GRUB_SETJMP_CPU_HEADER   1
> > >  
> > > -/* FIXME (sparc64).  */
> > > -typedef unsigned long grub_jmp_buf[20];
> > > +typedef unsigned long grub_jmp_buf[3];
> > 
> > I assume unsigned long is 64bit in sparc?
> Yes, for sparc64 long is always 64-bit, no exceptions.
> > Would it be more practical to use grub_uint64_t?
> This is a "sparc64" file, so I don't think so.
Next month, or maybe next year, someone will need to fix some bug on
sparc64 code without being sparc64-savvy, maybe because (like it's
already happened) there are no sparc people available. That day people
like Bean, Felix, Marco or Robert (to name just a few of the big gurus
here) may have to decide between editing a sparc64 file or give up on
maintaining the platform. That day it would be really good for them to
visually know that "unsigned long" is 64-bit in sparc, instead of having
to go see the docs. This is the real utility of typedefs (and the
[u]intNN_t types from C99): if you statically _know_ that some variable
is going to be 64 bits long because the _platform_ requires it, why not
make it explicit? It will be easier for readers and maintainers.

As an example of what this entails, the failure to think with the future
in mind has extraordinarily hampered the 32->64 bit transition: many
Windows apps (among them the Vorbis codecs!) had be nearly rewritten
because they used "unsigned long" interchangeably with pointer types. I
still wonder if it would have been so difficult to use "void*", and the
proper types for pointer arithmetic.

-- Lazy, Oblivious, Rational Disaster -- Habbit

Attachment: signature.asc
Description: Esta parte del mensaje está firmada digitalmente

reply via email to

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