From owner-freebsd-arch@FreeBSD.ORG Mon Dec 12 15:49:18 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A51E616A41F for ; Mon, 12 Dec 2005 15:49:18 +0000 (GMT) (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 2DFC643D45 for ; Mon, 12 Dec 2005 15:49:18 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id 72269BC66; Mon, 12 Dec 2005 15:49:16 +0000 (UTC) To: Max Laier From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 12 Dec 2005 16:43:33 +0100." <200512121643.39236.max@love2party.net> Date: Mon, 12 Dec 2005 16:49:16 +0100 Message-ID: <2926.1134402556@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: freebsd-arch@freebsd.org Subject: Re: printf behaviour with illegal or malformed format string X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Dec 2005 15:49:18 -0000 In message <200512121643.39236.max@love2party.net>, Max Laier writes: >I agree on principle but would like to ask if we need to revisit some of the >error cases. Especially with regard to 64bit porting there are some >"artifacts" that might cause serious pain for ported applications if the >above is adopted. > >Specifically, right now the following will warn "long long int format, int64_t >arg (arg 2)" on our 64bit architectures while it is required on - at least i386 > > int64_t i = 1; > printf("%lld", i); You misunderstood me. "%lld" is a legal formatting string, my printf implementation would never object to that. I'm talking about illegal/non-sensical formatting strings like "%lhd" or even "%!!!!d" and similar. The issue you raise is valid and important, but it is not for this bikeshed ;-) Poul-Henning -- 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.