Skip to content

Comments

Fix build on 32-bit with 64-bit time_t#136

Merged
ssahani merged 1 commit intosystemd:mainfrom
cgzones:32bit
Feb 13, 2025
Merged

Fix build on 32-bit with 64-bit time_t#136
ssahani merged 1 commit intosystemd:mainfrom
cgzones:32bit

Conversation

@cgzones
Copy link
Contributor

@cgzones cgzones commented Feb 12, 2025

gcc reports:

../src/netlog/netlog-protocol.c: In function ‘format_rfc3339_timestamp’:
../src/netlog/netlog-protocol.c:72:62: error: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘__suseconds64_t’ {aka ‘long long int’} [-Werror=format=]
   72 |                 r = snprintf(header_time, header_size, ".%06ld", tv->tv_usec);
      |                                                          ~~~~^   ~~~~~~~~~~~
      |                                                              |     |
      |                                                              |     __suseconds64_t {aka long long int}
      |                                                              long int
      |                                                          %06lld

gcc reports:

    ../src/netlog/netlog-protocol.c: In function ‘format_rfc3339_timestamp’:
    ../src/netlog/netlog-protocol.c:72:62: error: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘__suseconds64_t’ {aka ‘long long int’} [-Werror=format=]
       72 |                 r = snprintf(header_time, header_size, ".%06ld", tv->tv_usec);
          |                                                          ~~~~^   ~~~~~~~~~~~
          |                                                              |     |
          |                                                              |     __suseconds64_t {aka long long int}
          |                                                              long int
          |                                                          %06lld
@ssahani ssahani merged commit f119758 into systemd:main Feb 13, 2025
1 check passed
@cgzones cgzones deleted the 32bit branch February 14, 2025 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants