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

doc: Remove confusing assert linter #28304

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Aug 21, 2023

The assert() documentation and linter are redundant and confusing:

  • The source code already refuses to compile with assert() disabled.
  • They violate the assumptions about Assert(), which requires side effects.
  • The existing linter doesn't enforce the guideline, only checking for ++ and -- side effects.

Fix all issues by removing the docs and the linter. See also #26684 (comment)

Going forward everyone is free to use whatever code in this regard they think is the easiest to read. Also, everyone is still free to share style-nits, if they think it is a good use of their time and of the pull request author. Finally, the author is still free to dismiss or ignore this style-nit, or any other style-nit.

@DrahtBot
Copy link
Contributor

DrahtBot commented Aug 21, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK hebasto, theStack

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@DrahtBot
Copy link
Contributor

Guix builds

File commit 38db2bd
(master)
commit cbec0b1
(master and this pull)
SHA256SUMS.part 740e6c5d9b4e167e... 42d4f41ff2fb8286...
*-aarch64-linux-gnu-debug.tar.gz 2eb6065bd57f1ce7... 1aebe12130d123f4...
*-aarch64-linux-gnu.tar.gz 52ed1288635185a1... b0b4fb1d6ef39c6c...
*-arm-linux-gnueabihf-debug.tar.gz 0924c3d536c8f04a... f05ac3f5c5933955...
*-arm-linux-gnueabihf.tar.gz b9680d0dbad2e035... b18506fc5b061c30...
*-arm64-apple-darwin-unsigned.dmg eb09a41c7c60b4c7... 980252c0a7164cc5...
*-arm64-apple-darwin-unsigned.tar.gz d0d1a44623583cfd... 3441acd18c653d6e...
*-arm64-apple-darwin.tar.gz 16e3ec6cc1b015a9... 0810ea82ab5b4e8b...
*-powerpc64-linux-gnu-debug.tar.gz 91f2a9ddb00e6e82... 760995df20345879...
*-powerpc64-linux-gnu.tar.gz 8adbb5294a61b01c... 0e714aad7b4b9b1b...
*-powerpc64le-linux-gnu-debug.tar.gz f54633c2f9a6f7d0... fa665e0f4c76c6a0...
*-powerpc64le-linux-gnu.tar.gz a2ddb98e2d9985c3... 26071588767d47b5...
*-riscv64-linux-gnu-debug.tar.gz 53782894fd1d6b68... c0193cbf61077516...
*-riscv64-linux-gnu.tar.gz 6d760fd88b76b69d... 0cde117605afaf24...
*-x86_64-apple-darwin-unsigned.dmg f210299e59ed3553... fb130a24cb2eca4d...
*-x86_64-apple-darwin-unsigned.tar.gz 9c7933f084d3fce3... 7f26c48ca06b0588...
*-x86_64-apple-darwin.tar.gz 9f545141b34e4bb2... dc0f194f7f3911a0...
*-x86_64-linux-gnu-debug.tar.gz b46979488366d6da... 67d3c77076a1358f...
*-x86_64-linux-gnu.tar.gz de82001dabf95800... 97d14924de553f78...
*.tar.gz bb6d491db6c6088c... 4dd59004af50f508...
guix_build.log 25a587482b817be2... d443ec23c8d7fe76...
guix_build.log.diff 9cf88b432416a539...

@hebasto
Copy link
Member

hebasto commented Sep 15, 2023

Concept ACK.

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

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

ACK fa6e6a3, I have reviewed the code and it looks OK.

I agree with all three points mentioned in the PR description.

Copy link
Contributor

@theStack theStack left a comment

Choose a reason for hiding this comment

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

ACK fa6e6a3

@maflcko maflcko requested a review from fanquake October 3, 2023 08:00
@fanquake fanquake merged commit 4e78834 into bitcoin:master Oct 3, 2023
@fanquake
Copy link
Member

fanquake commented Oct 3, 2023

If we ever wanted to reintroduce something similar in future, using https://clang.llvm.org/extra/clang-tidy/checks/bugprone/assert-side-effect.html#bugprone-assert-side-effect is also likely more appropriate.

@maflcko maflcko deleted the 2308-doc-assert- branch October 3, 2023 09:47
Frank-GER pushed a commit to syscoin/syscoin that referenced this pull request Oct 13, 2023
fa6e6a3 doc: Remove confusing assert linter (MarcoFalke)

Pull request description:

  The `assert()` documentation and linter are redundant and confusing:

  * The source code already refuses to compile with `assert()` disabled.
  * They violate the assumptions about `Assert()`, which *requires* side effects.
  * The existing linter doesn't enforce the guideline, only checking for `++` and `--` side effects.

  Fix all issues by removing the docs and the linter. See also bitcoin#26684 (comment)

  Going forward everyone is free to use whatever code in this regard they think is the easiest to read. Also, everyone is still free to share style-nits, if they think it is a good use of their time and of the pull request author. Finally, the author is still free to dismiss or ignore this style-nit, or any other style-nit.

ACKs for top commit:
  hebasto:
    ACK fa6e6a3, I have reviewed the code and it looks OK.
  theStack:
    ACK fa6e6a3

