<p dir="auto">Fix the below warning one gets when compiling siputils for a 32 bit target against a time64 libc (musl).</p>
<p dir="auto">Also fix a spelling mistake on the same line ("autdated" -> "outdated").</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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);
      |                 ^~~~~~"><pre class="notranslate"><code>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);
      |                 ^~~~~~
</code></pre></div>
<p dir="auto">Signed-off-by: Sebastian Kemper <a href="mailto:sebastian_ml@gmx.net">sebastian_ml@gmx.net</a></p>


<h4 dir="auto">Pre-Submission Checklist</h4>



<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Commit message has the format required by CONTRIBUTING guide</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Commits are split per component (core, individual modules, libs, utils, ...)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Each component has a single commit (if not, squash them into one commit)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> No commits to README files for modules (changes must be done to docbook files<br>
in <code class="notranslate">doc/</code> subfolder, the README file is autogenerated)</li>
</ul>
<h4 dir="auto">Type Of Change</h4>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Small bug fix (non-breaking change which fixes an issue)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> New feature (non-breaking change which adds new functionality)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Breaking change (fix or feature that would change existing functionality)</li>
</ul>
<h4 dir="auto">Checklist:</h4>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> PR should be backported to stable branches</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Tested changes locally</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Related to issue #XXXX (replace XXXX with an open issue number)</li>
</ul>
<h4 dir="auto">Description</h4>

<p dir="auto">Hi all,</p>
<p dir="auto">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.</p>
<p dir="auto">Kind regards,<br>
Seb</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/kamailio/kamailio/pull/3266'>https://github.com/kamailio/kamailio/pull/3266</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/kamailio/kamailio/pull/3266/commits/f32e1d9c96f6ba9df3c27178c689ccd27eabaafc" class="commit-link">f32e1d9</a>  siputils: fix time_t warning and a typo</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/kamailio/kamailio/pull/3266/files">1 file</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/kamailio/kamailio/pull/3266/files#diff-11345e64387e452156da2e5135e618e2bf66ab22f0447971d30299fbc30b6df2">src/modules/siputils/siputils.c</a>
    (2)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/kamailio/kamailio/pull/3266.patch'>https://github.com/kamailio/kamailio/pull/3266.patch</a></li>
  <li><a href='https://github.com/kamailio/kamailio/pull/3266.diff'>https://github.com/kamailio/kamailio/pull/3266.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/pull/3266">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZKH3BSM4LBRAWH2RK3WDQKFVANCNFSM6AAAAAARGMIS6A">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/ABO7UZKG7ZEQUQ2ELBHETDLWDQKFVA5CNFSM6AAAAAARGMIS6CWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHFIEWCRQ.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><kamailio/kamailio/pull/3266</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/pull/3266",
"url": "https://github.com/kamailio/kamailio/pull/3266",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>