clang(1) 3.4 manpage documentation is sparse; need help figuring out available options in compiler

    I'm trying to figure out how to convert a custom gccp call to
clang, and unfortunately I can't figure out how to make it work via
the manpage alone. gcc/g++ has a long manpage with a list of available
warnings, full list of optimization flags, etc. Is there any
documentation like that in clang, beyond what's in man 1 clang?
Thank you!

I don’t think so (apart from the webpages), but clang is meant to be a drop in replacement for gcc. Can you be a bit more specific with the issue you’re having?

All of the command line parameters of GCC is NOT working in Clang .
Therefore , it is necessary to have a complete list of command line
parameters which means GCC manuals are not a substitute of such a need .

Thank you very much .

Mehmet Erol Sanliturk

Hi Nikola,
  The problem is that as a FreeBSD/OSX end-user, have no idea what is and isn’t supported with clang from a command line perspective, apart from what’s listed in man 1 clang (which isn’t much: clang ). Many of the C/C++ warnings are missing from the manpage, optimization flags aren’t noted (-march/-mcpu, etc), etc. I realize that man 1 gcc consists of a lot of outdated information, but the bulk majority of the information is presented in man 1 gcc/man 1 g++. In my case, I was trying to figure out what preprocessor options are available via clang (in order to turn off undefined/unsupported preprocessor #defines, if such a thing existed), but I didn’t find anything helpful in man 1 clang and I didn’t have the patience to look through /usr/src/contrib/llvm for the command-line options to achieve what I needed. Furthermore, if there is any language-specific documentation, it’s not linked from within man 1 clang.
  Documentation webpages don’t seem to elucidate me either: clang warnings list - Google Search.
  Other folks have complained about the lack of manpage documentation on StackOverflow as well: Complete list of Clang flags - Stack Overflow .
  I love clang as a compiler, but I miss the documentation I had with gcc. If someone could fill in those blanks, I would appreciate clang a lot more.
Thank you!

I can’t really comment on the man page as I don’t know anything about it. Users manual has some information about warnings Also try using clang -cc1 --help.

The first step is usually to just try the gcc switch that does what you want and see if you get an error. Clang does try to be compatible with gcc, but this has never been (and will probably never be) 100%. Options that are widely used are always something we’re interested in implementing so please file bugs if you think you’ve found something clang doesn’t but should support.

Documentation has always been lacking but has improved significantly in recent times. This, as everything else, is thanks to many people who take the time to do the work. Most things in Clang are “itch driven”, and you seem like you have one. We’d love to have better documentation and if you have time to contribute, in any capacity, your patches will be very welcome. It would also be a nice Christmas present :slight_smile: