B
Ben Bacarisse
Seebs said:I am sort of curious, now. I know that gcc is smart enough to optimize:
printf("%s\n", foo);
to:
puts(foo);
But let's say you have a slightly longer example:
printf("%s", "hello\n");
Will any compilers optimize this to
puts("hello");
?
Yes, gcc 4.8.1 does, even with -O0 (just an example, other versions may
also do so).