-
Notifications
You must be signed in to change notification settings - Fork 786
Precise macro value type #3323
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?
Precise macro value type #3323
Conversation
4d459ec to
a10ba8a
Compare
|
Apparently the clang fallback has race condition. If I set thread number to 1, we don't have truncated output anymore. |
|
I have a theory about the test setup leading to the racing. The test setup uses the fallback translation unit backed by a file, which is located in Update: yes, the two tests are racing on writing into the precompiled header. |
4d04b3a to
2de8281
Compare
|
r? @emilio 🙏 |
emilio
left a comment
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.
Looks good, some (optional) nits.
dingxiangfei2009
left a comment
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.
Are there any outstanding concerns about this PR?
2de8281 to
52d05ca
Compare
Upon activating the `--macro-const-use-ctypes` flag, `bindgen` should generate bindings with precise type resolution to the exact C types. This flag implies `--clang-macro-fallback` as its pre-requisite. Signed-off-by: Xiangfei Ding <dingxiangfei2009@protonmail.ch>
52d05ca to
71f212b
Compare
Fix #923.
Fix #3200. This is due to a fallout from how
libclangtype would be processed with this patch.This patch introduce a new generator flag
--macro-const-use-ctypes, which resolves the macro definition expression to a precise type advised by Clang if activated.A macro expansion result adapter is introduced to maintain compatibility with
cexpr, which has a limited capacity to resolve to a precise C type.There is a change to the testing code because up to this point our tests, which can be executed concurrently, use the same path to the precomputed headers. Since this patch introduces a second test that relies on
libclangmacro fallback, the precompiled headers from the two different tests would overwrite each other. The new addition is that the backing files are now temporarily stored at different directories named after the header files under tests.