clicon / clixon

YANG-based toolchain including NETCONF and RESTCONF interfaces and an interactive CLI
http://www.clicon.org/
Other
208 stars 70 forks source link

Drop __FUNCTION__ from clixon_debug() calls #476

Closed pprindeville closed 7 months ago

pprindeville commented 8 months ago

Trying to copy what clixon_log_fn() does.

pprindeville commented 8 months ago

Hmm... it's going to complain in a lot of places that the format string is empty, even though that's valid C...

olofhagsand commented 8 months ago

In what way complain?

pprindeville commented 7 months ago

In what way complain?

In file included from ../../lib/clixon/clixon.h:79,
                 from netconf_rpc.c:71:
netconf_rpc.c: In function ‘netconf_notification_cb’:
netconf_rpc.c:462:37: warning: zero-length gnu_printf format string [-Wformat-zero-length]
  462 |     clixon_debug(CLIXON_DBG_CLIENT, "");
      |                                     ^~
../../lib/clixon/clixon_debug.h:68:97: note: in definition of macro ‘clixon_debug’
   68 | #define clixon_debug(l, _fmt, args...) clixon_debug_fn(NULL, __FUNCTION__, __LINE__, (l), NULL, _fmt, ##args)
      |                                                                                                 ^~~~
pprindeville commented 7 months ago

Okay, fixed the warnings by using _Pragma() expansions as part of the macro.