http://qs321.pair.com?node_id=1233009


in reply to I crashed 99 bottles.. the dot was the point (multiconcat)

It looks like an old and well-known (albeit somewhat obscure and tricky) problem in C (and C++): sometimes, you have to introduce sequence point (see for example https://en.wikipedia.org/wiki/Sequence_point and http://www.c-faq.com/expr/seqpoints.html for more details) to make sure that all side-effects from previous evaluations are completed and that no-side effect from subsequent evaluations has been performed. If you don't do that, the behavior is undefined, which means that different C compilers may yield different results and still comply with the C standard; and I have actually observed such discrepancy of behaviors many years ago (some time in the last decade of last century) between two C compilers.

One of the typical ways to introduce a sequence point in such an expression is to add a comma. This is presumably the reason why your version with commas works as expected.

Update: fixed a couple of typos.

  • Comment on Re: I crashed 99 bottles.. the dot was the point (multiconcat)