I want to know what C language standard is my current installation of gcc following by default. I ran info gcc
and it gave -std=standard
.
What does -std=standard
mean?
I was expecting something like -std=gnu11
OS: linux mint 19.1 gcc version: 7.4.0, gcc came pre-installed with the OS
I looked into online manual here: https://gcc.gnu.org/onlinedocs/gcc-7.4.0/gcc/Standards.html#C-Language
but I didn't find any default standard named "standard". Instead I found that it should be "gnu11"
info gcc response:
...
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.
The same is with -fpermitted-flt-eval-methods=standard or -fno-builtin-function. You should specify the function that gcc should not use builtin for. This is a list of available options for C language in gcc, not list of default options gcc uses.
You can find the standard gcc is using by inspecting __STDC_VERSION__
macro. Or check the documentation. Quoting the link, for gcc 7.2.0:
The default, if no C language dialect options are given, is -std=gnu11.