Re: [commit] Tighten memory read/write methods

Mark Kettenis
2005-01-28T08:46:51Z

Date: Thu, 27 Jan 2005 18:06:18 -0500
From: Andrew Cagney <cagney@gnu.org>

Mark Kettenis wrote:
> Date: Thu, 27 Jan 2005 15:11:19 -0500
> From: Andrew Cagney <cagney@gnu.org>
>
> Hello,
>
> This cleans up the {target_,}{read,write}_memory methods making the
> buffer parameter a bfd_byte (instead of "is it signed?" char)

In constant propogating I'm making the following mind numbing
transformations:

char -> const bfd_byte
unsigned char -> const bfd_byte
void -> const void

The first two are important. Some compilers [rightly] complain about
incompatibility between signed/unsigned char; and on ppc with it's
unsigned char, results just get weird.

We can certainly debate the merits of ISO vs BFD and bfd_byte vs void,
however lets keep that debate separate to my current task - getting
constants sufficiently propogated for me to do my next value.h commit
which in turn finishes DW_OP_piece.

OK, I can understand your rationale for seperating const-correctness
from other transformations; but then why don't you seperate the
(unsigned) char -> bfd_byte transformation too? I'm all for
consistent use of 'bfd_byte *' as the canonical way to point to a
buffer interpreted as seperate bytes. However, I think that pointers
to generic bits of memory should be 'void *' (which specific bits of
code might want to cast to 'bfd_byte *' if they're going to interpret
the bytes individually). Doing the mind-numbing conversion means that
we'll have to re-evaluate all occurances of 'bfd_byte' again later.

Mark