在 GCC 中设置 std=c99 标志
我想知道是否有任何文件可以设置 -std=c99
标志,这样我就不必为每个编译都设置它。我在 Ubuntu 上使用 GCC 4.4。
I was wondering if there were any files in which I could set the -std=c99
flag, so that I would not have to set it for every compilation. I am using GCC 4.4 on Ubuntu.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不要调用
/usr/bin/gcc
,而是使用/usr/bin/c99
。这是 Single-Unix 认可的调用 C99 编译器的方法。在 Ubuntu 系统上,这指向一个在添加-std=c99
标志后调用gcc
的脚本,这正是您想要的。Instead of calling
/usr/bin/gcc
, use/usr/bin/c99
. This is the Single-Unix-approved way of invoking a C99 compiler. On an Ubuntu system, this points to a script which invokesgcc
after having added the-std=c99
flag, which is precisely what you want.别名 gcc99= gcc -std=c99
怎么样?How about
alias gcc99= gcc -std=c99
?一些发行版和大多数基于 UNIX 的操作系统都有这些东西的别名或包装器。
Some distributions and in most UNIX based OS's have aliases or wrappers for this stuff.