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" <vsxo@hotmail.com> writes:

> 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.

No, it exists because in C "a = b" is an expression, not a statement.
For example, you can do
    if (a = b) ...
or, more commonly,
    for (a = b; ...

Since "a = b" is an expression, it follows that it is possible to do
"c = a = b", just as you can do "c = <any expression>".

Ian


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