Output difference in gcc and turbo C

前端 未结 7 520
野趣味
野趣味 2020-12-15 22:46

Why is there a difference in the output produced when the code is compiled using the two compilers gcc and turbo c.

#include 

        
7条回答
  •  旧巷少年郎
    2020-12-15 23:40

    Please forget the answers in the same line as

    "It's because Turbo C is SO TOTALLY OLD and they couldn't do it THEN, because it had to be FAST, but the GCC is totally NEW and RAD and that's why it does that!".

    Both compiler support merging string constants as an option. The GCC option (-fmerge-constants) is turned on at optimization levels, while the Turbo C Option (-d) is turned off on default. If you are using the TCC IDE, then go to Options|Compiler...|Code Generation.. and check "Duplicate strings merged".

提交回复
热议问题