This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: optimisation question


Remy X.O. Martin wrote:

I think, though, that the construct a=b=c exists by the very nature that it *could* be more efficient than the split-up version. It is not particularly more readable, for instance.

Not at all. It is a useful language construct, consider


*a++ = *b++ = *c++

as an example where the vaiables are not simple, and this is much
clearer than having to figure out what to do in two separate
assignments.

Even a=b=c in general seems nicer than a=c; b=c; just from a readability
point of view.

Finally, this is not some special "multiple assignment" construct.
Assignment is allowed anywhere in any expression, and this is just
one special case of using this much more general and useful rule.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]