-
Couldn't load subscription status.
- Fork 5.2k
Fix mono's Wsingle-bit-bitfield-constant-conversion #90068
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
Conversation
|
Looks ok, but the new types should be consistent, i.e. use |
I've followed the type nearby code was preferring. e.g. jit-info.h has number of existing bitfields using guint32. |
| 1. For the special anonymous containers kept by MonoImage. | ||
| 2. When user code creates a generic parameter via SRE, but has not yet set an owner. */ | ||
| int is_anonymous : 1; | ||
| gint is_anonymous : 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@am11 these still raise the warning in main, should this have been guint?
/__w/1/s/src/mono/mono/metadata/sre.c:1626:33: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
generic_container->is_method = TRUE;
^ ~~~~
/__w/1/s/src/mono/mono/metadata/sre.c:1631:36: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
generic_container->is_anonymous = TRUE;
^ ~~~~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, yes guint is correct.
It was supposed to be fixed in dotnet#90068 but we should've used `guint` for the one-bit bitfield.
It was supposed to be fixed in #90068 but we should've used `guint` for the one-bit bitfield.
Warnings are of the form:
reported on linux-x64 build (with cc: clang 17 rc1).