简体   繁体   English

IAR C 编译器切换:快速查询

[英]IAR C compiler switch : Quick query

I am using IAR compiler, and have some Compile switches in the code.我正在使用 IAR 编译器,并且在代码中有一些 Compile 开关。

When I switch between 2 different #defines does the other code which was not selected still be present in the final Hex file generated?当我在 2 个不同的 #defines 之间切换时,未选择的其他代码是否仍然存在于生成的最终 Hex 文件中?

The preprocessor just does dumb cut'n'paste and it runs before the compiler.预处理器只是做愚蠢的剪切和粘贴,它在编译器之前运行。 Any code (text, really) that it excludes will not be part of the source the compiler sees, so obviously it won't make it into the final object file/library/executable either.它排除的任何代码(实际上是文本)都不会成为编译器看到的源代码的一部分,因此显然它也不会将其放入最终目标文件/库/可执行文件中。

In short, the answer to your question is "no".简而言之,您的问题的答案是“否”。 But, if you don't believe me, just check the final generated file.但是,如果您不相信我,请检查最终生成的文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM