When I try to use the '-fmax-errors=n' option with clang++
the following warning is output:
clang: warning: argument unused during compilation: '-fmax-errors=2'
What is the clang equivalent?
GCC's PCH mechanism (which is just a dump of the compiler memory image) is related, but is architecturally only able to read the dump back into the exact same executable as the one that produced it (it is not a structured format). Clang is much faster and uses far less memory than GCC.
(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.
Clang C++ can parse GCC 4.2 libstdc++ and generate working code for non-trivial programs, and can compile itself.
Clang uses the LLVM compiler as its back end and it has been included in the release of the LLVM since the LLVM 2.6. Clang is also built to be a drop-in replacement for GCC command. In its design, the Clang compiler has been constructed to work very similarly to GCC to ensure that portability is maximized.
The equivalent clang flag is -ferror-limit
:
clang -ferror-limit=2 test.c
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With