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: RFC: Walways-true considered harmful


On 13 January 2007 12:55, Rask Ingemann Lambertsen wrote:

> 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 (...);
>     ...
>   }
> 

  And equally bad to warn about

> if (func)
>   {
>     ...
      func (...);
>     ...
>   }


  Did you mean to limit it specifically to struct members?



    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


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