From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19577 invoked by alias); 22 Oct 2003 19:11:57 -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 19570 invoked from network); 22 Oct 2003 19:11:57 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 22 Oct 2003 19:11:57 -0000 Received: from drow by nevyn.them.org with local (Exim 4.24 #1 (Debian)) id 1ACOOh-0005e4-SG; Wed, 22 Oct 2003 15:11:55 -0400 Date: Wed, 22 Oct 2003 19:11:00 -0000 From: Daniel Jacobowitz To: Andrew Cagney Cc: Jim Blandy , gdb-patches@sources.redhat.com, Kris Warkentin Subject: Re: RFA: osabi: correct test for compatible handlers Message-ID: <20031022191155.GA21635@nevyn.them.org> Mail-Followup-To: Andrew Cagney , Jim Blandy , gdb-patches@sources.redhat.com, Kris Warkentin References: <3F96D128.5040904@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F96D128.5040904@redhat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-10/txt/msg00654.txt.bz2 On Wed, Oct 22, 2003 at 02:49:12PM -0400, Andrew Cagney wrote: > >+ /* BFD's 'A->compatible (A, B)' functions return zero if A and B are > >+ incompatible. But if they are compatible, it returns the 'more > >+ featureful' of the two arches. That is, if A can run code > >+ written for B, but B can't run code written for A, then it'll > >+ return A. > >+ > >+ struct bfd_arch_info objects are atoms: that is, there's supposed > >+ to be exactly one instance for a given machine. So you can tell > >+ whether two are equivalent by comparing pointers. */ > >+ return (a == b || a->compatible (a, b) == a); > > Hey, nice. > > Don't worry about a can_run_code_for function though, having the logic > inline makes what's happening easier to understand (and will simplify a > follow-on wild-card patch I've got pending). I'm curious, what do you mean by wild-card that isn't handled by correcting various ->compatible functions? [Stylisticly I prefer the code out-of-line since the name describes the test so well.] -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer