-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TravisCI] Treating some warnings as errors #1130
Comments
|
I am fairly anal about getting Z3 to compile without warnings even if they may be benign. They help flag issues even when it comes to code maintainability. The warnings you list seem not in the benign category. Are these flagged as warnings at this point? I don't recall seeing them for a while. |
Yes most of the warnings I gave as examples are not emitted by Z3's current code. These are warnings are remember being in Z3's code at some point which I would be keen to not have re-introduced. It's certainly not exhaustive list, they are just things I thought of just now. |
|
OK, sounds good. What should be changed to treat them as errors? The virtual destructor issue is definitely something I would treat as an error unless learning about any compelling evidence to the contrary. The only kind of warnings I feel compelled to punt on are the ones that appear in compiled macros (there are some on potentially uninitialized or unused variables, but these are going to be used properly) |
There are two places this could be done either as custom flags set in the TravisCI build scripts or as part of the CMake build system itself. I'd prefer to do it in CMake itself because we can test the compiler at runtime and actually check whether or not it supports the warning we'd like to treat as an error. This would likely be a modification to https://github.com/Z3Prover/z3/blob/master/cmake/compiler_warnings.cmake . We'd also probably want some sort of CMake option to not treat any warnings as errors just in case there's a bug in the compiler (e.g. certain versions of a compiler might give false positives) but have that off by default so that we treat the same warnings as errors during development as in TravisCI (provided the compiler being used for development supports the same warnings). Currently |
|
I was assuming it was a cmake change so that breaks are potentially caught in local builds. |
|
Similar here, I fix warnings before pushing from my development platform, and the day after on warnings that show up on our other nightly build platforms. From my point of view we don't really need that enforced by the CI build, but it doesn't hurt to add a sensible subset of them either. |
AFAIK for gcc/clang no. It's a bit of a mess really. There's I think turning the
We'd then make |
|
just adding the flags you mention as errors should be very nice. |
Now that we have TravisCI in place we could consider treating certain categories of warnings found by Clang/GCC as errors. This would hopefully prevent certain issues from staying in the master branch for long as they would break the build.
Is there any interest in doing this? If so what warnings should be treated as errors?
This was inspired by #1129.
E.g.
GCC
-WodrClang
-Wdelete-non-virtual-dtor-Woverloaded-virtualThe text was updated successfully, but these errors were encountered: