Closed jonm closed 8 years ago
Interesting. Good find. I do not understand why this is necessary as my understanding is that the ,
should be a sequence point. But whatever, thanks for finding it.
¯(ツ)/¯
For completeness: a comma in an arg list is not a sequence point, so the behavior I introduced was (as observed) undefined.
It turns out that not the right thing was going on here. The intent was that the initial call to
generate_indices
would populatetop_of_mobt
ortop_of_objt
, which would then be passed as the second argument to eithermake_mob_indices
ormake_obj_indices
. This works locally for me on Mac OS X with the Apple LLVM-basedgcc
.However, when running on the prod Linux machine when compiled with
gcc
4.8.3, the order of operations doesn't come out right. In this case, the original value fortop_of_mobt
ortop_of_objt
gets passed in:0
, and hence the new indices don't get created correctly.By un-lining the call to
generate_indices
we can make sure it is unambiguous what order we want these to happen in.