From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16405 invoked by alias); 6 Nov 2002 22:16:22 -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 16331 invoked from network); 6 Nov 2002 22:16:19 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 6 Nov 2002 22:16:19 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id CC5243CC5; Wed, 6 Nov 2002 17:16:20 -0500 (EST) Message-ID: <3DC994B4.6050409@redhat.com> Date: Wed, 06 Nov 2002 14:16:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020824 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Alan Modra Cc: binutils@sources.redhat.com, gdb-patches@sources.redhat.com Subject: Re: bfd target lists References: <20021015205951.N22176@bubble.sa.bigpond.net.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-11/txt/msg00135.txt.bz2 > If anyone has taken a close look at the list of targets printed by > say, objdump --help, when compiled with --enable-targets=all, you > may have noticed that the default target is mentioned twice. > > This patch corrects the situation, but since this may affect gdb > I'd like some comment from the gdb camp before I commit the change. > > * targets.c (bfd_target_list): Don't return the default > target twice. > > Index: bfd/targets.c > =================================================================== > RCS file: /cvs/src/src/bfd/targets.c,v > retrieving revision 1.78 > diff -u -p -r1.78 targets.c > --- bfd/targets.c 9 Oct 2002 19:03:57 -0000 1.78 > +++ bfd/targets.c 15 Oct 2002 07:24:00 -0000 > @@ -1279,7 +1279,9 @@ bfd_target_list () > return NULL; > > for (target = &bfd_target_vector[0]; *target != NULL; target++) > - *(name_ptr++) = (*target)->name; > + if (target == &bfd_target_vector[0] > + || *target != bfd_target_vector[0]) > + *name_ptr++ = (*target)->name; > > return name_list; > } Turned out to be harmless, thanks for remembering us :-) BTW, how does: *name_ptr++ = &bfd_target_vector[0]->name; for (target = &bfd_target_vector[1]; *target != NULL; target++) if (*target != bfd_target_vector[0]) *name_ptr++ = (*target)->name; look. Andrew