git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Obey NO_C99_FORMAT in fast-import.c.

From
Simon 'corecode' Schubert <corecode@fs.ei.tum.de>
Date
Feb 20, 2007, 12:57 UTC
Message-ID
<45DAF02C.4020003@fs.ei.tum.de>
In-Reply-To
<17825.1171931229@lotus.CS.Berkeley.EDU>
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.
Show 8 quoted lines
> +#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   / \
Previous: Jason Riedy
Message 2 of 2 in “Obey NO_C99_FORMAT in fast-import.c.”
  1. Obey NO_C99_FORMAT in fast-import.c.Jason Riedy, Feb 20, 2007
  2. Simon 'corecode' SchubertFeb 20, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.