grub-devel
[Top][All Lists]
Advanced

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

Re: __unused


From: Jeroen Dekkers
Subject: Re: __unused
Date: Thu, 09 Nov 2006 00:10:33 +0100
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/22.0.90 (x86_64-pc-linux-gnu) MULE/5.0 (SAKAKI)

At Fri, 03 Nov 2006 14:45:52 -0600,
Hollis Blanchard wrote:
> 
> On Wed, 2006-11-01 at 13:48 +0100, Johan Rydberg wrote:
> > Hollis Blanchard <address@hidden> writes:
> > 
> > > --- grub2-cvs.orig/include/grub/types.h   2006-10-31 19:06:47.000000000 
> > > -0600
> > > +++ grub2-cvs/include/grub/types.h        2006-10-31 19:06:58.000000000 
> > > -0600
> > > @@ -23,6 +23,8 @@
> > >  #include <config.h>
> > >  #include <grub/cpu/types.h>
> > >  
> > > +#define __unused __attribute__ ((unused))
> > > +
> > 
> > First when I saw this it made me wanna comment on it, and tell you
> > that defines should all be in uppercase.  But then I poked through the
> > code, and saw the usage of it, and it looked quite nice, with the
> > exception of the __-prefix.  There are a lot of "common" words that
> > are keywords in C; inline, const and auto for example.  Maybe we
> > should make "unused" a reserved keyword in GRUB?  That would allow
> > us to write code like;
> 
> I left it as "__unused" for now, to match Linux's usage. (We can change
> it later if needed.)

We need another name, the __unused name is used in stat.h for an
unused member in struct stat. Grub-setup gives the following compiler
error:

gcc -Iutil/i386/pc -I/home/jeroen/cvs/grub2/util/i386/pc -I. -Iinclude 
-I/home/jeroen/cvs/grub2/include -Wall -W 
-DGRUB_LIBDIR=\"/usr/local/lib/grub/i386-pc\" -g -O2 -DGRUB_UTIL=1  -MD -c -o 
grub_setup-util_i386_pc_grub_setup.o 
/home/jeroen/cvs/grub2/util/i386/pc/grub-setup.c
In file included from /usr/include/sys/stat.h:105,
                 from /home/jeroen/cvs/grub2/util/i386/pc/grub-setup.c:43:
/usr/include/bits/stat.h:103: error: expected identifier or ‘(’ before ‘[’ token
/usr/include/bits/stat.h:164: error: expected identifier or ‘(’ before ‘[’ token
make: *** [grub_setup-util_i386_pc_grub_setup.o] Error 1

Any ideas for a new name for the define? Something like "grub_unused"?

Jeroen Dekkers




reply via email to

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