This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Warn about bogus conditional operators
Andi Kleen <andi@firstfloor.org> writes:
> On Sat, Jan 17, 2009 at 10:16:43AM +0100, Andreas Schwab wrote:
>> Andi Kleen <andi@firstfloor.org> writes:
>>
>> > +?: with omitted middle operand GNU extension. When the condition
>> > +in the ?: operator is a computed boolean the omitted value will
>>
>> What is the difference between a boolean and a computed boolean?
>
> On the computed one you assign the value to something:
>
> var = a > b
>
> on a ordinary one you just jump (or decide for ?:)
>
> if (a > b) { ... }
>
> e.g. the bug I had was
>
> x != NULL ?: otherval
Did you just explain that is not a "computed boolean"? I cannot see any
difference between the two cases anyway.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."