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

Drop __FUNCTION__ from clixon_debug() calls #476

Merged
merged 2 commits into from
Jan 11, 2024

Conversation

pprindeville
Copy link
Contributor

@pprindeville pprindeville commented Jan 11, 2024

Trying to copy what clixon_log_fn() does.

@pprindeville pprindeville force-pushed the drop-function-in-debugs branch from 2d52fb0 to 5c62d34 Compare January 11, 2024 05:30
@pprindeville
Copy link
Contributor Author

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

@olofhagsand
Copy link
Member

In what way complain?

@pprindeville
Copy link
Contributor Author

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 pprindeville force-pushed the drop-function-in-debugs branch from 5c62d34 to ab10a2d Compare January 11, 2024 15:55
@pprindeville pprindeville force-pushed the drop-function-in-debugs branch from ab10a2d to f60d657 Compare January 11, 2024 16:16
@pprindeville
Copy link
Contributor Author

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

@olofhagsand olofhagsand merged commit 9dbca0c into clicon:master Jan 11, 2024
3 checks passed
@pprindeville pprindeville deleted the drop-function-in-debugs branch January 11, 2024 16:38
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