Bah! Doing a pre-incrament produces the same code and a post-incrament in this case.
For example outputting the following two samples produces the same asm code using gcc with the -S parameter
Code:
int main(void)
{
int x=5;
x++;
return 0;
}
And
Code:
int main(void)
{
int x=5;
++x;
return 0;
}
Produces:
Code:
.file "test1.c"
.version "01.01"
gcc2_compiled.:
.text
.align 4
.globl main
.type main,@function
main:
pushl %ebp
movl %esp,%ebp
subl $24,%esp
movl $5,-4(%ebp)
incl -4(%ebp)
xorl %eax,%eax
jmp .L2
.p2align 4,,7
.L2:
leave
ret
.Lfe1:
.size main,.Lfe1-main
.ident "GCC: (GNU) 2.95.4 20011002 (Debian prerelease)"
Ok technically its not the same code since the file name will be different but the code is still the same