You copied the Doc URL to your clipboard.

-std

Specifies the language standard to compile for.

Note

This topic includes descriptions of [COMMUNITY] features. See Support level definitions.

Syntax

-std=name

Where:

name

Specifies the language mode. Valid values include:

c90
C as defined by the 1990 C standard.
gnu90
C as defined by the 1990 C standard, with additional GNU extensions.
c99
C as defined by the 1999 C standard.
gnu99
C as defined by the 1999 C standard, with additional GNU extensions.
c11 [COMMUNITY]
C as defined by the 2011 C standard.
gnu11 [COMMUNITY]
C as defined by the 2011 C standard, with additional GNU extensions.
c++98
C++ as defined by the 1998 C++ standard.
gnu++98
C++ as defined by the 1998 C++ standard, with additional GNU extensions.
c++03
C++ as defined by the 2003 C++ standard.
gnu++03
C++ as defined by the 2003 C++ standard, with additional GNU extensions.
c++11
C++ as defined by the 2011 C++ standard.
gnu++11
C++ as defined by the 2011 C++ standard, with additional GNU extensions.
c++14
C++ as defined by the 2014 C++ standard.
gnu++14
C++ as defined by the 2014 C++ standard, with additional GNU extensions.
c++17 [COMMUNITY]
C++ as defined by the 2017 C++ standard.
gnu++17 [COMMUNITY]
C++ as defined by the 2017 C++ standard, with additional GNU extensions.

For C++ code, the default is gnu++14. For more information about C++ support, see C++ Status on the Clang web site.

For C code, the default is gnu11. For more information about C support, see Language Compatibility on the Clang web site.

Note

Use of C11 library features is unsupported.
Was this page helpful? Yes No