Re: 2.5.8-dj1 : arch/i386/kernel/smpboot.c error

Rick Stevens (rstevens@vitalstream.com)
Wed, 17 Apr 2002 14:17:12 -0700


Adam Kropelin wrote:
> On Wed, Apr 17, 2002 at 01:53:55PM -0700, Martin J. Bligh wrote:
>
>>>of C and the "&&" operator say that "if the first is false, the
>>>second needn't even be evaluated".
>>>
>>That's what I would have thought.
>>But I don't think it's the second part that causes the warning,
>>it's the thing *inside* the if clause.
>>
>
> Exactly.
>
>
>>>Could that be what's causing the warning?
>>>
>>To my mind, that's why we should *not* be getting a warning ?
>>
>
> Indeed. The optimization step that (presumably) removes the body
> of the if() must happen after the body has been fully evaluated.
> Makes sense, I guess, now that I think about it...

Right. If the first condition of a logical AND statement is false,
the remainder need not be evaluated at all. Hence, the entire if
statement can (and perhaps should) be eliminated by the compiler,
since the condition is false.

I didn't see what the actual message from the compiler was, but it
was probably just a warning.
----------------------------------------------------------------------
- Rick Stevens, SSE, VitalStream, Inc. rstevens@vitalstream.com -
- 949-743-2010 (Voice) http://www.vitalstream.com -
- -
- Never put off 'til tommorrow what you can forget altogether! -
----------------------------------------------------------------------

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/