From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Kv5IF-0005PX-Af for garchives@archives.gentoo.org; Wed, 29 Oct 2008 07:16:39 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D1565E040B; Wed, 29 Oct 2008 07:16:37 +0000 (UTC) Received: from rn-out-0910.google.com (rn-out-0910.google.com [64.233.170.186]) by pigeon.gentoo.org (Postfix) with ESMTP id AF9DEE040B for ; Wed, 29 Oct 2008 07:16:37 +0000 (UTC) Received: by rn-out-0910.google.com with SMTP id m36so1872295rnd.14 for ; Wed, 29 Oct 2008 00:16:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:references:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:message-id; bh=VHIAwufzQwiGTzj7hpGvgGjymwdcoEL5BQFpHD/IELo=; b=T7H7hS0AI86m2WPaWoBkCUDLDHxeHjwHG0jQdoAtOMw5qAUD5dJoIJ/RAI4csJDXP6 E3Mgqpv1mOLcvvO8u/1shaDxAKUpDefRDRP5L8dxQ2vEuhThrMzB4KwGhr0N4HuvQpwc fN6yye+ZWxfelz0gF0O0MMS7J7fXSncrDjftc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:references:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :message-id; b=YzqWgBWlpUDX9Nplnig/gd8iSD5vzwm+99K+R/tRGK4LhWy76KmIx2mGme0GQedGEL NEt96TPxZFGUw1eHpcvJSRedcgMB+8SYkfXoHEV87sfjxLfPLJkjygYI6qWrGLsvOEvw 1DDWnBP6zyzI5s3rbOhRFkYyq1HfP72/qS14E= Received: by 10.100.41.9 with SMTP id o9mr8257253ano.49.1225264596270; Wed, 29 Oct 2008 00:16:36 -0700 (PDT) Received: from ?10.1.245.102? (dustpuppy.is.co.za [196.14.169.11]) by mx.google.com with ESMTPS id b19sm6890979ana.19.2008.10.29.00.16.33 (version=SSLv3 cipher=RC4-MD5); Wed, 29 Oct 2008 00:16:35 -0700 (PDT) From: Alan McKinnon To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] package.keywords syntax? Date: Wed, 29 Oct 2008 09:16:29 +0200 User-Agent: KMail/1.9.10 References: <200810290041.39256.alan.mckinnon@gmail.com> <38af3d670810281555j43a2c0dfl990860eb9b85921b@mail.gmail.com> In-Reply-To: <38af3d670810281555j43a2c0dfl990860eb9b85921b@mail.gmail.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200810290916.29649.alan.mckinnon@gmail.com> X-Archives-Salt: 74de1eea-9693-4285-a3b9-88dbab0f035a X-Archives-Hash: 46cfb0909321a28bcdf15b7ba4096473 On Wednesday 29 October 2008 00:55:42 Jorge Peixoto de Morais Neto wrote: > >> I mean to really know C, > >> that is, read a rigorous book such as "C: A Reference Manual" and be > >> able to write portable programs with well-defined behavior. Speaking > >> of well-defined behavior, do you know what happens when you cast a > >> float to an int, and the float is too big to fit into the int? > > > > Did oyu try it yourself and see? > > The point is that the behavior in this situation is "undefined". It > might do anything. Programming in C is different than programming in > Python. Most likely the compiler will try to treat the float as an int and use the first 4 bytes of the float, ignoring the rest. This is insane though. I cannot think of any reason why one would ever want to treat the first 32 bits of a float as an int. It's not like you are casting a long to an int which can make sense - just discard the high bits. I reckon the standard would say this is undefined. Most compiler would bomb out with a compile error but give you an obscure flag to proceed anyway. If you want to commit suicide, C is quite happy to pass you the pills as long s you ask nicely -- alan dot mckinnon at gmail dot com