Re: GCC 3.4 Heads-up

From: Krzysztof Halasa
Date: Sat Jan 03 2004 - 17:36:38 EST


Bill Davidsen <davidsen@xxxxxxx> writes:

> I would probably write
> ( a ? b : c ) = d;
> instead, having learned C when some compilers parsed ? wrong without
> parens. Actually I can't imagine writing that at all, but at least
> with parens humans can read it easily. Ugly code.
>
> Your suggestion is not portable, if b or c are declared "register"
> there are compilers which will not allow taking the address, and gcc
> will give you a warning.

One can write as well:

if (a)
b = d;
else
c = d;

Might be more readable and it is what the compiler does.
--
Krzysztof Halasa, B*FH
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/