宏替换占不占用编译时间?

skypt12 2014-12-17 11:25:04
我的理解:
宏替换是在预编译阶段就进行了,那么按道理说应该不占用编译时间咯?
为什么很多人说是占用编译时间的?还是我理解错了?求解释?
...全文
1853 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复 1
it depends on the definition on compilation. The work of a typical C compiler can be divided into several phases: 1. Preprocessing: replacing macro, including all header files, usually done by cpp in Linux world. The output will be a single input file; 2. Scanning and Parsing: take care syntax and semantic 3. Intermediate Code Generation: create RTL (register transfer language) 4. Optimization: optimizing RTL 5. Code Generation: generating assembly code for the target processor. The output will be a human readable text file with assembly in it...
buyong 2014-12-18
  • 打赏
  • 举报
回复
如果预处理不算编译,就不占用。
杨六 2014-12-18
  • 打赏
  • 举报
回复
对的,这只是考虑的角度不同;一般来说编译就是指从源文件至二进制文件的这个过程吧,那自然就包含了预处理的过程; 但若需要区分预编译与编译的自然也就不包含了。个人理解。
zhxianbin 2014-12-17
  • 打赏
  • 举报
回复
各人理解不同吧,通常所说的编译当然指的是从预处理到链接的完整过程了
hjhggj 2014-12-17
  • 打赏
  • 举报
回复
就是i这样的啊。。。。

23,223

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