troglobit / finit-plugins

Plugin Repository for Finit
https://github.com/troglobit/finit
MIT License
4 stars 1 forks source link

warnings during compile #2

Closed hongkongkiwi closed 1 year ago

hongkongkiwi commented 1 year ago

When building, I'm getting these warnings.... anyway I can clear it up?

  CC       chronyd.lo
chronyd.c: In function ‘setup’:
chronyd.c:61:3: warning: implicit declaration of function ‘_d’ [-Wimplicit-function-declaration]
   61 |   _d("Skipping %s plugin in rescue mode.", __FILE__);
      |   ^~
chronyd.c:88:3: warning: implicit declaration of function ‘_pe’ [-Wimplicit-function-declaration]
   88 |   _pe("Failed registering %s", CHRONYD_DAEMON);
      |   ^~~
  CCLD     chronyd.la
  CC       qmi-proxy.lo
qmi-proxy.c: In function ‘setup’:
qmi-proxy.c:61:3: warning: implicit declaration of function ‘_d’ [-Wimplicit-function-declaration]
   61 |   _d("Skipping %s plugin in rescue mode.", __FILE__);
      |   ^~
qmi-proxy.c:80:3: warning: implicit declaration of function ‘_pe’ [-Wimplicit-function-declaration]
   80 |   _pe("Failed registering %s", QMI_PROXY_DAEMON);
      |   ^~~
  CCLD     qmi-proxy.la
  CC       co6-dev2mqtt-notify.lo
troglobit commented 1 year ago

Ah, thanks! I've been playing around with a new API and some refactoring for the (still not in development) notify support. Obviously I forgot to test with the plugins repo -- I'll see what I can do about fixing that later today.

hongkongkiwi commented 1 year ago

Any quick fix here? I was unclear exactly why this happens, even if I include log.h in each plugin.

It's not just a warning, it causes the plugin to crash.

troglobit commented 1 year ago

Just reproduced this last night before clocking out. I'll see if I can squeeze something in today.

hongkongkiwi commented 1 year ago

Any simple solution for this?

troglobit commented 1 year ago

The solution is to move to dbg() and err() for the external plugins and to define __FINIT__ in the Makefile, but I got stuck on troglobit/finit#307 where everything was broken.

I'll push the stuff for finit-plugins that I have, hopefully it fixes at least this issue.

hongkongkiwi commented 1 year ago

Cheers all fixed.