public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: Alan Modra <amodra@bigpond.net.au>
Cc: binutils@sources.redhat.com, gdb-patches@sources.redhat.com
Subject: Re: bfd target lists
Date: Wed, 06 Nov 2002 14:16:00 -0000	[thread overview]
Message-ID: <3DC994B4.6050409@redhat.com> (raw)
In-Reply-To: <20021015205951.N22176@bubble.sa.bigpond.net.au>

> 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


  parent reply	other threads:[~2002-11-06 22:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-15  4:29 Alan Modra
2002-10-15  4:32 ` Alan Modra
2002-11-06 14:16 ` Andrew Cagney [this message]
2002-11-06 14:48   ` Alan Modra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3DC994B4.6050409@redhat.com \
    --to=ac131313@redhat.com \
    --cc=amodra@bigpond.net.au \
    --cc=binutils@sources.redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).