build: enable -Wextra warning level and apply required changes#1261
Merged
build: enable -Wextra warning level and apply required changes#1261
Conversation
0e051c6 to
c94d9fb
Compare
ce54311 to
ac67f34
Compare
This patch wraps GetProcAddress into a C++ template to make it easier to use and to allow us to ignore the cast-function-type warning in a central location. It also simplifies a lot of the uses due to template argument deduction and changes winapi.cc to use macros that reduce repetition.
Disable maybe-uninitialized warning that may occur when building with sanitizers enabled.
Introduce a macro to allow calling deprecated OpenSSL functionality, mostly the old non-EVP interfaces. Also allow calling EVP_md5() which is deprecated on Solaris only, so can also re-enable the deprecated-declarations warning on Solaris, too.
and fix some issues in droplet_device
When initializing PyTypeObject, there are a lot of fields to set. To avoid problems due to mis-ordering, we change this to use designated inizializers. While these are not legal in C++17, they're in C99, available as a compiler extension on virtually any major compiler and will became legal in C++20.
as this is C code, we cannot use [[fallthrough]] (yet).
in FreeTree() we kept the count of free'd blocks for a Dmsg. However Dmsgs are disabled in tree.cc, so it was never used.
Instead of two similar functions we now have one that takes parameters.
e12c3e1 to
26977a6
Compare
arogge
approved these changes
Nov 3, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bareos project put effort in reducing the number of warnings to zero with -Wall enabled.
This PR now also allows the codebase to be compiled with -Wextra which enables some more checks in the compilers.
Please check
If you have any questions or problems, please give a comment in the PR.
Helpful documentation and best practices
Checklist for the reviewer of the PR (will be processed by the Bareos team)
General
Source code quality
bareos-check-sources --since-mergedoes not report any problems