<p> Attention is currently required from: Sebastian Kemper. </p>
<p>Sebastian Kemper <strong>uploaded patch set #3</strong> to this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/16621">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">time: add support for time64 libc<br><br>libcs are implementing changes to fix the year 2038 issue on 32 bit<br>platforms (see [1]). musl libc already went ahead and implemented it,<br>starting with musl-1.2.0 (see [2]).<br><br>Running asterisk on a 32 bit box with a time64 libc causes some<br>problems. For instance registering to pjsip doesn't work. The<br>registration completes fine, but the AOR disappears immediately, making<br>the registered clients unreachable.<br><br>This commit adds two new definitions to include/asterisk/time.h:<br><br>TIME_T_INT_FMT<br>TIME_T_UINT_FMT<br><br>If __USE_TIME_BITS64 is defined (by a time64 libc, see [1]), they're set<br>to the proper conversions for type int64_t, PRId64 and PRIu64<br>respectively. If __USE_TIME_BITS64 is not defined, the status quo<br>remains unchanged ("%ld" and "%lu" are used).<br><br>The new definitions are used in the different parts of asterisk, where<br>appropriate.<br><br>These changes get rid of the new warnings that appeared with musl-1.2.0 and<br>make the pjsip registration work again. Below an example warning:<br><br>In file included from ../include/asterisk.h:23,<br>                 from res_pjsip/location.c:19:<br>res_pjsip/location.c: In function 'expiration_struct2str':<br>../include/asterisk/astmm.h:270:72: warning: format '%ld' expects argument of type 'long int', but argument 6 has type 'time_t' {aka 'long long int'} [-Wformat=]<br>  270 |         __ast_asprintf(__FILE__, __LINE__, __PRETTY_FUNCTION__, (ret), (fmt), __VA_ARGS__)<br>      |                                                                        ^~~~~<br>res_pjsip/location.c:492:17: note: in expansion of macro 'ast_asprintf'<br>  492 |         return (ast_asprintf(buf, "%ld", contact->expiration_time.tv_sec) < 0) ? -1 : 0;<br>      |                 ^~~~~~~~~~~~<br><br>[1] https://sourceware.org/glibc/wiki/Y2038ProofnessDesign<br>[2] https://musl.libc.org/time64.html<br><br>ASTERISK-29674 #close<br><br>Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net><br>Change-Id: Ic8d61b26033f5c486b917e738c9608b0923a844e<br>---<br>M include/asterisk/time.h<br>M res/res_calendar_caldav.c<br>M res/res_calendar_icalendar.c<br>M res/res_http_media_cache.c<br>M res/res_odbc.c<br>M res/res_pjsip/location.c<br>M res/res_pjsip/pjsip_options.c<br>M res/res_pjsip_history.c<br>M res/res_pjsip_pubsub.c<br>M res/res_pjsip_registrar.c<br>M res/res_stir_shaken.c<br>11 files changed, 32 insertions(+), 16 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/21/16621/3</pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16621">change 16621</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/16621"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ic8d61b26033f5c486b917e738c9608b0923a844e </div>
<div style="display:none"> Gerrit-Change-Number: 16621 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Sebastian Kemper <sebastian_ml@gmx.net> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Attention: Sebastian Kemper <sebastian_ml@gmx.net> </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>