-
Notifications
You must be signed in to change notification settings - Fork 267
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
Define YYJSON_DISABLE_UTILS makes symbol not found #177
Comments
(btw, I found another warning when use yyjson_inline_api as yyjson_api:
) |
The first warning happens because the definition of The original code is like this, and it's fine: extern void foo(void);
static inline void bar(void) {
foo();
} But when you static void foo(void);
static inline void bar(void) {
foo();
} The second warning comes from including In yyjson.c, But if you compile yyjson.c with your code in one unit and don't use a custom allocator, GCC will perform constant propagation and inline alc.realloc() to libc's realloc(), which causes the warning. Could you share more about why you're using the library this way? |
I'm just trying to make a single DLL module on windows for Lua, in this way unused functions are stripped from the result binary, and all routes are inlined for better performance and binary size. The first warning also makes link failure for missing symbols. It seems that what I needed is something like yyjson_static_api. The binding code is here: (Notice that all sources including Lua are amalgamated into one translation unit in one.c) |
Fixed. |
Describe the bug
I'm writing a Lua binding for yyjson, and I find if I define YYJSON_DISABLE_UTILS like this:
the link errs like this:
Your environment
The text was updated successfully, but these errors were encountered: