-
Notifications
You must be signed in to change notification settings - Fork 614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't use %ld to portably print time_t values #1084
Comments
There is one occurence in src/view.c as well. I noticed you are using |
My patch was just intended as a quick fix for Alpine. I think using |
Noted. strftime() is really not convenient here but, as every occurrence is associated to a time delta, we could use difftime(3). |
drop patch, issue solved upstream jonas/tig#1084
Printing values of type
time_t
using the%ld
format string assumes a specifictime_t
representation which may not hold. For example, on musl libctime_t
is a 64 bit value, even on 32 bit systems thustime_t
is not along int
on 32 bit musl architectures. See the musl time64 Release Notes for more information. Currently, this causes the following compiler warning when attempting to compile tig on a 32 bit musl system:It will likely result in a wrong output on these system as well, didn't test this though.
The text was updated successfully, but these errors were encountered: