All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Rydberg <jrydberg@night.trouble.net>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: __unused
Date: Sat, 04 Nov 2006 04:44:17 +0100	[thread overview]
Message-ID: <87velvx4dq.fsf@night.trouble.net> (raw)
In-Reply-To: <1162586752.14609.17.camel@basalt.austin.ibm.com> (Hollis Blanchard's message of "Fri, 03 Nov 2006 14:45:52 -0600")

[-- Attachment #1: Type: text/plain, Size: 722 bytes --]

Hollis Blanchard <hollis@penguinppc.org> 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).

jrydberg@fauna:~/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'
jrydberg@fauna:~/tmp/t5 $ gcc -Wall -Wunused-parameter -O2 -c t1.c
t1.c: In function 'foo':
t1.c:6: warning: unused parameter 'x'
jrydberg@fauna:~/tmp/t5 $ cat t1.c
#ifndef unused
# define unused __attribute__((unused))
#endif
int
foo (int x, unused int baz)
{
  return 0;
}

~j

[-- Attachment #2: Type: application/pgp-signature, Size: 190 bytes --]

  reply	other threads:[~2006-11-04  3:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-01  1:23 [PATCH] generic ELF loading #3 Hollis Blanchard
2006-11-01 12:48 ` Johan Rydberg
2006-11-03 20:45   ` __unused Hollis Blanchard
2006-11-04  3:44     ` Johan Rydberg [this message]
2006-11-08 23:10     ` __unused Jeroen Dekkers
2006-11-09 15:31       ` __unused Johan Rydberg
2006-11-09 19:42         ` __unused Jeroen Dekkers
2006-11-02 19:58 ` [PATCH] generic ELF loading #3 Yoshinori K. Okuji
2006-11-02 20:54   ` Hollis Blanchard
2006-11-02 21:23     ` Hollis Blanchard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87velvx4dq.fsf@night.trouble.net \
    --to=jrydberg@night.trouble.net \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.