Date: Sun, 02 Nov 2014 11:06:02 -0700 From: Ian Lepore <ian@FreeBSD.org> To: Poul-Henning Kamp <phk@phk.freebsd.dk> Cc: Paul Koch <paul.koch@akips.com>, Freebsd hackers list <freebsd-hackers@freebsd.org> Subject: Re: how to kernel printf a int64_t? Message-ID: <1414951562.1200.1.camel@revolution.hippie.lan> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1414951562.1200.1.camel>