From owner-freebsd-arch Wed Oct 24 12: 8:58 2001 Delivered-To: freebsd-arch@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 4558837B407 for ; Wed, 24 Oct 2001 12:08:30 -0700 (PDT) Received: by flood.ping.uio.no (Postfix, from userid 2602) id CD55814C41; Wed, 24 Oct 2001 21:08:28 +0200 (CEST) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: Garrett Wollman Cc: arch@FreeBSD.org Subject: Re: "types" man page References: <200110241902.f9OJ2vA46197@khavrinen.lcs.mit.edu> From: Dag-Erling Smorgrav Date: 24 Oct 2001 21:08:28 +0200 In-Reply-To: <200110241902.f9OJ2vA46197@khavrinen.lcs.mit.edu> Message-ID: Lines: 35 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Garrett Wollman writes: > In article 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