Skip to content

Conversation

@remicollet
Copy link
Collaborator

No description provided.

Payload value flags
****************************************/
#define MEMC_CREATE_MASK(start, n_bits) (((1 << n_bits) - 1) << start)
#define MEMC_CREATE_MASK(start, n_bits) (((1U << n_bits) - 1) << start)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I did a bit of reading, found a note that Coverity might interpret 1U as u_char rather than int: https://community.synopsys.com/s/article/False-positive-for-coverity-sees-1-and-1U-as-8-bit-type-variables

The fix would be to use 1UL to make it explicitly 32-bit (unsigned long)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

but 1UL is 64-bit

Copy link
Collaborator

Choose a reason for hiding this comment

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

Right, there's a part of my brain that I keep on a shelf for this

@sodabrew sodabrew merged commit 811c8a1 into master Feb 2, 2023
@sodabrew sodabrew deleted the issue-522 branch February 2, 2023 19:42
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.

3 participants