From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 2 18:06:05 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D43EC55E for ; Sun, 2 Nov 2014 18:06:05 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4465B for ; Sun, 2 Nov 2014 18:06:05 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XkzXP-00011n-VL; Sun, 02 Nov 2014 18:06:04 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id sA2I62mo089981; Sun, 2 Nov 2014 11:06:02 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/mBTL9N6GPooLdnOwcY1Pi X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: how to kernel printf a int64_t? From: Ian Lepore To: Poul-Henning Kamp In-Reply-To: <7917.1414951219@critter.freebsd.dk> References: <439339249.2551223.1414702876172.JavaMail.root@uoguelph.ca> <97A82163-E78D-457E-B649-B243B41A6C6F@kientzle.com> <54558778.7050500@freebsd.org> <20141102114614.38aa9034@akips.com> <3E8C7E0D-5858-4BFF-8C09-FAA68200B988@kientzle.com> <7917.1414951219@critter.freebsd.dk> Content-Type: text/plain; charset="us-ascii" Date: Sun, 02 Nov 2014 11:06:02 -0700 Message-ID: <1414951562.1200.1.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Paul Koch , Freebsd hackers list X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 18:06:05 -0000 On Sun, 2014-11-02 at 18:00 +0000, Poul-Henning Kamp wrote: > -------- > > >> We've always used the PRIxxx types when coding for both 32/64 platforms, > >> but it would have been really nice to have a standard way for time_t. > >> Something like PRItt > > That road leads to madness, because now both the reader and the writer > needs to remember what the PRIxx is for inode_t, socklen_t and so on. > > In no time you've run out of 'xx' and some camelCaseContrarian will > start using PRI_inode_t "for readability" and... ARGH! > > Casting to [u]intmax_t and using %j is horrible, but not nearly as > horrible as any other currently available option. > > The *right* solution, could only exist if ISO-C had consisted of > actual C programmers: A varargs definition which transferred both > argument and it's type, so that printf wouldn't need any size > integers at all, but could tell by itself. > > The resulting increase in code safety and robustness alone would > make this worth the effort to implement. > VAX/VMS pass-by-descriptor comes back to life in the 21st century! -- Ian