grub-devel
[Top][All Lists]
Advanced

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

Re: __unused


From: Johan Rydberg
Subject: Re: __unused
Date: Sat, 04 Nov 2006 04:44:17 +0100
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

Hollis Blanchard <address@hidden> writes:

>>   int
>>   grub_foo (int x, unused int foo)
>>   {
>>     ...
>>   }
>
> I believe gcc attributes can't be used as naturally as this; it would
> have to be "int unused foo" or "int unused *foo" (from memory).

address@hidden:~/tmp/t5 $ gcc -Dunused= -Wall -Wunused-parameter -O2 -c t1.c
t1.c: In function 'foo':
t1.c:6: warning: unused parameter 'x'
t1.c:6: warning: unused parameter 'baz'
address@hidden:~/tmp/t5 $ gcc -Wall -Wunused-parameter -O2 -c t1.c
t1.c: In function 'foo':
t1.c:6: warning: unused parameter 'x'
address@hidden:~/tmp/t5 $ cat t1.c
#ifndef unused
# define unused __attribute__((unused))
#endif
int
foo (int x, unused int baz)
{
  return 0;
}

~j

Attachment: pgp7BksXHlOTD.pgp
Description: PGP signature


reply via email to

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