Re: sparse segfaults

Nikita Danilov
2004-11-21T22:29:48Z

linux-os <linux-os@chaos.analogic.com> writes:

> On Sat, 20 Nov 2004, Russell King wrote:
>

[...]

>>
>> int tickadj = 500/HZ ? : 1; /* microsecs */
>>
>> which makes it look like sparse doesn't understand such constructions.
>
> I don't think any 'C' compiler should understand such constructions
> either.
> There is no result for the TRUE condition, and the standard
> does not provide for a default. The compiler should have written
> a diagnostic.

This is GCC extension.

foo ? : bar

is equivalent to

foo ? foo : bar

except that foo is evaluated only once.

Nikita.