From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6082 invoked by alias); 21 Oct 2002 10:12:54 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 6075 invoked from network); 21 Oct 2002 10:12:53 -0000 Received: from unknown (HELO mail.enyo.de) (212.9.189.162) by sources.redhat.com with SMTP; 21 Oct 2002 10:12:53 -0000 Received: from [212.9.189.171] (helo=deneb.enyo.de) by mail.enyo.de with esmtp (Exim 3.34 #2) id 183ZY9-0006Pp-00; Mon, 21 Oct 2002 12:12:41 +0200 Received: from fw by deneb.enyo.de with local (Exim 3.34 #4) id 183ZYF-0000PI-00; Mon, 21 Oct 2002 12:12:47 +0200 To: "Joshua Nye" Cc: "Steve Dondley" , Subject: Re: Avoiding "assignment from incompatible pointer type" warning References: <000d01c272d5$85368b20$0100a8c0@windows9q3yn19> <87adlidm9l.fsf@deneb.enyo.de> <001801c27478$0ee5e480$c800a8c0@pdc1.boxcarmedia.com> From: Florian Weimer Mail-Followup-To: "Joshua Nye" , "Steve Dondley" , Date: Mon, 21 Oct 2002 03:12:00 -0000 In-Reply-To: <001801c27478$0ee5e480$c800a8c0@pdc1.boxcarmedia.com> ("Joshua Nye"'s message of "Tue, 15 Oct 2002 14:24:10 -0400") Message-ID: <87r8ekumlc.fsf@deneb.enyo.de> User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i686-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-10/txt/msg00232.txt.bz2 "Joshua Nye" writes: >> > int *p; >> > float g = 3.141592653589793238; >> > p = (int *)&g; >> >> Is this code legal? I doubt it. >> > > What do you consider legal and why wouldn't it be? Casting a pointer from float to int can result in undefined behavior on some implementations.