News for hackers. Stuff that matters.
Re:My favorite C compiler flags during development by yaantc on Saturday April 29, 2023 @11:25PM (#35759439)
As I understand it the Clang static analyzer is not intended to be used directly. It's best to use it through CodeChecker, which provide high level commands and do the low level calls to the Clang SA (and also Clang tidy). In particular if you want whole project analysis (CTU, cross translation units analysis) CC will do the all the needed calls in a single "analyze" command.

[1] https://codechecker.readthedocs.io/en/latest/

Re:My favorite C compiler flags during development by bigdict on Saturday April 29, 2023 @11:30PM (#35759459)
God I love HN. It's like an office watercooler the size of a grain silo with thousands of programmers hanging around.
Re:My favorite C compiler flags during development by unwind on Sunday April 30, 2023 @03:42AM (#35760422)
Now that is a tshirt design I would get behind. Or into, I guess.
Re:My favorite C compiler flags during development by wiseowise on Sunday April 30, 2023 @02:34AM (#35760156)
Holy crap this is amazing.
Re:My favorite C compiler flags during development by flohofwoe on Sunday April 30, 2023 @05:24AM (#35760966)
I currently use `--analyze -Xanalyzer -analyzer-opt-analyze-headers` for checking my header-only libs in clang, but AFAIK the recommended workflow is to use clang-tidy which is better configurable than calling clang directly.

If you're on Mac with Xcode, the static analyzer and the sanitizers ASAN, UBSAN and TSAN are simple UI checkboxes.

Re:My favorite C compiler flags during development by einpoklum on Sunday April 30, 2023 @03:46PM (#35765976)
That codechecker thing is sooo tedios to install. Why do I need to 70 MB of environment for some python script which just wraps clang tools anyway? :-(