This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: warning when a function's address is tested?


Andrew Morton <akpm@osdl.org> writes:

> 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?

Looks like a good idea. The C++ frontend already has this warning, so
it shouldn't be too hard.

-- 
	Falk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]