warning when a function's address is tested?

Jeff Sturm jsturm@one-point.com
Sun Oct 12 16:27:00 GMT 2003


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.  That's not an
argument against the warning however... more often than not this is surely
a mistake.

Jeff



More information about the Gcc mailing list