This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB 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: A case for `void *' for pointers to arbitrary (byte) buffers


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


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