[PATCH] D45406: Document -std= values for different languages

Dimitry Andric via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 7 12:26:03 PDT 2018


dim created this revision.
dim added reviewers: rsmith, dexonsmith, sylvestre.ledru, mgorny.
Herald added subscribers: krytarowski, fhahn.

After a remark on a FreeBSD mailing list that the clang man page did
not have any list of possible values for the `-std=` flag, I have now
attempted to exhaustively list those, for each available language.

This also includes a number of deprecated aliases, but since some of
those are still used, we might as well include them.  They are marked
with '(deprecated)`.

I also documented the default standard for each language, if there was
more than one choice.

Suggestions on how to make the values and descriptions line up more
nicely in RST are welcome.


Repository:
  rC Clang

https://reviews.llvm.org/D45406

Files:
  docs/CommandGuide/clang.rst


Index: docs/CommandGuide/clang.rst
===================================================================
--- docs/CommandGuide/clang.rst
+++ docs/CommandGuide/clang.rst
@@ -98,9 +98,57 @@
 
  Treat subsequent input files as having type language.
 
-.. option:: -std=<language>
+.. option:: -std=<standard>
 
  Specify the language standard to compile for.
+
+ Supported options for the C language are:
+
+ - ``c89``, ``c90`` or ``iso9899:1990``: ISO C 1990
+ - ``iso9899:199409``: ISO C 1990 with amendment 1
+ - ``gnu89`` or ``gnu90``: ISO C 1990 with GNU extensions
+ - ``c99``, ``iso9899:1999``, ``c9x`` (deprecated) or ``iso9899:199x``
+   (deprecated): ISO C 1999
+ - ``gnu99`` or ``gnu9x`` (deprecated): ISO C 1999 with GNU extensions
+ - ``c11``, ``iso9899:2011``, ``c1x`` (deprecated) or ``iso9899:201x``
+   (deprecated): ISO C 2011
+ - ``gnu11`` or ``gnu1x`` (deprecated): ISO C 2011 with GNU extensions
+ - ``c17`` or ``iso9899:2017``: ISO C 2017
+ - ``gnu17``: ISO C 2017 with GNU extensions
+
+ The default C language standard is ``gnu11``, except on PS4, where it is
+ ``gnu99``.
+
+ Supported options for the C++ language are:
+
+ - ``c++98`` or ``c++03``: ISO C++ 1998 with amendments
+ - ``gnu++98`` or ``gnu++03``: ISO C++ 1998 with amendments and GNU extensions
+ - ``c++11`` or ``c++0x`` (deprecated): ISO C++ 2011 with amendments
+ - ``gnu++11`` or ``gnu++0x`` (deprecated): ISO C++ 2011 with amendments and
+   GNU extensions
+ - ``c++14`` or ``c++1y`` (deprecated): ISO C++ 2014 with amendments
+ - ``gnu++14`` or ``gnu++1y`` (deprecated): ISO C++ 2014 with amendments and
+   GNU extensions
+ - ``c++17`` or ``c++1z`` (deprecated): ISO C++ 2017 with amendments
+ - ``gnu++17`` or ``gnu++1z`` (deprecated): ISO C++ 2017 with amendments and
+   GNU extensions
+ - ``c++2a``: Working draft for ISO C++ 2020
+ - ``gnu++2a``: Working draft for ISO C++ 2020 with GNU extensions
+
+ The default C++ language standard is ``gnu++14``.
+
+ Supported options for the OpenCL language are:
+
+ - ``cl1.0`` or ``cl`` (deprecated): OpenCL 1.0
+ - ``cl1.1``: OpenCL 1.1
+ - ``cl1.2``: OpenCL 1.2
+ - ``cl2.0``: OpenCL 2.0
+
+ The default OpenCL language standard is ``cl1.0``.
+
+ Supported options for the CUDA language are:
+
+ - ``cuda``: NVIDIA CUDA(tm)
 
 .. option:: -stdlib=<library>
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45406.141500.patch
Type: text/x-patch
Size: 2299 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180407/e3fe0124/attachment.bin>


More information about the cfe-commits mailing list