Skip to content

build: enable -Wextra warning level and apply required changes#1261

Merged
pstorz merged 53 commits intomasterfrom
dev/pstorz/master/wextra
Nov 3, 2022
Merged

build: enable -Wextra warning level and apply required changes#1261
pstorz merged 53 commits intomasterfrom
dev/pstorz/master/wextra

Conversation

@pstorz
Copy link
Member

@pstorz pstorz commented Sep 16, 2022

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

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

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
  • PR name is meaningful
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
  • Check backport line
  • Is the PR title usable as CHANGELOG entry?
  • Separate commit for CHANGELOG.md ("update CHANGELOG.md"). The PR number is correct.
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR
  • bareos-check-sources --since-merge does not report any problems

@pstorz pstorz marked this pull request as draft September 16, 2022 14:35
@pstorz pstorz requested a review from arogge September 16, 2022 14:36
@pstorz pstorz self-assigned this Sep 19, 2022
@pstorz pstorz force-pushed the dev/pstorz/master/wextra branch from 0e051c6 to c94d9fb Compare September 30, 2022 14:58
@pstorz pstorz marked this pull request as ready for review October 19, 2022 09:54
@arogge arogge force-pushed the dev/pstorz/master/wextra branch 5 times, most recently from ce54311 to ac67f34 Compare October 25, 2022 13:04
Copy link
Member Author

@pstorz pstorz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments

arogge added 25 commits November 3, 2022 10:09
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.
@arogge arogge force-pushed the dev/pstorz/master/wextra branch from e12c3e1 to 26977a6 Compare November 3, 2022 09:14
@pstorz pstorz merged commit 8a47780 into master Nov 3, 2022
@pstorz pstorz deleted the dev/pstorz/master/wextra branch November 3, 2022 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants