On Tue, 29 Jul 2008, Linus Torvalds wrote:In fact, that does seem what gcc-4.x does. The way to tell is to do const int *x; ({ *x }) = 1; and it's (a) legal (assignments to non-lvalues wouldn't work) and (b) gives a nice warning about assignment to read-only location, which in turn implies that the compiler properly just peeled off the de-reference even though it was inside the statement expression. IOW, at least in gcc-4.3 (and apparently in earlier gcc-4 versions, but not in gcc-3.4.5), a statement expression with an lvalue return value _is_ actually an lvalue. But that also means that there is no difference what-so-ever between (x) and ({ x; }) in gcc-4. And in gcc-3 there is, because apparently in gcc-3 a statement expression is never an lvalue (which is actually the sane thing, imho). Linus --
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
| Linus Torvalds | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Eric Paris | [RFC 0/5] [TALPA] Intro to a linux interface for on access scanning |
| Ingo Molnar | Re: [patch 00/13] Syslets, "Threadlets", generic AIO support, v3 |
git: | |
| Gerrit Renker | [PATCH 18/37] dccp: Support for Mandatory options |
| David Miller | [GIT]: Networking |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Andrew Morton | Re: [BUG] New Kernel Bugs |
