This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
warning when a function's address is tested?
- From: Andrew Morton <akpm at osdl dot org>
- To: gcc at gcc dot gnu dot org
- Date: Sun, 12 Oct 2003 05:05:23 -0700
- Subject: warning when a function's address is tested?
We just found a silly bug in the Linux kernel:
- 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?
void foo(void)
{}
void bar(void)
{}
int main()
{
if (foo)
bar();
return 0;
}