<<< Date Index >>>     <<< Thread Index >>>

Re: Little code cleanup



On 2008-03-03 10:36:39 +0000, Paul Walker wrote:
> On Mon, Mar 03, 2008 at 10:45:39AM +0100, Thomas Roessler wrote:
> > From a quick look, the warnings are actually mistaken, and the patch
> > shouldn't be applied.
> 
> I've checked, and I have to agree with gcc - the warnings are genuine.
> Both variables are allocated on the stack, and can't be NULL.

That's not a reason to give a warning. This is a bit similar to

  if (1)
    { ... }

where the condition is always true, and which doesn't trigger any
warning.

> Not only that, but they're used and dereference multiple times before we
> reach the address checks, so if they are NULL then we've already crashed
> many times over. ;-)

This one is a good point.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)