Messages in this thread | | | Date | Thu, 25 Dec 2003 23:08:32 -0800 (PST) | From | Linus Torvalds <> | Subject | Re: GCC 3.4 Heads-up |
| |
On Fri, 26 Dec 2003, Andy Isaacson wrote: > > But doesn't the first one potentially let the compiler avoid spilling to > memory, if b and c are both in registers?
Sure, and you can do it as
tmp = d; a ? b = tmp : c = tmp;
instead if you want to. It all depends on what b/c actually are (ie maybe they are memory-backed anyway).
The point being that there are no actual _advantages_ to being non-standard. And there are definitely disadvantages. Lack of portability being one, semantic confusion being another (the semantic confusion is more visible in C++, since there lvalue'ness is more complex. But it's visible in C too, where the gcc extensions can cause buggy programs that _should_ give syntax errors to possibly compile to unexpected results).
Linus - 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/
| |