Clang Compile Cheat Sheet?

I was hoping to try Clang as a compiler for the advertised “more informative” error reports. However, I have found that Clang is really hard to get into. There are so many flags and stuff that it is hard to find the commands you would need to know when just compiling code.

I was unable to find any informative cheat sheet online regarding this, so I thought that maybe the people on the forum can help make this thing more approachable. What would be good to know? Basic syntax, common usage flags, advanced usage (I don’t even know what that means). Something that would fit on a single A4 and could get anyone new to Clang started in a minute and would pave the way to the more advanced features.

Thanks for reading.

Clang has multiple Drivers. The ones I’m aware of are the GCC-style frontend (clang++) and the MSVC-style frontend (clang-cl). These are almost drop-in replacements for GCC and cl. So most of the time you just have to change the compiler, and everything should just work.

For most cases there are no differences:

g++/clang++  -Wall -Werror -c foo.c -o foo.o

The non cheat sheet is on the clang webpage.