From owner-svn-src-all@FreeBSD.ORG Sun Dec 18 08:14:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68F1D106566B; Sun, 18 Dec 2011 08:14:19 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 99E908FC12; Sun, 18 Dec 2011 08:14:18 +0000 (UTC) Received: from c211-28-227-231.carlnfd1.nsw.optusnet.com.au (c211-28-227-231.carlnfd1.nsw.optusnet.com.au [211.28.227.231]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id pBI8EFmp007987 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 18 Dec 2011 19:14:16 +1100 Date: Sun, 18 Dec 2011 19:14:15 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Dimitry Andric In-Reply-To: <4EED2D66.3000304@FreeBSD.org> Message-ID: <20111218184908.H1383@besplex.bde.org> References: <201112171314.pBHDEjtQ060509@svn.freebsd.org> <4EED0F99.2020306@FreeBSD.org> <4EED2D66.3000304@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, mdf@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r228625 - head/usr.bin/csup X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Dec 2011 08:14:19 -0000 On Sun, 18 Dec 2011, Dimitry Andric wrote: > On 2011-12-18 00:49, mdf@FreeBSD.org wrote: > ... >> Also, long long is a bit of a hack that came in before C99 >> standardized on a few wider types, and the PRIu64 macros are really >> hideous. > > I agree they're ugly, but C99 should simply have defined length > modifiers for int64_t and friends, then the PRI macros could have been > avoided. (Although not without backwards compatibility problems, but > you would have those anyway. :) Length modifiers for everything would have required more compiler and library support, and more excessive invention of new interfaces, and are almost as bad as PRI* anyway. Both require the programmer to know the type of a foo_t and hard-code this into the printf format. A good way would be %I or %\DWIM which is replaced in the string literal by the appropriate length modifier. (The compiler knows the correct length modifier after doing the same analysis as for warning about the modifier being wrong, and only has to tell the libary instead of the programmer about this.) Something different is needed for message catalogs. I've seen propsed that variadic functions should pass type info for all args, but this would break ABIs. It also takes more space and time than translating %I to a minimal modifier (usually a single letter). Bruce