I had been struggling for weeks with a poor-performing translator I had written. On the following simple bechmark
#include int main() { i
Using -std=c99 disable all GNU extensions.
-std=c99
With GNU extensions and optimization, your fprintf(test, "B") is probably replaced by a fputc('B', test)
fprintf(test, "B")
fputc('B', test)
Note this answer is obsolete, see https://stackoverflow.com/a/13973562/611560 and https://stackoverflow.com/a/13973933/611560