From: Rusty Russell <rusty@rustcorp.com.au>
To: Adrian Bunk <bunk@fs.tum.de>
Cc: torvalds@transmeta.com, akpm@zip.com.au,
linux-kernel@vger.kernel.org,
Kai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
Subject: Re: [PATCH] Make gcc3.3 Eliminate Unused Static Functions
Date: Fri, 20 Jun 2003 12:28:36 +1000 [thread overview]
Message-ID: <20030620030225.8EC742C053@lists.samba.org> (raw)
In-Reply-To: Your message of "Thu, 19 Jun 2003 14:17:33 +0200." <20030619121732.GQ29247@fs.tum.de>
In message <20030619121732.GQ29247@fs.tum.de> you write:
> On Fri, Jun 13, 2003 at 11:03:43AM +1000, Rusty Russell wrote:
> > Argh, bogus line pasted into Makefile turned up in patch.
> >
> > This should be better...
> >...
> > +# Needs gcc 3.3 or above to understand max-inline-insns-auto.
> > +INLINE_OPTS := $(shell $(CC) -o /non/existent/file -c --param max-i
nline-insns-auto=0 -xc /dev/null 2>&1 | grep /non/existent/file >/dev/null && e
cho -finline-functions --param max-inline-insns-auto=0)
> >...
>
> You have to add a -Wno-unused-function or you'll get a warning for every
> eliminated function.
No, suppressing warnings like that would be bad. Instead, you write
functions like this:
#ifdef CONFIG_FOO
extern int register_foo(foo_fn myfunction);
#else
static inline int register_foo(foo_fn myfunction)
{
return 0;
}
#endif /* CONFIG_FOO */
That way, there's no unused warning, but gcc knows enough to discard
the function.
Hope that clarifies!
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
next prev parent reply other threads:[~2003-06-20 2:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-13 1:03 [PATCH] Make gcc3.3 Eliminate Unused Static Functions Rusty Russell
2003-06-19 12:17 ` Adrian Bunk
2003-06-20 2:28 ` Rusty Russell [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-06-13 0:17 Rusty Russell
2003-06-13 3:01 ` Bernd Eckenfels
2003-06-13 14:04 ` Chris Friesen
2003-06-13 16:03 ` Tom Rini
2003-06-13 18:07 ` Robert Love
2003-06-13 18:15 ` Tom Rini
2003-06-13 18:41 ` Robert Love
2003-06-19 12:10 ` Adrian Bunk
2003-06-19 13:28 ` Jörn Engel
2003-06-19 13:57 ` Bob Tracy
2003-06-19 14:32 ` Chris Meadors
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=20030620030225.8EC742C053@lists.samba.org \
--to=rusty@rustcorp.com.au \
--cc=akpm@zip.com.au \
--cc=bunk@fs.tum.de \
--cc=kai@tp1.ruhr-uni-bochum.de \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.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