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

Resolve "narrowing conversion from unsigned int ..." warnings #168

Open
Scottapotamas opened this issue Aug 29, 2019 · 0 comments
Open

Resolve "narrowing conversion from unsigned int ..." warnings #168

Scottapotamas opened this issue Aug 29, 2019 · 0 comments
Assignees
Labels

Comments

@Scottapotamas
Copy link
Collaborator

CLang Tidy warns many times per file about "narrowing conversion from unsigned int to int is implementation-defined".

This is mostly seen where an unsigned bitfield is used for error handling, and is assigned with enum values. Enum values default to signed int apparently.

There doesn't appear to be a legal cross-platform C90/C99 way to make enums unsigned, so we're left with defines or standard const integer defines. Could also rethink the use of a bitfield entirely, though dot-notation syntactically preferred to manually masking.

@Scottapotamas Scottapotamas self-assigned this Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant