Skip to content
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

shared: fix incompatible function warnings in plugin loader #714

Closed
wants to merge 1 commit into from

Conversation

floppym
Copy link
Contributor

@floppym floppym commented May 31, 2024

Declare a more specific function pointer type to be punned through a union. Fixes this warning:

[73/206] Compiling C object src/openrc/openrc.p/.._shared_plugin.c.o
../src/shared/plugin.c: In function ‘rc_plugin_load’:
../src/shared/plugin.c:94:24: warning: cast between incompatible function types from ‘dlfunc_t’ {aka ‘void (*)(struct __dlfunc_arg)’} to ‘int (*)(RC_HOOK,  const char *)’ [-Wcast-function-type]
   94 |                 fptr = (int (*)(RC_HOOK, const char *))
      |                        ^

Declare a more specific function pointer type to be punned through a
union. Fixes this warning:

```
[73/206] Compiling C object src/openrc/openrc.p/.._shared_plugin.c.o
../src/shared/plugin.c: In function ‘rc_plugin_load’:
../src/shared/plugin.c:94:24: warning: cast between incompatible function types from ‘dlfunc_t’ {aka ‘void (*)(struct __dlfunc_arg)’} to ‘int (*)(RC_HOOK,  const char *)’ [-Wcast-function-type]
   94 |                 fptr = (int (*)(RC_HOOK, const char *))
      |                        ^
```

Signed-off-by: Mike Gilbert <[email protected]>
@navi-desu
Copy link
Member

fixed in a75b9dc, closing

thanks still!

@navi-desu navi-desu closed this Jul 23, 2024
@floppym
Copy link
Contributor Author

floppym commented Jul 23, 2024

Looks good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants