Skip to content

zmq: Fix implicit-integer-sign-change - #24218

Merged
maflcko merged 1 commit into
bitcoin:masterfrom
maflcko:2201-zmqInt
Feb 1, 2022
Merged

maflcko merged 1 commit into
bitcoin:masterfrom
maflcko:2201-zmqInt

Conversation

@maflcko

@maflcko maflcko commented Jan 31, 2022

Copy link
Copy Markdown
Member

uint256::begin() returns unsigned data, so there is no reason to make it signed.

Fix that and remove the sanitizer suppression.

@hebasto hebasto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ACK fa2406a

uint256::begin() returns unsigned data

unsigned char* begin()

Although

static_assert(std::numeric_limits<unsigned char>::digits == 8, "8-bit byte assumed");

why not just unsigned char data[32];?

@maflcko

maflcko commented Jan 31, 2022

Copy link
Copy Markdown
Member Author

why not just unsigned char data[32];?

  • It is more typing
  • It is the same (see assumptions)

@DrahtBot

Copy link
Copy Markdown
Contributor

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #23962 (Use int32_t type for transaction size/weight consistently by hebasto)
  • #17786 (refactor: Nuke policy/fees->mempool circular dependencies by hebasto)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@PastaPastaPasta PastaPastaPasta left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

utACK fa2406a, I have reviewed the code and think it makes sense

@maflcko
maflcko merged commit 36f8e99 into bitcoin:master Feb 1, 2022
@maflcko
maflcko deleted the 2201-zmqInt branch February 1, 2022 09:32
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Dec 9, 2022
Summary:
uint256::begin() returns unsigned data, so there is no reason to make it signed.

Fix that and remove the sanitizer suppression.

This is a backport of [[bitcoin/bitcoin#24218 | core#24218]]

Depends on D12817

Test Plan:
With UBSAN
`ninja && ninja check check-functional`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D12818
@bitcoin bitcoin locked and limited conversation to collaborators Feb 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants