pointers - Wrong common expression substitution in C compiler? -
double *p;
apparently, gcc 4.6.3 increments p
1 in following line under -o3
.
myfunc (*(p++), *(p++));
is bug?
*(p++)
doesn't increment value pointer points to.
if want value incremented (*p)++
;
another thing is, aren't guaranteed order in parameters evaluated. depends on compiler. left side incremented first, incremented second. regardless 1 parameter sent in original value , next original value + 1 (due nature of post increment); outside function, if didn't modify *p inside it, *p should have been incremented twice.
Comments
Post a Comment