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
- From: Stan Shebs <shebs at apple dot com>
- To: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- Cc: gdb at sourceware dot org, cagney at gnu dot org, eliz at gnu dot org
- Date: Tue, 03 May 2005 15:00:49 -0700
- Subject: Re: A case for `void *' for pointers to arbitrary (byte) buffers
- References: <42710E90.3030300@gnu.org> <200504281919.j3SJJKF1011501@elgar.sibelius.xs4all.nl> <42715EE8.5070704@gnu.org> <01c54c8a$Blat.v2.4$ffbe8140@zahav.net.il> <42753958.70109@gnu.org> <01c54e92$Blat.v2.4$5cf24460@zahav.net.il> <42755FD4.8000009@gnu.org> <01c54f4a$Blat.v2.4$a9fc8500@zahav.net.il> <42778DE6.1080106@gnu.org> <200505032013.j43KD1dD005239@elgar.sibelius.xs4all.nl>
Mark Kettenis wrote:
Why not use `xxx_byte *' instead of `void *'?
---------------------------------------------
* It's nonstandard. Why do we need a nonstandard type if a perfectly
god standard type is available?
My inclination would be for gdb_byte *, as an abstraction of
"what people who understand the issue more than I do think is
the right type to use". 1/2 :-)
Personally I've never been comfortable with using void * because
it has its own set of semi-mysterious rules for use - yeah, if I
wear my compiler-guy hat, they work that way for a reason, but
when I wear my just-wanna-write-code hat, they are more of a
distraction.
Another downside of void * is it doesn't tell the reader whether
it means GDB's byte abstraction, or something else, such as a
declaration that has to be void * for consistency with system
headers or some such.
GDB seems like a big enough program to justify its own byte type.
Stan