From: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>
To: Jason Riedy <ejr@EECS.Berkeley.EDU>
Cc: git <git@vger.kernel.org>
Subject: Re: [PATCH] Obey NO_C99_FORMAT in fast-import.c.
Date: Tue, 20 Feb 2007 13:57:16 +0100 [thread overview]
Message-ID: <45DAF02C.4020003@fs.ei.tum.de> (raw)
In-Reply-To: <17825.1171931229@lotus.CS.Berkeley.EDU>
[-- Attachment #1: Type: text/plain, Size: 1480 bytes --]
Jason Riedy wrote:
> Define UM_FMT and UM10_FMT and use in place of %ju and %10ju,
> respectively. Both format as unsigned long long, so this
> assumes the compiler supports long long.
So there are really systems which do not support the "j" (standardized) size modifier, but support "long long" (unstandardized) integers? Oh my.
> +#if !defined(NO_C99_FORMAT)
> +#define UM_FMT "%ju"
> +#define UM10_FMT "%10ju"
> +#else
> +/* Assumes unsigned long long exists. */
> +#define UM_FMT "%llu"
> +#define UM10_FMT "%10llu"
> +#endif
I think this should read something like
#ifndef PRIuMAX
#define PRIuMAX "llu" /* Assumes unsigned long long exists */
#endif
After all, these macros are standardized (<inttypes.h>)
Hunks like this should of course read differently then:
> - die("mark :%ju not declared", orig_idnum);
> + die("mark :" UM_FMT " not declared", orig_idnum);
die("mark :%"PRIuMAX" not declared", orig_idnum);
> + fprintf(stderr, "Alloc'd objects: " UM10_FMT "\n", alloc_count);
And then this UM10_FMT stunt isn't needed either:
fprintf(stderr, "Alloc'd objects: %10"PRIuMAX"\n", alloc_count);
cheers
simon
--
Serve - BSD +++ RENT this banner advert +++ ASCII Ribbon /"\
Work - Mac +++ space for low €€€ NOW!1 +++ Campaign \ /
Party Enjoy Relax | http://dragonflybsd.org Against HTML \
Dude 2c 2 the max ! http://golden-apple.biz Mail + News / \
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
next prev parent reply other threads:[~2007-02-20 12:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-20 0:27 [PATCH] Obey NO_C99_FORMAT in fast-import.c Jason Riedy
2007-02-20 12:57 ` Simon 'corecode' Schubert [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-02-20 20:17 Jason Riedy
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=45DAF02C.4020003@fs.ei.tum.de \
--to=corecode@fs.ei.tum.de \
--cc=ejr@EECS.Berkeley.EDU \
--cc=git@vger.kernel.org \
/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).