Coding standards for 32/64-bits data

Bron Gondwana brong at fastmail.fm
Fri Jul 1 01:57:01 EDT 2011


On Fri, Jul 01, 2011 at 10:46:05AM +0900, OBATA Akio wrote:
> I want to clear following issue before NetBSD-6.0 release.
>   http://gnats.netbsd.org/44275
> 
> Then, workaround until 32-bits time_t overflow is "cast to `unsigned long'"
> time_t data to pass snprintf with "%lu" format?
> 
> I can find it in imap/mailbox.c and imap/sync_client.c.
> (other issues are not discovered for me at the moment).

I'm happy for you to do that.

brong at launde:/extra/src/git/cmu/cyrus-imapd$ ack time_t | wc -l
276

It looks like there's a maximum of 300 places that times are
defined.

Should we cast them to (unsigned long long) and then print them
with %llu?  That way we're 64 bit safe in a few more places!

Bron.


More information about the Cyrus-devel mailing list