Skip to content

Conversation

@woodfell
Copy link
Contributor

The generated bitfield macros contains lots of integer promotion when operating on smaller data types. These can cause compiler warnings in consumers of libsbp when compiled with -Wconversion

@woodfell woodfell force-pushed the woodfell/integer_promotion branch from bffccff to 93af9c4 Compare October 20, 2021 19:47
@woodfell woodfell force-pushed the woodfell/integer_promotion branch from 93af9c4 to a17f5c8 Compare October 20, 2021 20:09
@woodfell woodfell changed the title Fix integer promotion issues in generated macros [ESD-2242] Fix integer promotion issues in generated macros Oct 20, 2021
(((flags) >> {}_SHIFT) \\
& {}_MASK)""".format(
base_string, base_string, base_string
(({})(((flags) >> {}_SHIFT) \\
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the only interesting change, everything else is generated

@woodfell woodfell merged commit fba53cc into master Nov 9, 2021
@woodfell woodfell deleted the woodfell/integer_promotion branch November 9, 2021 05:56
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.

4 participants