This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: warning when a function's address is tested?
- From: Falk Hueffner <falk dot hueffner at student dot uni-tuebingen dot de>
- To: Jeff Sturm <jsturm at one-point dot com>
- Cc: Andrew Morton <akpm at osdl dot org>, gcc at gcc dot gnu dot org
- Date: 12 Oct 2003 18:07:53 +0200
- Subject: Re: warning when a function's address is tested?
- References: <Pine.LNX.4.44.0310121156060.17784-100000@ops2.one-point.com>
Jeff Sturm <jsturm@one-point.com> writes:
> On Sun, 12 Oct 2003, Andrew Morton wrote:
> > - if (current_is_kswapd)
> > + if (current_is_kswapd())
> >
> > It was there for a year. It is a fairly easy mistake to make, and it would
> > be nice if the compiler could generate a warning. I don't think there are
> > likely to be legitimate uses?
>
> One legitimate use is to test for undefined weak symbols.
But gcc knows that from __attribute__((weak)) and can suppress the
warning in this case (like the C++ frontend does).
--
Falk