DEV Community

loading...

Discussion on: What Does C++ Do That Rust Doesn't?

codemouse92 profile image
Jason C. McDonald

Yeah, probably. That said, LLVM Clang has many of that same sort of static analysis baked into the compiler, if you just turn the flags on for it. (-Wall -Wextra -Werror).

It's also pretty trivial to hook cppcheck into your automatic workflow and/or IDE to handle all the stuff the compiler doesn't complain about.

Thread Thread
deciduously profile image
Ben Lovy Author

cppcheck

TIL, thanks! I don't know that I've ever compiled C++ without that set of flags, I'm a little scared to.

Thread Thread
codemouse92 profile image
Jason C. McDonald

Just in case I wasn't clear, cppcheck is an external static analyser, but it's quite a good one!

Yeah, I never work without -Wall -Wextra -Werror. I ususally throw -Wpedantic in there too, for good measure.

Thread Thread
juzzlin profile image
Jussi Lind

Also, Qt Creator IDE has an amazing static analyzer working out-of-the box.