From owner-freebsd-hackers@FreeBSD.ORG Sun Jun 5 21:24:07 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C5981065672 for ; Sun, 5 Jun 2011 21:24:07 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 0F7218FC15 for ; Sun, 5 Jun 2011 21:24:06 +0000 (UTC) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id E56D15E31; Sun, 5 Jun 2011 21:24:05 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.4/8.14.4) with ESMTP id p55LO5NN012619; Sun, 5 Jun 2011 21:24:05 GMT (envelope-from phk@critter.freebsd.dk) To: Ben Laurie From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sun, 05 Jun 2011 22:11:03 +0100." <4DEBF0E7.3040304@links.org> Content-Type: text/plain; charset=ISO-8859-1 Date: Sun, 05 Jun 2011 21:24:05 +0000 Message-ID: <12618.1307309045@critter.freebsd.dk> Sender: phk@critter.freebsd.dk X-Mailman-Approved-At: Sun, 05 Jun 2011 21:31:47 +0000 Cc: hackers@freebsd.org Subject: Re: int64_t and printf X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2011 21:24:07 -0000 In message <4DEBF0E7.3040304@links.org>, Ben Laurie writes: >I note that you didn't react to my other wherein you cast from known >type A to known type B. I supposed it would be smart to also assert that >the cast was non-narrowing. Well, if casting to intmax_t is narrowing I think I have bigger problems on my hands :-) I've spent a fair amount of time agonizing over this in Varnish and I came to the conclusion that the my time spent trying to establish if something narrower than intmax_t was safe would never amortize the performance difference of printing an intmax_t vs. intN_t, so now I just cast anything that that's typedef'ed to intmax_t and move on. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.