From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8277 invoked by alias); 16 May 2003 15:06:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 8232 invoked by uid 71); 16 May 2003 15:06:01 -0000 Resent-Date: 16 May 2003 15:06:01 -0000 Resent-Message-ID: <20030516150601.8231.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, razeh@yahoo.com Received: (qmail 4076 invoked by uid 48); 16 May 2003 15:04:36 -0000 Message-Id: <20030516150436.4075.qmail@sources.redhat.com> Date: Fri, 16 May 2003 15:06:00 -0000 From: razeh@yahoo.com Reply-To: razeh@yahoo.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/10818: reinterpret_cast not handled the same as (void*) X-SW-Source: 2003-05/txt/msg01848.txt.bz2 List-Id: >Number: 10818 >Category: c++ >Synopsis: reinterpret_cast not handled the same as (void*) >Confidential: no >Severity: non-critical >Priority: low >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri May 16 15:06:01 UTC 2003 >Closed-Date: >Last-Modified: >Originator: razeh@yahoo.com >Release: unknown-1.0 >Organization: >Environment: /home/host/razeh/testing$ gcc -v Reading specs from /usr/local/packages/gcc-3.3/lib/gcc-lib/sparc-sun-solaris2.8/3.3/specs Configured with: ../configure --prefix=/usr/local/packages/gcc-3.3 : (reconfigured) ../configure --prefix=/usr/local/packages/gcc-3.3 --disable-multilib Thread model: posix gcc version 3.3 /home/host/razeh/testing$ uname -a SunOS terk 5.8 Generic_108528-13 sun4u sparc SUNW,Sun-Blade-100 >Description: extern "C" { void g( void *); }; struct X { static void a() { } }; extern "C" void f() { void *a = (void*)(X::a); void *b = reinterpret_cast(X::a); void *c = reinterpret_cast(&f); } The the (void*)line compiles, while the reinterpret_cast lines generate: fp4.C:15: error: ISO C++ forbids casting between pointer-to-function and pointer-to-object fp4.C:16: error: ISO C++ forbids casting between pointer-to-function and pointer-to-object I would expect all three lines to fail. >How-To-Repeat: Compile the file. >Fix: >Release-Note: >Audit-Trail: >Unformatted: