From owner-freebsd-questions@FreeBSD.ORG Thu Oct 25 05:55:44 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 120D016A417 for ; Thu, 25 Oct 2007 05:55:44 +0000 (UTC) (envelope-from jrisom@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.179]) by mx1.freebsd.org (Postfix) with ESMTP id 7F45213C4BE for ; Thu, 25 Oct 2007 05:55:43 +0000 (UTC) (envelope-from jrisom@gmail.com) Received: by py-out-1112.google.com with SMTP id u77so590477pyb for ; Wed, 24 Oct 2007 22:55:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:in-reply-to:references:mime-version:content-type:message-id:content-transfer-encoding:cc:from:subject:date:to:x-mailer; bh=RSUmkSzge21OH9qo2dlk3lCNiu/Dk2jS9bow3R7OoG0=; b=I2sK1gHc+OQnrveSfdAXdIIOo9Cv9a3k9bXS+BiPNlam2EHXUaqXiueeP+dbb0K/9BDQEt53rljyoDqMo4gTvyy8jtMKgRZJizpxPGEh6F+RlgwC72PKmm/LYwxl2q+y0kzUahFe37Y4bXwoQuu8EHdFPqb6MkdB4MvmsOOcPJk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:in-reply-to:references:mime-version:content-type:message-id:content-transfer-encoding:cc:from:subject:date:to:x-mailer; b=XmLJpriWiLKReUEkUXUypnxXYzRciNZvXT9rnOJPtLMpGaRWExHxDZKS/T2g382NaW7zluxcPLbL0Qn1dMW0CmkNTW5YwT/ZuawdaIvJ1Ym56ypfIRp9AHL5Z2EQBcIpIabHn577qkAB/pgZTvk6UtHSKCDZiGuXFlZhPpPDiqo= Received: by 10.35.10.13 with SMTP id n13mr1657492pyi.1193291742677; Wed, 24 Oct 2007 22:55:42 -0700 (PDT) Received: from ?192.168.1.4? ( [74.134.230.123]) by mx.google.com with ESMTPS id f6sm2979889pyh.2007.10.24.22.55.40 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 24 Oct 2007 22:55:41 -0700 (PDT) In-Reply-To: <471FF7E2.3010004@gmail.com> References: <471FAFD4.5090500@gmail.com> <20071025022632.72fd6283@gumby.homeunix.com.> <471FF7E2.3010004@gmail.com> Mime-Version: 1.0 (Apple Message framework v624) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <36110e69e0c1fe9e49f742597d6a85a2@gmail.com> Content-Transfer-Encoding: 7bit From: Joshua Isom Date: Thu, 25 Oct 2007 00:55:54 -0500 To: "Aryeh M. Friedman" X-Mailer: Apple Mail (2.624) Cc: RW , freebsd-questions@freebsd.org Subject: Re: forcing compilation/run time linking of lib32 on amd64 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2007 05:55:44 -0000 On Oct 24, 2007, at 8:56 PM, Aryeh M. Friedman wrote: > RW wrote: >> On Wed, 24 Oct 2007 16:49:24 -0400 >> "Aryeh M. Friedman" wrote: >> >> >>> I am writing some demo code (for teaching C) ... showing that >>> int's are always word length >>> >> >> s/always/typically/ >> >> C has been around for a long time and there is always a >> counter-example >> to any sweeping generalisation that isn't backed-up by a standards >> document. > > BTW I was slightly wrong it is longs not int's that change depending on > word size: > > Script started on Wed Oct 24 19:51:44 2007 > Just remember this, char <= short <= int <= long. Anything else can be anything. Saying that an int is always four bytes is like saying an int is the same size as a pointer, both of which are assumptions that are often taken but are very wrong. A lot of what decides the sizes of ints is more compiler implementer than anything else. Depending on your system, you'd want your 36 bit ints instead of being limited to only 32. But if you don't care about portability, then an int is always 32 bits and it's always in little endian order.