Fix the below warning one gets when compiling siputils for a 32 bit target against a time64 libc (musl).

Also fix a spelling mistake on the same line ("autdated" -> "outdated").

siputils.c: In function 'ki_hdr_date_check':
../../core/parser/../dprint.h:321:73: warning: format '%ld' expects argument of type 'long int', but argument 11 has type 'time_t' {aka 'long long int'} [-Wformat=]
  321 |                                                         fprintf(stderr, "%2d(%d) %s: %.*s%s%s%s" fmt, \
      |                                                                         ^~~~~~~~~~~~~~~~~~~~~~~~
../../core/parser/../dprint.h:345:25: note: in expansion of macro 'LOG_FX'
  345 |                         LOG_FX(facility, level, lname, prefix, _FUNC_NAME_, fmt, ## args)
      |                         ^~~~~~
../../core/parser/../dprint.h:351:25: note: in expansion of macro 'LOG_FL'
  351 |                         LOG_FL(facility, level, NULL, prefix, fmt, ## args)
      |                         ^~~~~~
../../core/parser/../dprint.h:354:25: note: in expansion of macro 'LOG_FP'
  354 |                         LOG_FP(DEFAULT_FACILITY, (level), LOC_INFO, fmt, ## args)
      |                         ^~~~~~
../../core/parser/../dprint.h:392:37: note: in expansion of macro 'LOG'
  392 | #       define ERR(fmt, args...)    LOG(L_ERR,    fmt , ## args)
      |                                     ^~~
../../core/parser/../dprint.h:418:16: note: in expansion of macro 'ERR'
  418 | #define LM_ERR ERR
      |                ^~~
siputils.c:562:17: note: in expansion of macro 'LM_ERR'
  562 |                 LM_ERR("autdated date header value (%ld sec)\n", tnow - tmsg + tdiff);
      |                 ^~~~~~

Signed-off-by: Sebastian Kemper sebastian_ml@gmx.net

Pre-Submission Checklist

Type Of Change

Checklist:

Description

Hi all,

I ticked "Tested changes locally" because I ran kamailio with siputils module loaded, but I wouldn't know how to trigger the exact code path to end up with the error message I updated. But the compile warning goes away with this change and the same mechanism for time_t format handling is used elsewhere in kamailio already.

Kind regards,
Seb


You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/3266

Commit Summary

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <kamailio/kamailio/pull/3266@github.com>