Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 04 Jun 2001 09:22:46 +0200
From:      Sheldon Hearn <sheldonh@starjuice.net>
To:        Dima Dorfman <dima@unixfreak.org>
Cc:        audit@freebsd.org
Subject:   Re: cut(1) WARNS patch 
Message-ID:  <9970.991639366@axl.seasidesoftware.co.za>
In-Reply-To: Your message of "Fri, 01 Jun 2001 23:40:44 MST." <20010602064044.AD9263E32@bazooka.unixfreak.org> 

next in thread | previous in thread | raw e-mail | index | archive | help


On Fri, 01 Jun 2001 23:40:44 MST, Dima Dorfman wrote:

> It's rather trivial, but I'd like someone to confirm that the first
> change is correct.  'stop' is a size_t, which is long on the Alpha but
> int on the i386.  The fix below to print it using %ld and cast it to
> long seems to be logically correct (and it works).

I've never found a graceful solution for printing integral types
of varying bit width using printf.

Something that _does_ work is to use a SIZE_T_FMT that's either "%d" or
"%ld" conditional on the bit width of size_t.  Of course, this gets
clumsy unless you're prepared to use ANSI C string concatenation.

Ciao,
Sheldon.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9970.991639366>