Date: 24 Oct 2001 21:08:28 +0200 From: Dag-Erling Smorgrav <des@ofug.org> To: Garrett Wollman <wollman@khavrinen.lcs.mit.edu> Cc: arch@FreeBSD.org Subject: Re: "types" man page Message-ID: <xzpn12gyhxv.fsf@flood.ping.uio.no> In-Reply-To: <200110241902.f9OJ2vA46197@khavrinen.lcs.mit.edu> References: <200110241902.f9OJ2vA46197@khavrinen.lcs.mit.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
Garrett Wollman <wollman@khavrinen.lcs.mit.edu> writes: > In article <xzp1yjt0z14.fsf@flood.ping.uio.no> you write: > > - width on all supported platforms > Probably a bad idea. Better to specify the range, rather than the > width, and do it via the appropriate limit constants, so that people > don't make unfortunate assumptions. Ah, yes, I forgot about the limit constants. I'd still like to document the width, though, but it may be more useful to just say "this is of the same width as {int,long,void *} on all platforms". > The only types which would seem > to be appropriate to specify the width are the ones which are > specified by width (i.e., int8_t et al). I think it would be useful to also document the width of the basic C types (char, short, int, long, long long, void *) on the different platforms. > > - appropriate format specifier and cast to use for printf()ing > > variables of that type portably. > This just needs to be stated once: use %jd and (intmax_t) or %ju and > (uintmax_t) as appropriate for the signedness, unless it's one of the > integral types which has a specifically-defined format (char, short, > int, long, long long, size_t, ptrdiff_t, and intmax_t). Our printf(3) man page does not mention a 'j' conversion specifier, and I don't have a copy of C99 at hand. I suppose it's a C99 thing? Does our printf(3) (and our printf(9)) support it? DES -- Dag-Erling Smorgrav - des@ofug.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzpn12gyhxv.fsf>