Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Complete list of Clang flags

Tags:

clang

Where can I find a complete list of Clang flags?

There are some, like -include-pch, that don't appear to be even listed in the man page. :(

I know that GCC uses some of the same flags, but it doesn't include documentation for stuff like -Os which I believe is only available in Clang. Is there a place where I can find a single, consolidated list of all the Clang options ever?

like image 283
Colen Avatar asked Oct 24 '11 19:10

Colen


People also ask

Does clang define __ GNUC __?

(GNU C is a language, GCC is a compiler for that language.Clang defines __GNUC__ / __GNUC_MINOR__ / __GNUC_PATCHLEVEL__ according to the version of gcc that it claims full compatibility with.

Is clang owned by Apple?

In the end, Apple chose to develop Clang, a new compiler front end that supports C, Objective-C and C++. In July 2007, the project received the approval for becoming open-source.

Is clang better than GCC?

Clang is much faster and uses far less memory than GCC. Clang aims to provide extremely clear and concise diagnostics (error and warning messages), and includes support for expressive diagnostics. GCC's warnings are sometimes acceptable, but are often confusing and it does not support expressive diagnostics.

Does clang support C++17?

C++17 implementation statusYou can use Clang in C++17 mode with the -std=c++17 option (use -std=c++1z in Clang 4 and earlier).


1 Answers

I don't know if this is exactly what you want. Maybe more options are described elsewhere, but I think you are interested in the Clang frontend options. By default, the options displayed seem to describe the "GCC-compatible driver".

clang -cc1 --help should give you what you want.

like image 162
Guillaume Papin Avatar answered Oct 02 '22 21:10

Guillaume Papin