Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] (PR#9689) Patch: quash warnings in client/text.c
Home

[Freeciv-Dev] (PR#9689) Patch: quash warnings in client/text.c

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: bh@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#9689) Patch: quash warnings in client/text.c
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Sun, 15 Aug 2004 06:29:27 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9689 >

> [bhudson - Fri Aug 13 13:57:28 2004]:
> 
> On Thu, Aug 12, 2004 at 09:40:59PM -0700, Jason Short wrote:
> > <URL: http://rt.freeciv.org/Ticket/Display.html?id=9689 >
> > > Another alternative is to cast the size_t values as integers.  This
> > > _may_ be more portable since I'm not sure if %lu is guaranteed to
be the
> > > same as size_t on all platforms.  I looked at the printf manual
once and
> > > it claimed a special character for size_t (like %lz or something), but
> > > when I looked deeper I found this is not portable at all.
> > 
> > Here's a patch that does that.  Would it be better this way?
> 
> Probably a better idea, indeed ; and I've seen the idiom elsewhere in
> freeciv code so we could just call the the One True Freeciv Way.

size_t is usually the size of of a pointer. %zu/%zd is C99.

But casting to unsigned long is also ok.



[Prev in Thread] Current Thread [Next in Thread]