[英]what does “-std=standard” in gcc info page mean?
I want to know what C language standard is my current installation of gcc following by default. 我想知道默认情况下我当前安装的gcc是什么C语言标准。 I ran info gcc
and it gave -std=standard
. 我运行了info gcc
,它给出了-std=standard
。
What does -std=standard
mean? -std=standard
是什么意思?
I was expecting something like -std=gnu11
我期待像-std=gnu11
这样的东西
OS: linux mint 19.1 gcc version: 7.4.0, gcc came pre-installed with the OS 操作系统:linux mint 19.1 gcc版本:7.4.0,操作系统已预装gcc
I looked into online manual here: https://gcc.gnu.org/onlinedocs/gcc-7.4.0/gcc/Standards.html#C-Language 我在这里查看了在线手册: https : //gcc.gnu.org/onlinedocs/gcc-7.4.0/gcc/Standards.html#C-Language
but I didn't find any default standard named "standard". 但是我没有找到任何名为“ standard”的默认标准。 Instead I found that it should be "gnu11" 相反,我发现它应该是“ gnu11”
info gcc response: 信息gcc响应:
...
OPTIONS
Option Summary
Here is a summary of all the options, grouped by type. Explanations
are in the following sections.
Overall Options
-c -S -E -o file -x language -v -### --help[=class[,...]]
--target-help --version -pass-exit-codes -pipe -specs=file
-wrapper @file -fplugin=file -fplugin-arg-name=arg
-fdump-ada-spec[-slim] -fada-spec-parent=unit -fdump-go-spec=file
C Language Options
-ansi -std=standard -fgnu89-inline
-fpermitted-flt-eval-methods=standard -aux-info filename
-fallow-parameterless-variadic-functions -fno-asm
...
The word "standard" is in a cursive font. “标准”一词是草书字体。 It's a template, it's not a "default gcc standard gcc uses by default", it's a template to be filled by the user with available option, the word "standard" stands there for gnu11
or c11
or for the standard you want to specify. 这是一个模板,不是“默认gcc默认使用的gcc标准”,而是一个由用户使用可用选项填充的模板,“ standard”一词代表gnu11
或c11
或您要指定的标准。
The same is with -fpermitted-flt-eval-methods= standard or -fno-builtin- function . -fpermitted-flt-eval-methods = standard或-fno-builtin- function也是如此 。 You should specify the function that gcc should not use builtin for. 您应该指定gcc不应使用内置函数的函数 。 This is a list of available options for C language in gcc, not list of default options gcc uses. 这是gcc中C语言可用选项的列表,而不是gcc使用的默认选项的列表。
You can find the standard gcc is using by inspecting __STDC_VERSION__
macro. 您可以通过检查__STDC_VERSION__
宏来找到正在使用的标准gcc。 Or check the documentation . 或检查文档 。 Quoting the link, for gcc 7.2.0: 引用链接,适用于gcc 7.2.0:
The default, if no C language dialect options are given, is -std=gnu11. 如果未提供C语言方言选项,则默认值为-std = gnu11。
In the context of -std=standard
, standard
is meant to represent one of the values listed in the Options Controlling C Dialect . 在-std=standard
的上下文中, standard
表示代表“ 控制C语言 ” 选项中列出的值之一。 It isn't meant to literally be the string standard
; 从字面上看,它并不是字符串standard
; that results in an error: 导致错误:
gcc: error: unrecognized command line option ‘-std=standard’
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.