diff options
author | Dimitry Andric <dimitry@andric.com> | 2018-04-11 17:21:52 +0000 |
---|---|---|
committer | Dimitry Andric <dimitry@andric.com> | 2018-04-11 17:21:52 +0000 |
commit | f6c76532c83ba3b9a0266a5d1b76839f2d8a57f1 (patch) | |
tree | f5d56924831f34f325d8aacf388bf60050cd05b5 /clang/docs/CommandGuide | |
parent | fd8d4af3bcd1b51c79e195a06c913d7d61198e8b (diff) | |
download | bcm5719-llvm-f6c76532c83ba3b9a0266a5d1b76839f2d8a57f1.tar.gz bcm5719-llvm-f6c76532c83ba3b9a0266a5d1b76839f2d8a57f1.zip |
Document -std= values for different languages
Summary:
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.
I also documented the default standard for each language, if there was
more than one choice.
Reviewers: rsmith, dexonsmith, sylvestre.ledru, mgorny
Reviewed By: rsmith
Subscribers: fhahn, emaste, cfe-commits, krytarowski
Differential Revision: https://reviews.llvm.org/D45406
llvm-svn: 329827
Diffstat (limited to 'clang/docs/CommandGuide')
-rw-r--r-- | clang/docs/CommandGuide/clang.rst | 121 |
1 files changed, 120 insertions, 1 deletions
diff --git a/clang/docs/CommandGuide/clang.rst b/clang/docs/CommandGuide/clang.rst index 16bb09f3c74..d440d915d68 100644 --- a/clang/docs/CommandGuide/clang.rst +++ b/clang/docs/CommandGuide/clang.rst @@ -98,10 +98,129 @@ Language Selection and Mode Options Treat subsequent input files as having type language. -.. option:: -std=<language> +.. option:: -std=<standard> Specify the language standard to compile for. + Supported values for the C language are: + + | ``c89`` + | ``c90`` + | ``iso9899:1990`` + + ISO C 1990 + + | ``iso9899:199409`` + + ISO C 1990 with amendment 1 + + | ``gnu89`` + | ``gnu90`` + + ISO C 1990 with GNU extensions + + | ``c99`` + | ``iso9899:1999`` + + ISO C 1999 + + | ``gnu99`` + + ISO C 1999 with GNU extensions + + | ``c11`` + | ``iso9899:2011`` + + ISO C 2011 + + | ``gnu11`` + + ISO C 2011 with GNU extensions + + | ``c17`` + | ``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 values for the C++ language are: + + | ``c++98`` + | ``c++03`` + + ISO C++ 1998 with amendments + + | ``gnu++98`` + | ``gnu++03`` + + ISO C++ 1998 with amendments and GNU extensions + + | ``c++11`` + + ISO C++ 2011 with amendments + + | ``gnu++11`` + + ISO C++ 2011 with amendments and GNU extensions + + | ``c++14`` + + ISO C++ 2014 with amendments + + | ``gnu++14`` + + ISO C++ 2014 with amendments and GNU extensions + + | ``c++17`` + + ISO C++ 2017 with amendments + + | ``gnu++17`` + + 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 values for the OpenCL language are: + + | ``cl1.0`` + + 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 values for the CUDA language are: + + | ``cuda`` + + NVIDIA CUDA(tm) + .. option:: -stdlib=<library> Specify the C++ standard library to use; supported options are libstdc++ and |