From: Junio C Hamano <junkio@cox.net>
To: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Cc: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>,
GIT Mailing-list <git@vger.kernel.org>
Subject: Re: [PATCH 1/6] Fix some "printf format" warnings.
Date: Wed, 14 Mar 2007 16:41:52 -0700 [thread overview]
Message-ID: <7vd53b5r5r.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <45F87DC7.7020503@ramsay1.demon.co.uk> (Ramsay Jones's message of "Wed, 14 Mar 2007 22:57:11 +0000")
Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
>>> printf("%s%06"PRIo32" %s %d\t", tag, ntohl(ce->ce_mode), ...)
>>>
>>> that's the correct and allegedly portable way I guess.
I do not think this is really worth it.
printf("%s%06o %s %d\t", tag, (unsigned) ntohl(ce->ce_mode), ...
is perfectly readable for even old timers about git, as long as
they know traditional C and what ntohl() is. And ce->ce_mode
even fits in 16-bit, so while we are _not_ supporting platforms
whose unsigned int is 16-bit, the above cast is not losing any
useful precision either.
> (the symbols being: uint32_t, uint64_t, uint16_t, uintmax_t)
I think we would want these exact-sized integer types, so if
they are missing the platform ports may want to supply their own
substitute.
next prev parent reply other threads:[~2007-03-14 23:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-03 18:28 [PATCH 1/6] Fix some "printf format" warnings Ramsay Jones
2007-03-03 21:53 ` Junio C Hamano
2007-03-04 17:08 ` Ramsay Jones
2007-03-12 14:03 ` Simon 'corecode' Schubert
2007-03-12 19:40 ` Junio C Hamano
2007-03-14 22:57 ` Ramsay Jones
2007-03-14 23:41 ` Junio C Hamano [this message]
2007-03-13 22:33 ` Ramsay Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vd53b5r5r.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=corecode@fs.ei.tum.de \
--cc=git@vger.kernel.org \
--cc=ramsay@ramsay1.demon.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).