[asterisk-bugs] [JIRA] (ASTERISK-29674) Adjust for 64bit time_t

Sean Bright (JIRA) noreply at issues.asterisk.org
Tue Oct 5 09:40:50 CDT 2021


    [ https://issues.asterisk.org/jira/browse/ASTERISK-29674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=256551#comment-256551 ] 

Sean Bright edited comment on ASTERISK-29674 at 10/5/21 9:40 AM:
-----------------------------------------------------------------

Update: compiling with {{-m32}} - at least with a sample program - causes the warnings to appear:

{noformat}
cc -m32    time.c   -o time
time.c: In function ‘main’:
time.c:11:17: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘time_t’ {aka ‘long long int’} [-Wformat=]
   11 |   printf("%zu %lu\n", sizeof(time_t), now);
      |               ~~^                     ~~~
      |                 |                     |
      |                 long unsigned int     time_t {aka long long int}
      |               %llu
{noformat}



was (Author: seanbright):
Update: compiling with {{-m32}} - at least with a sample program - causes the warnings to appear.

> Adjust for 64bit time_t
> -----------------------
>
>                 Key: ASTERISK-29674
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-29674
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Core/General
>    Affects Versions: 18.6.0
>            Reporter: Andre Heider
>            Assignee: Unassigned
>
> musl 1.2 switched time_t to 64bit [0].
> glibc still defaults to 32bit, but starting with v2.34 has a macro to
> swich to 64bit too.
> Use the PRId64 format specifier for time_t to work with both settings,
> fixing [2].
> [0] https://musl.libc.org/time64.html
> [1] https://sourceware.org/git/?p=glibc.git;a=tag;h=9df03063320651bc629fa427eef3ac73fabb61ba
> [2] https://github.com/openwrt/telephony/issues/690



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list