Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!69.16.185.16.MISMATCH!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe08.iad.POSTED!00000000!not-for-mail Newsgroups: comp.std.c Subject: Re: PRI* considered harmful User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (berkeley-unix) References: <87mxgqhk3x.fsf@once.weird.com> From: "Greg A. Woods" X-Face: .}E4CW({2'v<\JefgY&(9#RJD?~_7.KTC$+RklqwlB/<)^)~X0i*J?m)SXpHA8'9FHn5Fz*eVTH5=_C>]XK#"dLOyD`#tbEh1_8v-hwwR{.X)+b-!\4mM] 1HqG#"@VSI$1MNvRk\4>qsCclW|Ns4V/2poz=gS-+~m8\%5eVq]a\3.>T>U/f8A Message-ID: <8762ndhnfs.fsf@once.weird.com> Cancel-Lock: sha1:iOHk8jxwdqlUpNzS9u7+/pkvfF0= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Lines: 25 NNTP-Posting-Host: 24.67.98.78 X-Complaints-To: internet.abuse@sjrb.ca X-Trace: newsfe08.iad 1310068760 24.67.98.78 (Thu, 07 Jul 2011 19:59:20 UTC) NNTP-Posting-Date: Thu, 07 Jul 2011 19:59:20 UTC Date: Thu, 07 Jul 2011 12:59:19 -0700 Xref: x330-a1.tempe.blueboxinc.net comp.std.c:616 James Kuyper writes: > On 07/06/2011 10:58 PM, Greg A. Woods wrote: > ... > The type of time_t should not matter, since you've casted the value of > 't' to int32_t. You should only run into the kind of problem you're > referring to if int32_t is long, in which case PRId32 should be 'ld', > not 'd'. If it isn't, that's a non-conforming implementation of > , not a defect in the concept of the PRI* macros. Indeed, that is what one would hope, but in the draft copy of the C99 standard which I have I cannot find anything which actually says that. > The PRI* macros are clumsy and ugly, but the problem you describe isn't > one of their faults. Well I think their biggest fault is that they still require casts in all places where typedef names are used, i.e. they do not cover all standard typedef names for typedefs with base integer types. -- Greg A. Woods RoboHack living on the edge http://www.robohack.ca/