From owner-freebsd-arch Sun Jul 8 14:54:45 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 D711637B401 for ; Sun, 8 Jul 2001 14:54:41 -0700 (PDT) (envelope-from des@ofug.org) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id XAA53856; Sun, 8 Jul 2001 23:54:40 +0200 (CEST) (envelope-from des@ofug.org) 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: arch@freebsd.org Subject: Type differences From: Dag-Erling Smorgrav Date: 08 Jul 2001 23:54:40 +0200 Message-ID: Lines: 23 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 des@des /usr/src/sys% grep 'define.*BSD_SIZE_T' {i386,alpha}/include/ansi.h i386/include/ansi.h:#define _BSD_SIZE_T_ unsigned int /* sizeof() */ alpha/include/ansi.h:#define _BSD_SIZE_T_ unsigned long /* sizeof() */ des@des /usr/src/sys% grep 'define.*BSD_OFF_T' {i386,alpha}/include/ansi.h i386/include/ansi.h:#define _BSD_OFF_T_ __int64_t /* file offset */ alpha/include/ansi.h:#define _BSD_OFF_T_ long /* file offset */ What's the idea here? off_t is the exact same size and signedness on both platforms, so why not use the same definition for both? And why make size_t an int on i386 but a long on alpha, when on both these platforms int and long are identical? Also, gcc (correctly) complains about a "comparison between signed and unsigned" when you try to compare a size_t to an off_t on alpha - but doesn't complain on i386. What gives? And while we're on this subject, what's the Officially Approved way of printf()ing an off_t or a size_t so it does not generate warnings on either platform? 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