在 GCC 中设置 std=c99 标志

发布于 2024-08-20 07:12:26 字数 86 浏览 6 评论 0原文

我想知道是否有任何文件可以设置 -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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

我不是你的备胎 2024-08-27 07:12:26

不要调用 /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 invokes gcc after having added the -std=c99 flag, which is precisely what you want.

開玄 2024-08-27 07:12:26

别名 gcc99= gcc -std=c99 怎么样?

How about alias gcc99= gcc -std=c99?

反话 2024-08-27 07:12:26
export CFLAGS="-std=c99"
export CC="gcc"

make 

一些发行版和大多数基于 UNIX 的操作系统都有这些东西的别名或包装器。

export CFLAGS="-std=c99"
export CC="gcc"

make 

Some distributions and in most UNIX based OS's have aliases or wrappers for this stuff.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文