Closed PerilousApricot closed 8 years ago
And these are not actually errors. The first one I glanced at will require superflous code. Just because we don't check the return code directly doesn't mean another side effect isn't used to more directly probe the result.
Maybe we're looking at different things. There's a ton of errors that aren't just -Wsign-compare
or -Wunused-result
It's been a while since I looked at the clang output but I do recognize several of the non-trivial ones as false positives in the static analyzer. I remember several of them were due to split brain assumptions on loops with the only way of making it go away was to add extra logic to the loop who's sole purpose was to trap an impossible scenario. I'll take another look at it in any case.
This is actually from GCC5.3 (though addling a clang version would be helpful since they're different implementations).
In either case, please look through and jump through whatever hoops it takes so we can enable -Werror
.
You might think it's the dumbest thing ever, but from experience with much larger projects (in terms of LOC and developers) for CMS, having a test suite where you have to mentally ignore certain errors in the code because they were there for historical reasons made it so the whole test suite got discounted, and bugs slip through the cracks left and right. It's one of my bigger regrets, development-wise.
I draw the line on adding superflous code in a tight loop just to make the compiler happy though. Although I'm perfectly happy adding a comment above it saying it should be ignored and why.
If it's truly a tight loop, a simple annotation is all that's needed to silence the warning.
A compile-time annotation, if it's unclear.
I've gotten to the point where debug builds work with -Wall -Wextra -Werror -Wno-unused-parameter -Wno-deprecated-declarations -Wno-error=sign-compare
, so there's just a few left.
We need to do what we can to drop these compiler errors down to a minimum/a zero:
http://jenkins.accre.vanderbilt.edu/job/LStore-Master/lastSuccessfulBuild/warnings23Result/
I believe @tacketar said he'd pick it up