cyrusimap / cyrus-sasl

Other
134 stars 151 forks source link

Extend the time_t format specifiers to long long #828

Closed bgermann closed 4 months ago

bgermann commented 8 months ago

In some format strings, it is expected that time_t is the same size as long. long is 32 bit for 32 bit architectures, while time_t might be 64 bit. Extend the format string specifiers to long long, which can hold a time_t regardless of the platform and libc configuration.

Closes: #484

mistotebe commented 8 months ago

@bgermann I don't think you've responded to the review comment from @hyc?

bgermann commented 8 months ago

That is right. I have closed the previous PR because the sscanf part was wrong.

I am not going to implement the suggestion with autoconf test and macro because I do not have the time for it and I think that solution is too complex. You do not have to know the actual size of time_t to deal with it. If someone can come up with a platform example of this change being incorrect, please comment here.

This is what I have included in Debian for their time_t 64 bit transition.

quanah commented 4 months ago

Thank you very much!