This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: trivial tidyup in bfd/reloc.c


Ben Elliston <bje@au1.ibm.com> writes:

> Committed as obvious.  I don't think this is too contentious.  ;-)
> 
> Ben
> 
> 
> 2006-10-26  Ben Elliston  <bje@au.ibm.com>
> 
>         * reloc.c (_bfd_relocate_contents): Remove explicit case 0.
> 
> Index: reloc.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/reloc.c,v
> retrieving revision 1.158
> diff -u -p -r1.158 reloc.c
> --- reloc.c     25 Oct 2006 06:49:20 -0000      1.158
> +++ reloc.c     26 Oct 2006 00:21:17 -0000
> @@ -1522,7 +1522,6 @@ _bfd_relocate_contents (reloc_howto_type
>    switch (size)
>      {
>      default:
> -    case 0:
>        abort ();
>      case 1:
>        bfd_put_8 (input_bfd, x, location);


I just want to note that I don't think we should start a general trend
of removing cases that are the same as the default case.  I think they
provide a useful comment, to wit: I have considered this case
explicitly, and this is how it should be handled.

In this particular case, though, I see no benefit to the "case 0", and
I think your patch is fine.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]