From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31534 invoked by alias); 28 Feb 2003 16:14:58 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 31527 invoked from network); 28 Feb 2003 16:14:57 -0000 Received: from unknown (HELO localhost.redhat.com) (172.16.49.200) by 172.16.49.205 with SMTP; 28 Feb 2003 16:14:57 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 403C52A9C; Fri, 28 Feb 2003 11:17:10 -0500 (EST) Message-ID: <3E5F8B86.9080902@redhat.com> Date: Fri, 28 Feb 2003 16:14:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: [commit] new observer.[hc] files References: <20030228072243.GD6112@gnat.com> <20030228152256.GB23109@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-02/txt/msg00815.txt.bz2 > static void >> observer_normal_stop_notification_stub (const void *data, >> const void *unused_args) >> { >> observer_normal_stop_ftype *notify = (observer_normal_stop_ftype *) data; >> (*notify) (); >> } > > > Is this extra indirection really necessary? Because I'm 99% sure it > won't work on several 64-bit platforms. Function pointers and data > pointers are not required to have the same size; on IA-64 I believe > that a function pointer is 128 bits and a data pointer is 64 bits. Like the PowerABI? That has a 32 bit pointer but a 64 bit function descriptor. void* ends up containing the address of the function descriptor. Anyway, "defs.h" has the comment: /* NOTE: cagney/2000-03-04: This typedef is strictly for the make_cleanup function declarations below. Do not use this typedef as a cast when passing functions into the make_cleanup() code. Instead either use a bounce function or add a wrapper function. Calling a f(char*) function with f(void*) is non-portable. */ typedef void (make_cleanup_ftype) (void *); Once the code gets converted into a SED script, it can always be changed to something more strict. > Why not require all observer functions to take the same arguments > instead? Per the original thread, it is to ensure strongly typed interfaces. Andrew