GNOME Bugzilla – Bug 707829
do not assume time_t is long
Last modified: 2013-09-21 13:34:57 UTC
Created attachment 254553 [details] [review] cast time_t printf to long long Hi. On Linux time_t is long, on OpenBSD time_t is long long... and on other OSes it can even be different. So printf statements using %lu on 32-bit platforms have a chance to break on !Linux. The only portable way to print a time_t is using a cast and casting to "long long" is probably the most portable way. Thoughts? PS: if this is alright to push I have a similar diff for e-d-s for which I will open a new BZ.
Review of attachment 254553 [details] [review]: I'd prefer gint64 since that's what GLib uses for "seconds since Unix epoch".
Created attachment 254616 [details] [review] cast time_t printf gint64 Indeed gint64 would make more sense here, thanks.
Review of attachment 254616 [details] [review]: The format string should be "%" G_GINT64_FORMAT instead of "%lld", but otherwise looks fine. Fix that and go ahead and commit. Thanks for catching that.
Thank you Matthew. It's in: 44a2cb9886223df8ee497f5ecd19123f7a3ca5ea