-
-
Notifications
You must be signed in to change notification settings - Fork 608
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
Compare type sizes in druntime with ImportC #16571
Conversation
|
Thanks for your pull request and interest in making D better, @tim-dlang! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#16571" |
|
Some issues found with this test: |
|
Very cool! 👍 |
a247b7c
to
2e650a2
Compare
5ab80a8
to
c6596c0
Compare
Types for bindings of C libraries in druntime need to match the
C headers. Small differences can result in hard to debug problems.
This test tries to automatically find types with a wrong size.
This is done by also getting type sizes from C headers using ImportC
and comparing them. Differences between the sizes can have different reasons:
* Bugs in ImportC (e.g. for bitfields) can result in a wrong size
* Type definitions in druntime can be wrong
* Different preprocessor options could be used, like _FILE_OFFSET_BITS
* Size differences can be fine, because some structs contain a member
for the size or a version
Members of structs and unions with the same name are also compared.
For types with potential problems a comparison of the layout is printed.
The test contains a list of known problems, which are only treated as
warnings and not errors.
c6596c0
to
54dedaf
Compare
|
The test now contains a list of known problems, which are only treated as warnings and not errors. This would allow to merge the test before fixing the problems. New problems would still be found by the test. |
Types for bindings of C libraries in druntime need to match the
C headers. Small differences can result in hard to debug problems.
This test tries to automatically find types with a wrong size.
This is done by also getting type sizes from C headers using ImportC
and comparing them. Differences between the sizes can have different reasons:
* Bugs in ImportC (e.g. for bitfields) can result in a wrong size
* Type definitions in druntime can be wrong
* Different preprocessor options could be used, like _FILE_OFFSET_BITS
* Size differences can be fine, because some structs contain a member
for the size or a version
Members of structs and unions with the same name are also compared.
For types with potential problems a comparison of the layout is printed.
The test contains a list of known problems, which are only treated as
warnings and not errors.
Types for bindings of C libraries in druntime need to match the C headers. Small differences can result in hard to debug problems.
This test tries to automatically find types with a wrong size. This is done by also getting type sizes from C headers using ImportC and comparing them. Differences between the sizes can have different reasons:
Members of structs and unions with the same name are also compared. For types with potential problems a comparison of the layout is printed.