[1] https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.h...
It does show potential, and I hope it improves in future. Be nice to have a libre version of coverity one day.
Edit: Output from compiling nbdkit upstream with -fanalyzer: https://paste.centos.org/view/8381f926
In GCC it's a compiler flag. In LLVM it's a convoluted process automated by either an irritating perl/python script (The python one isn't included by default for some reason despite being far more common these days) or AN ENTIRE WEB SERVER TO OUTPUT TEXT (Which thankfully isn't included by default).
I'm sure you could set it up in make but since my projects aren't large scale enough to really need it I can't be bothered, even if it's one of those things you'll probably only need to write once and can just copy and paste ad-infinitum.
Biggest advantage I see is it's integrated into the compiler and so sees the same things the compiler does.
Having gcc do this out of the box helps people port their experience/skills with static analysis to other companies.
We already have clang-tidy and I like it too but it's nice to have a fall-back to compare when one produces a strange result. And a bit of competition is always good to have between such projects. And on most big projects it's not like you can just change the build system to use another compiler.
Also I found some interesting cases which valgrind didn't see because it was in an unreachable branch.
Basically this replicates what clang-tidy did
You could do something like that at runtime though, but then you have Valgrind, basically.
https://herbsutter.com/2018/09/20/lifetime-profile-v1-0-post...
"Update on C++ Core Guidelines Lifetime Analysis. Gábor Horváth. CoreHard Spring 2019"
https://www.youtube.com/watch?v=EeEjgT4OJ3E
While it might never be Rust like due to language semantics, it is way better than not having anything.
static const int π = 3;
int get_naïve_pi() {
return π;
}
Lovely! present?(p) // return bool
get!(g) // throw if not found
a-la ruby/elixir could be goodOf course you can also cause all sorts of mayhem. Even disregarding fun such as GREEK QUESTION MARK looking like a semicolon and zero-width spaces, I probably would not use this feature in enterprise code. Too likely that some tool somewhere (e.g. an alternate compiler?) is KO'd by characters outside of basic ASCII range (which has served us well and will keep doing so).
Nice to see a bunch of C++20 features making it in. Coroutines seems like a big one!
Goes to look at README.Bugs. Holy cow, I don't have time to to check all those places to see if it has been reported already.
[1]: https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/pp...
Surely it's available from here at the very least?
> or any of the mirrors I tried
Seems to be to me?
ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-10.1.0/