4 ms·
This is way too low a bar. I already use this plus: -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wextra -Wformat=2 -Wimplicit-atomic-properties -Wmissing
by rleigh 10y ago
This is way too low a bar. I already use this plus:
-Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wextra -Wformat=2 -Wimplicit-atomic-properties -Wmissing-declarations -Wno-long-long -Wnon-virtual-dtor -Woverlength-strings -Woverloaded-virtual -Wredundant-decls -Wreorder -Wswitch-default -Wunused-variable -Wwrite-strings -Wno-variadic-macros -Wno-unused-local-typedef -Wno-language-extension-token -fstrict-aliasing
and optionally:
-Wconversion -Wdocumentation -Wfloat-equal -Wmissing-prototypes -Wold-style-cast -Wunreachable-code
and this is still insufficient. Why? Because this is only checking syntactical and semantic correctness. It can't check for violation of local policy, such as:
no use of new/delete (use make_unique or make_shared)
correct and consistent use of virtual inheritance across the entire codebase
rule of three and rule of five usage
etc.
These are mostly higher-level concerns. Stuff which other people on my team might introduce, and/or miss in review.
I don't yet have anything automated in place for this, but clang-tidy is on my todo list for investigation.
- dahart 10y agoSo, then you feel that @codebeaker should wait to learn C++ until tools that fulfill your wishlist are available? You agree that C++ is a minefield compared to Ruby, only because Ruby has Rubocop and C++ doesn't? Have you used any linters? Because linters are even worse than what you're describing with the C++ compiler. What they do is complain about style issues that some people believe are likely to lead to syntactical and semantic errors, without actually checking for the syntactical and semantic errors like a compiler does. Linters also don't check for violation of local policy, unless you extend them yourself. (And feel free to extend clang's warnings to suit your needs... it is open source.) I fully 100% completely agree that C++ tooling could be way better, and I wish it was too. But that's not the issue we're talking about here at all.