-
Notifications
You must be signed in to change notification settings - Fork 17
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
Remove whitelisting of functions #2
Conversation
This increases build speed and prevents functions that should be whitelisted to not be. Also increase bindgen version.
Thank you @NilsIrl. I'm getting a warning when running the tests:
Is it possible to prevent this without hiding it? I'll investigate too. I think the reason I didn't do it this way initially is because I was worried about it including functions from the c-standard library like |
The functions generating these warnings are:
I'll see if I can exclude stdlib and any other libraries. |
This seems to be a known issue |
These functions are indeed included It that's really a problem. These could be removed |
Changing #define _STDLIB_H 1
#include <leptonica/allheaders.h> Seems to exclude |
Actually, I'll merge it as is. The warnings don't show for dependent crates. |
I've pushed this as version 0.3.0. I'm currently updating tesseract-sys and tesseract-rs to use it. |
@NilsIrl, can you let me know one of the enums you need? I'll add a test so to make sure it doesn't get removed in future |
NilsIrl requires the enums from https://github.com/DanBloomberg/leptonica/blob/50c3c353f75b0a5c97b645b3c050dab66243ee20/src/imageio.h#L91-L112 I've added tests to make sure they don't get removed in the future. Ref: #2 (comment)
This decreases build time and prevents functions that should be
whitelisted to not be.
For example, when working on my fork of the leptess API, I didn't have access to the file format enums.
And anyway,
<leptonica/allheaders.h>
is the api. There is no reason some whitelisting should be done on top of it.Also increase bindgen version.