Skip to content
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

Reduce re-enabled diagnostics #6636

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

sellout
Copy link
Contributor

@sellout sellout commented May 4, 2023

Many Clang diagnostic flags both have their own warnings as well as control
other subflags. This PR addresses the warnings that are reported directly by
these mixed flags, reducing the number of sub-flag diagnostics we need to
re-enable.

Since they control other subflags, enabling the superflag often means disabling
other subflags that also trigger warnings.

@sellout sellout marked this pull request as draft May 4, 2023 20:55
@sellout sellout added A-build Area: Build system C-cleanup Category: PRs that clean code up or issues documenting cleanup. labels May 4, 2023
@sellout sellout force-pushed the reduce-reenabled-diagnostics branch from 8306d39 to 2d05e40 Compare May 4, 2023 23:00
@sellout sellout marked this pull request as ready for review May 4, 2023 23:01
@sellout sellout added the safe-to-build Used to send PR to prod CI environment label May 4, 2023
@ECC-CI ECC-CI removed the safe-to-build Used to send PR to prod CI environment label May 4, 2023
src/wallet/db.cpp Outdated Show resolved Hide resolved
src/rpc/server.cpp Outdated Show resolved Hide resolved
daira
daira previously approved these changes May 5, 2023
Copy link
Contributor

@daira daira left a comment

Choose a reason for hiding this comment

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

The gtest WalletTests.FindUnspentSproutNotes is failing. Otherwise utACK with comments.

@daira
Copy link
Contributor

daira commented May 5, 2023

I opened sellout#3 onto this branch.

@sellout sellout force-pushed the reduce-reenabled-diagnostics branch 2 times, most recently from b2184e7 to 3a4884b Compare May 10, 2023 06:26
@sellout sellout added the safe-to-build Used to send PR to prod CI environment label May 10, 2023
@sellout sellout mentioned this pull request May 10, 2023
@ECC-CI ECC-CI removed the safe-to-build Used to send PR to prod CI environment label May 10, 2023
@sellout sellout force-pushed the reduce-reenabled-diagnostics branch from 3a4884b to 9b4032d Compare May 10, 2023 15:29
@sellout sellout added the safe-to-build Used to send PR to prod CI environment label May 11, 2023
@ECC-CI ECC-CI removed the safe-to-build Used to send PR to prod CI environment label May 11, 2023
@@ -2324,7 +2324,7 @@ void CNode::AskFor(const CInv& inv)

void CNode::BeginMessage(const char* pszCommand) EXCLUSIVE_LOCK_FUNCTION(cs_vSend)
{
ENTER_CRITICAL_SECTION(cs_vSend);
ENTER_CRITICAL_SECTION(cs_vSend)
Copy link
Contributor

Choose a reason for hiding this comment

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

If there were more uses of {ENTER,LEAVE}_CRITICAL_SECTION then I'd suggest altering the macros to avoid the warning, but it turns out there are only 8 uses of either macro in the whole codebase.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I edited the macros in other places where it made sense (e.g., 52f4105#diff-b1924661640b70276005001174b3b3640f02be7232bb8d9a1b9518dde32f8055R189). But here (and for ADD_SERIALIZE_METHODS in #6641) the structure of the macro made it non-obvious how I could make that change.

src/netbase.cpp Outdated Show resolved Hide resolved
src/netbase.cpp Outdated Show resolved Hide resolved
src/netbase.cpp Outdated Show resolved Hide resolved
src/netbase.cpp Outdated Show resolved Hide resolved
src/rest.cpp Outdated Show resolved Hide resolved
src/script/interpreter.cpp Outdated Show resolved Hide resolved
src/tinyformat.h Outdated Show resolved Hide resolved
Copy link
Contributor

@daira daira left a comment

Choose a reason for hiding this comment

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

Backporting the removal of PostCommand/OnPostCommand in bitcoin/bitcoin#9575 instead of fixing it is blocking.

@sellout sellout force-pushed the reduce-reenabled-diagnostics branch 3 times, most recently from b0dfbbd to 0e879ef Compare May 18, 2023 01:38
sellout added 11 commits May 19, 2023 11:33
Some of the sub-warnings are still disabled.
Our only change is to rename a var from `requires` (which is a C++20 keyword) to `dependencies`.
Most re-enabled diagnostics have been removed. The remaining ones are tied to
diagnostics that require deeper changes. This makes the parent diagnostics
explicit so it’s easier to identified when the remaining re-enabled flags should
be removed from the list.
@sellout sellout force-pushed the reduce-reenabled-diagnostics branch from 0e879ef to 1234ebe Compare May 19, 2023 17:36
@sellout sellout added the safe-to-build Used to send PR to prod CI environment label May 19, 2023
@sellout sellout requested a review from daira May 19, 2023 21:00
@daira
Copy link
Contributor

daira commented May 31, 2023

I will take over this PR.

@daira daira self-assigned this May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build Area: Build system C-cleanup Category: PRs that clean code up or issues documenting cleanup. safe-to-build Used to send PR to prod CI environment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants