public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@codesourcery.com>
To: Sterling Augustine <saugustine@google.com>
Cc: Andreas Schwab <schwab@linux-m68k.org>,
	Tom Tromey <tromey@redhat.com>,
	Sergio Durigan Junior <sergiodj@redhat.com>,
	Jan Kratochvil	<jan.kratochvil@redhat.com>, <gdb@sourceware.org>
Subject: Re: Switch -Wunused-variable on?
Date: Wed, 25 Apr 2012 18:52:00 -0000	[thread overview]
Message-ID: <alpine.DEB.1.10.1204251926570.19835@tp.orcam.me.uk> (raw)
In-Reply-To: <CAEG7qUwmRw5iANBoFFb2xWX1T+WVFOKt8zeKf2zmi9xG7FSz_g@mail.gmail.com>

On Wed, 25 Apr 2012, Sterling Augustine wrote:

> >>  Then you don't actually need a definition, because the call will be
> >> optimised away
> >
> > You still need to support unoptimized builds.
> 
> GCC eliminates the unreachable block of an "if (0)" even without
> optimization. Many other compilers don't. It is an ongoing source of
> complications for getting compilers other than GCC to build the linux
> kernel which uses this approach extensively.

 That sounds silly, I didn't know that.  In this case a "static inline" 
dummy function would have to be provided indeed that makes the solution a 
bit less elegant then I would like it to be.  Still probably better than a 
maze of #ifdefs scattered throughout code, but YMMV.

  Maciej

      reply	other threads:[~2012-04-25 18:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-22  8:06 Sergio Durigan Junior
2012-04-22  8:23 ` Jan Kratochvil
2012-04-22 20:25   ` Sergio Durigan Junior
2012-04-22 22:25     ` Jeffrey Walton
2012-04-23  8:55       ` Jan Kratochvil
2012-04-23 14:30     ` Tom Tromey
2012-04-23 15:49       ` Sergio Durigan Junior
2012-04-23 18:02         ` Pedro Alves
2012-04-23 18:39           ` Michael Eager
2012-04-24 22:11       ` Maciej W. Rozycki
2012-04-25  7:51         ` Andreas Schwab
2012-04-25 15:57           ` Maciej W. Rozycki
2012-04-25 16:50             ` Andreas Schwab
2012-04-25 17:22               ` Maciej W. Rozycki
2012-04-25 18:13                 ` Andreas Schwab
2012-04-25 18:20                   ` Sterling Augustine
2012-04-25 18:52                     ` Maciej W. Rozycki [this message]

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=alpine.DEB.1.10.1204251926570.19835@tp.orcam.me.uk \
    --to=macro@codesourcery.com \
    --cc=gdb@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=saugustine@google.com \
    --cc=schwab@linux-m68k.org \
    --cc=sergiodj@redhat.com \
    --cc=tromey@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).