From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: Nick Duffek Cc: gdb@sources.redhat.com, insight@sources.redhat.com Subject: Re: Register group proposal Date: Thu, 22 Feb 2001 07:58:00 -0000 Message-id: <3A95369F.98027202@cygnus.com> References: <3A942228.C9E05495@cygnus.com> <200102221326.f1MDQJc02778@rtl.cygnus.com> X-SW-Source: 2001-02/msg00295.html Nick Duffek wrote: > > On 21-Feb-2001, Andrew Cagney wrote: > > >Rather than a simple integer, should reggroup be made an object vis > >``struct reggroup *''? > > Perhaps so. It's not a struct at the moment, though, and even if it were, > declaring it as such implies that clients of the interface have access to > fields of the struct, which either (a) is untrue or (b) leaks internal > information across the interface. > > I'd rather typedef it to something that'll cause compile-time errors if > it's used as anything other than an opaque handle. That change probably > would require more discussion, so for now I'd prefer to use an int. I'm sorry but you've lost me here. Have a look at ui-out.h, ui-file.h, gdbarch.h, ... They have all used ``struct foo *'' to implement an opaque type. In all cases it isn't possible to get to the inner workings. Regarding typedefs. Per my e-mail http://sources.redhat.com/ml/gdb-patches/2001-02/msg00325.html it encouraging a tangled web of includes. enjoy, Andrew