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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]