简体   繁体   English

C语言会影响gcc中的优化吗?

[英]Does C dialect affect optimization in gcc?

Does C dialect affect optimization in gcc? C语言会影响gcc中的优化吗? That is (all optimization options being held the same) will gcc produce faster/slower/larger/smaller code for ANSI vs C99 vs ...? 也就是说(所有优化选项保持不变)gcc是否会为ANSI vs C99 vs ...生成更快/更慢/更大/更小的代码?

It could, likely. 可能会这样。

One difference between C89 ("ANSI C") and C99 is the restrict keyword added with C99, which is specifically geared towards improving optimization. C89(“ANSI C”)和C99之间的一个差别是restrict与C99,这是专门对改善优化面向添加关键字。 While your code may not explicitly use it (because you wrote C89 code), the C language headers like <string.h> may declare function prototypes using restrict when in C99 mode. 当你的代码可能不会明确地使用它(因为你写代码C89),C语言头文件,如<string.h>的可以使用声明函数原型restrict在C99模式下。 This may or may not have an effect. 这可能有或没有影响。 You'll only know when you look at the generated code. 您只有在查看生成的代码时才知道。

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

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