Re: [PATCH] Adjust printf(3) formats for 32-bit platforms
Grant Erickson <[email protected]> Mon, 28 Jul 2025 15:37:59 -0700
| Newsgroups | dev.linux.lists.connman |
|---|---|
| Message-ID | <[email protected]> |
On Jul 21, 2025, at 7:17 AM, Łukasz Stelmach <[email protected]> wrote > On 32-bit platforms time_t may be defined as long long int to make it > 64-bit wide and y2038 compatible. On 64-bit platform with LP64 data model > ABI long long is also 64-bit, so it is convenient and safe to always > cast time_t to long long and use %lld/%llu format on all platforms. Łukasz: Had you considered using the mnemonics in inttypes.h to avoid the cast such as: selection_str = g_strdup_printf("%s:%” PRId64 "", device->last_user_selection_ident, device->last_user_selection_time) Best, Grant -- Principal Nuovations [email protected] https://www.nuovations.com/