Tree-SHA512: 686738d71e1316cc95e5d3f71869b55a02bfb137c795cc0875057f4410e564bc8eff03c985a2087b007fb08fc84551c7da1e8b30c7a9c3f2b14e5e44a5970236
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Oct 24, 2024
fa6e6a3 doc: Remove confusing assert linter (MarcoFalke)

Pull request description:

  The `assert()` documentation and linter are redundant and confusing:

  * The source code already refuses to compile with `assert()` disabled.
  * They violate the assumptions about `Assert()`, which *requires* side effects.
  * The existing linter doesn't enforce the guideline, only checking for `++` and `--` side effects.

  Fix all issues by removing the docs and the linter. See also bitcoin#26684 (comment)

  Going forward everyone is free to use whatever code in this regard they think is the easiest to read. Also, everyone is still free to share style-nits, if they think it is a good use of their time and of the pull request author. Finally, the author is still free to dismiss or ignore this style-nit, or any other style-nit.

ACKs for top commit:
  hebasto:
    ACK fa6e6a3, I have reviewed the code and it looks OK.
  theStack:
    ACK fa6e6a3

Tree-SHA512: 686738d71e1316cc95e5d3f71869b55a02bfb137c795cc0875057f4410e564bc8eff03c985a2087b007fb08fc84551c7da1e8b30c7a9c3f2b14e5e44a5970236
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Oct 24, 2024
fa6e6a3 doc: Remove confusing assert linter (MarcoFalke)

Pull request description:

  The `assert()` documentation and linter are redundant and confusing:

  * The source code already refuses to compile with `assert()` disabled.
  * They violate the assumptions about `Assert()`, which *requires* side effects.
  * The existing linter doesn't enforce the guideline, only checking for `++` and `--` side effects.

  Fix all issues by removing the docs and the linter. See also bitcoin#26684 (comment)

  Going forward everyone is free to use whatever code in this regard they think is the easiest to read. Also, everyone is still free to share style-nits, if they think it is a good use of their time and of the pull request author. Finally, the author is still free to dismiss or ignore this style-nit, or any other style-nit.

ACKs for top commit:
  hebasto:
    ACK fa6e6a3, I have reviewed the code and it looks OK.
  theStack:
    ACK fa6e6a3

Tree-SHA512: 686738d71e1316cc95e5d3f71869b55a02bfb137c795cc0875057f4410e564bc8eff03c985a2087b007fb08fc84551c7da1e8b30c7a9c3f2b14e5e44a5970236
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Oct 25, 2024
fa6e6a3 doc: Remove confusing assert linter (MarcoFalke)

Pull request description:

  The `assert()` documentation and linter are redundant and confusing:

  * The source code already refuses to compile with `assert()` disabled.
  * They violate the assumptions about `Assert()`, which *requires* side effects.
  * The existing linter doesn't enforce the guideline, only checking for `++` and `--` side effects.

  Fix all issues by removing the docs and the linter. See also bitcoin#26684 (comment)

  Going forward everyone is free to use whatever code in this regard they think is the easiest to read. Also, everyone is still free to share style-nits, if they think it is a good use of their time and of the pull request author. Finally, the author is still free to dismiss or ignore this style-nit, or any other style-nit.

ACKs for top commit:
  hebasto:
    ACK fa6e6a3, I have reviewed the code and it looks OK.
  theStack:
    ACK fa6e6a3

Tree-SHA512: 686738d71e1316cc95e5d3f71869b55a02bfb137c795cc0875057f4410e564bc8eff03c985a2087b007fb08fc84551c7da1e8b30c7a9c3f2b14e5e44a5970236
PastaPastaPasta added a commit to dashpay/dash that referenced this pull request Oct 25, 2024
4101fea Merge bitcoin#28304: doc: Remove confusing assert linter (fanquake)
c59cb15 Merge bitcoin#26282: wallet: have prune error take precedence over assumedvalid (fanquake)
e2e8598 Merge bitcoin#23997: wallet: avoid rescans under assumed-valid blocks (Andrew Chow)
b66eebe Merge bitcoin#25599: build: Check for std::atomic::exchange rather than std::atomic_exchange (fanquake)
1204dc0 Merge bitcoin#25486: test: fix failing test `interface_usdt_utxocache.py` (MacroFake)
de17997 Merge bitcoin#24062: refactor: replace RecursiveMutex `m_most_recent_block_mutex` with Mutex (MacroFake)
c91f010 Merge bitcoin#25092: doc: various developer notes updates (MacroFake)
f39fcd1 Merge bitcoin#24988: lint: Mention NONFATAL_UNREACHABLE in lint-assertions.py (fanquake)

Pull request description:

  ## Issue being fixed or feature implemented
  Batch of trivial backports

  ## What was done?
  See commits

  ## How Has This Been Tested?
  built locally; large combined merge passed tests locally

  ## Breaking Changes
  Should be none

  ## Checklist:
  - [ ] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  UdjinM6:
    utACK 4101fea
  kwvg:
    utACK 4101fea

Tree-SHA512: e948ff58b256f2ecb9611681f773570d233985f1470e3eaa6899f3b7e53701c06f56ed5b965d250e22764938b0afebc8d85f92879ba111a0e20127cd63e99809
@bitcoin bitcoin locked and limited conversation to collaborators Dec 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants