From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12092 invoked by alias); 22 Feb 2011 19:10:00 -0000 Received: (qmail 12083 invoked by uid 22791); 22 Feb 2011 19:09:59 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-iy0-f175.google.com (HELO mail-iy0-f175.google.com) (209.85.210.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Feb 2011 19:09:53 +0000 Received: by iyb26 with SMTP id 26so2138411iyb.20 for ; Tue, 22 Feb 2011 11:09:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.42.223.65 with SMTP id ij1mr3871514icb.349.1298401791325; Tue, 22 Feb 2011 11:09:51 -0800 (PST) Received: by 10.42.229.135 with HTTP; Tue, 22 Feb 2011 11:09:51 -0800 (PST) In-Reply-To: <4D640445.1050809@andihellmund.com> References: <4D640445.1050809@andihellmund.com> Date: Tue, 22 Feb 2011 19:18:00 -0000 Message-ID: Subject: Re: why this testcase compile failed for gcc. From: Jonathan Wakely To: Andi Hellmund Cc: Ian Lance Taylor , zhang qingshan , gcc-help Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-02/txt/msg00365.txt.bz2 On 22 February 2011 18:45, Andi Hellmund wrote: > Hey >> >> The C standard does not require that a function pointer use the same >> representation as any other type of pointer. =A0In particular, on >> processors with Harvard architectures, function pointers and regular >> pointers are inherently different. >> > > @Ian: do you have a reference section where this is described. I shortly > tried to search for a few keywords in the standard, but couldn't find the > obvious. I would just be interested in the details ... 6.2.5 paragraph 26 covers representation. 6.3.2.3 paragraphs 1, 7 and 8 cover allowed conversions between pointer types. A pointer to function type cannot be converted to a pointer to object or incomplete type.