-
Notifications
You must be signed in to change notification settings - Fork 757
Keep radix for integer literals in generated bindings #3237
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
base: main
Are you sure you want to change the base?
Conversation
8f8d206
to
7054e0f
Compare
I have now included additional testing to the PR. Regarding the 13 failing existing tests: It seems that the differences are due to bindgen now generating, as intended, Rust literals using hexadecimal representation, while the values themselves have correctly stayed the same. Should I fix the expected code accordingly? |
The test I added was changed to use C++14 instead of C23, as it seems that the latter is not available for clang 9.0, which IIUC is used in the CI. I have changed the expected side of the previously failing existing tests. Those changes are currently included in a separate commit in case that makes review less cumbersome. I will squash it later as instructed in the contribution guidelines. |
9064c00
to
2733cf6
Compare
I have made the solution a lot more robust and included further unit testing. r? @emilio |
Use the different radix literals for integers that were used in the original C and C++ header files, now that it is supported. The new values were confirmed by hand to be the same as the original ones - they are just represented using the Rust equivalent of the original form.
The radices of integer literals in the input C/C++ code are retained in the generated bindings.
Fixes #3236.