This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: A case for `void *' for pointers to arbitrary (byte) buffers
On Wed, May 04, 2005 at 12:06:26AM +0200, Mark Kettenis wrote:
> > If you want to use a standard type, play the necessary autoconf games
> > to acquire stdint.h. Use uint8_t *.
> >
> > That's an interesting suggestion. It might take a few iterations to
> > get that right though.
>
> I'm willing to do the work.
>
> OK great! I really like being able to use those (u)intN_t types, and
> especially (u)intptr_t. You can probably steal the autoconf checks
> from GNU coreutils. Those will have been pretty well tested I sppose.
> But the base sequence should something like:
>
> #ifdef HAVE_STDINT_H
> #include <stdint.h>
> #else
> # ifdef HAVE_INTTYPES_H
> # include <inttypes.h>
> # else
> typedef unsigned char uint8_t;
> # endif
> #endif
To be honest, my preference is still for gdb_byte * over uint8_t *, for
exactly the reason Stan just mentioned: consistency. Whether that's
defined as unsigned char or uint8_t is less important to me.
Does gdb_byte, defined in terms of uint8_t, work for you?
--
Daniel Jacobowitz
CodeSourcery, LLC