How can I run GCC/Clang for static analysis? (warnings only)

前端 未结 2 537
遇见更好的自我
遇见更好的自我 2021-02-05 11:26

Without compiling code, I would like GCC or Clang to report warnings.
Is it possible to run the compiler for static analysis only?
I can\'t find a way to pass the compi

2条回答
  •  春和景丽
    2021-02-05 12:18

    Both GCC and Clang have an option -fsyntax-only that makes the compiler only perform syntax checking without any actual compilation.

提交回复
热议问题