This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: Walways-true considered harmful
- From: Rask Ingemann Lambertsen <rask at sygehus dot dk>
- To: Manuel López-Ibáñez <lopezibanez at gmail dot com>
- Cc: gcc <gcc at gcc dot gnu dot org>
- Date: Sat, 13 Jan 2007 13:55:04 +0100
- Subject: Re: RFC: Walways-true considered harmful
- References: <6c33472e0701122008r641dc8ffne2b0e98ca22b978a@mail.gmail.com>
On Sat, Jan 13, 2007 at 04:08:18AM +0000, Manuel López-Ibáñez wrote:
> Much later, the warning was given a name, Walways-true [3], since the
> warning message said explicitly that something will always be true.
> However, Andrew Morton didn't want to get a warning just because the
> expression was always true. He wanted to be warned of using the
> address of a function where it makes more sense to call the function.
Also, while it will be good to warn about
if (func)
{
...
}
it'll be bad to warn about
if (timerstruct->callbackfunc)
{
...
timerstruct->callbackfunc (...);
...
}
so be careful when implementing such warnings.
--
Rask Ingemann Lambertsen