gpt4 book ai didi

clang - 如何获取Clang支持的标准列表?

转载 作者:行者123 更新时间:2023-12-04 13:23:10 25 4
gpt4 key购买 nike

我在MAN中找到了这个:

   -std=language
Specify the language standard to compile for.

-ansi
Same as -std=c89.

但是在哪里可以找到我已安装的编译器支持的所有标准的列表?
clang -std=??? test.c

最佳答案

检查此文件: llvm.git/tools/clang/include/clang/Frontend/LangStandards.def
online version from github
编译器支持的标准正在不断变化,您可以检查此文件并自己尝试。

// C++ modes
LANGSTANDARD(cxx98, "c++98",
"ISO C++ 1998 with amendments",
LineComment | CPlusPlus | Digraphs)
LANGSTANDARD(cxx03, "c++03",
"ISO C++ 1998 with amendments",
LineComment | CPlusPlus | Digraphs)
LANGSTANDARD(gnucxx98, "gnu++98",
"ISO C++ 1998 with amendments and GNU extensions",
LineComment | CPlusPlus | Digraphs | GNUMode)

LANGSTANDARD(cxx0x, "c++0x",
"ISO C++ 2011 with amendments",
LineComment | CPlusPlus | CPlusPlus11 | Digraphs)
LANGSTANDARD(cxx11, "c++11",
"ISO C++ 2011 with amendments",
LineComment | CPlusPlus | CPlusPlus11 | Digraphs)
LANGSTANDARD(gnucxx0x, "gnu++0x",
"ISO C++ 2011 with amendments and GNU extensions",
LineComment | CPlusPlus | CPlusPlus11 | Digraphs | GNUMode)
LANGSTANDARD(gnucxx11, "gnu++11",
"ISO C++ 2011 with amendments and GNU extensions",
LineComment | CPlusPlus | CPlusPlus11 | Digraphs | GNUMode)

关于clang - 如何获取Clang支持的标准列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21870283/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com