-
Notifications
You must be signed in to change notification settings - Fork 386
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
Fix the windows build by fixing printf related issues #641
Conversation
This PR seems to work fine with MinGW build, from github action and from my local build. My local build.
|
On the other hand, I can not reproduce the issue with git main either. |
It's a compiler issue:
It seems like they turned on |
UINT CollectionType : 8; | ||
UINT IsAlias : 1; | ||
UINT Reserved : 23; |
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.
revert - this may change binary compatibility
any particular reason for this change?
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.
this is a part of reverce-engineered implementation of internal HID structures
unless there is an explicit statement in MS documentation that ULONG is an alias for UINT in all cases - we can't change it
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.
I also allows to revert 98ab22a ( Suppress Visual C++ warning C4214: nonstandard extension used: bit field types other than int) -> https://github.com/cmorty/hidapi/actions/runs/6891832863
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.
my last statement stands
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.
We shouldn't change these, as these are the same types as in the public headers from Microsoft. Using exactly the same is the safest way to keep the binary compatibility.
And binary compatibility of these structs is not covered by our unit tests.
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.
lets revert then
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.
Ok, I learned something and hate C/C++ even more. :-( https://godbolt.org/z/9on94frPz
Based on that using UINT seems even more reasonable, but MS's public headers are the killer argument here. I'll drop the commit.
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.
OK. I reassured my pedantic me by adding a static_assert
. I hope that solution is fine with you.
ULONG and bitfields are not well defined and behave differently on different compilers. Thus make sure the struct hid_pp_link_collection_node_ has the correct size.
This merge-request removes the need for
in mingw. It also turns on
-Wformat-signedness
for GNU-compatible compilers.This fixes #632