All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Andrey Borzenkov <arvidjaar@mail.ru>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Avoiding "unused variable" warnings
Date: Sun, 13 Jul 2003 11:46:43 -0400	[thread overview]
Message-ID: <3F117EE3.5010200@pobox.com> (raw)
In-Reply-To: <200307131932.24015.arvidjaar@mail.ru>

Andrey Borzenkov wrote:
> I think I have seen it somewhere but forgot.
> 
> Is it possible to create a noop macro that makes compiler believe macro 
> arguments are used? I mean the case of debug macro that for debug off is 
> redefined as something like do { } while(0) but then if arguments are used 
> for debugging purposes only compiler emits warning. Some people do not like 
> it :)


No need for a macro, just do

	(void) var_name;

It doesn't generate any code, and it shuts up the compiler.

	Jeff




  reply	other threads:[~2003-07-13 15:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-13 15:32 Avoiding "unused variable" warnings Andrey Borzenkov
2003-07-13 15:46 ` Jeff Garzik [this message]
2003-07-13 16:22   ` Alan Cox
2003-07-13 16:45     ` Roman Zippel

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=3F117EE3.5010200@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=arvidjaar@mail.ru \
    --cc=linux-kernel@vger.kernel.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.