From owner-freebsd-questions@FreeBSD.ORG Thu Oct 25 02:01:07 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 3B7EF16A41B for ; Thu, 25 Oct 2007 02:01:07 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.229]) by mx1.freebsd.org (Postfix) with ESMTP id DCA7413C4B9 for ; Thu, 25 Oct 2007 02:01:06 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: by wx-out-0506.google.com with SMTP id i29so330991wxd for ; Wed, 24 Oct 2007 19:01:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; bh=0gddddXWDK3CWCDG6k+1KMRlBCYEA+x2LNYv1g2wvwY=; b=KKDzV8T0nhP0DFKUNN8ZNkfizm8D42t2DAI2kwMhVl4LCFsgI1KgbL/iSunGqQ2RxD7kNVVH3ugqnNvRvTCZhWMnFX2ZGEDC+z5jHnl/BtzKT2AgVePo9dMfDggBVMLrASd88e1FT/o/wcPHVdmlM7fCcmI6IanerQRDUdnOTzw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=qV7bRL5KcnZpvtl+qE6WpKJ7rvABQMSPG+awTlhjvknORrKs1xBBK7vSFWAwVV27opge//8o2RmHpeWUuKPAr8PsCWZyVffIyiA12/peJNydESaS5o35BsZFFusftcYGWNQNdcOXX6yivEN7/lOCuyg9umI07/N/J5vKdxolqZ0= Received: by 10.70.61.3 with SMTP id j3mr2101912wxa.1193277665733; Wed, 24 Oct 2007 19:01:05 -0700 (PDT) Received: from ?192.168.2.2? ( [67.85.89.184]) by mx.google.com with ESMTPS id c29sm2239992elf.2007.10.24.19.01.04 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 24 Oct 2007 19:01:05 -0700 (PDT) Message-ID: <471FF7E2.3010004@gmail.com> Date: Wed, 24 Oct 2007 21:56:50 -0400 From: "Aryeh M. Friedman" User-Agent: Thunderbird 2.0.0.6 (X11/20071016) MIME-Version: 1.0 To: RW References: <471FAFD4.5090500@gmail.com> <20071025022632.72fd6283@gumby.homeunix.com.> In-Reply-To: <20071025022632.72fd6283@gumby.homeunix.com.> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: 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 02:01:07 -0000 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 > cat sizes.c #include main() { printf("int:\t\t%d\n",sizeof(int)); printf("short:\t\t%d\n",sizeof(short)); printf("long:\t\t%d\n",sizeof(long)); printf("long long:\t%d\n",sizeof(long long)); printf("float:\t\t%d\n",sizeof(float)); printf("double:\t\t%d\n",sizeof(double)); printf("char:\t\t%d\n",sizeof(char)); printf("ptr:\t\t%d\n",sizeof(void *)); } > gcc sizes.c > ./a.out int: 4 short: 2 long: 8 long long: 8 float: 4 double: 8 char: 1 ptr: 8 > gcc -m32 -B/usr/lib32 -L/usr/lib32 sizes.c # See "forcing compilor/run time linking of lib32 on amd54" in freebsd-questions > ./a.out int: 4 short: 2 long: 4 long long: 8 float: 4 double: 8 char: 1 ptr: 4 Script done on Wed Oct 24 19:52:08 2007