Page MenuHomeFreeBSD

Use %lld and %llu instead of %ld and %lu in time format
AcceptedPublic

Authored by sebastien.bini_stormshield.eu on Sep 14 2022, 3:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 8 2025, 12:07 PM
Unknown Object (File)
Sep 4 2025, 7:42 PM
Unknown Object (File)
Sep 1 2025, 12:58 AM
Unknown Object (File)
Aug 13 2025, 6:41 AM
Unknown Object (File)
Jul 23 2025, 9:15 PM
Unknown Object (File)
Jul 14 2025, 1:58 PM
Unknown Object (File)
Jul 7 2025, 6:18 AM
Unknown Object (File)
Jul 4 2025, 3:57 PM
Subscribers

Details

Reviewers
imp
Summary

On our ARMv6 products, setting the date to 2038 will make date -e return a negative time.

> date 2038-07-07
> date -e
-2132932729
>

It all comes down to libc's strftime. It uses long which are 32bit long on arm.
This causes an overflow and explains the negative value.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 47383
Build 44270: arc lint + arc unit