Comment on Write a program that makes 2 + 2 = 5parentComments−mgraczyk12yOr rather, a and b will be constant folded so that the printf call is optimized to "push #4; push ptrFmt; call printf"−Someone12yA truly good compiler would replace that printf by a call to putchar or pass a constant string to 'write' (gcc almost (?) does that. See http://www.ciselant.de/projects/gcc_printf/gcc_printf.html)
Comments
Or rather, a and b will be constant folded so that the printf call is optimized to "push #4; push ptrFmt; call printf"
A truly good compiler would replace that printf by a call to putchar or pass a constant string to 'write' (gcc almost (?) does that. See http://www.ciselant.de/projects/gcc_printf/gcc_printf.html)