This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Private data members
- From: Daniel Jacobowitz <drow at false dot org>
- To: Vladimir Prus <vladimir at codesourcery dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Wed, 29 Jul 2009 09:38:46 -0400
- Subject: Re: Private data members
- References: <200907291245.32359.vladimir@codesourcery.com>
On Wed, Jul 29, 2009 at 12:45:32PM +0400, Vladimir Prus wrote:
> At the moment, there are at least 3 places that directly assign
> a value to that field, and while I can convert them easily, nothing
> will prevent a direct assignment to appear in future. In C++,
> one would use 'private' visibility for that member, but it's not
> available in C. So, how about introducing a small convention --
> that members with names ending in '_' are 'private' and should
> never be accessed by outside code. Another alternative is to
> modify the comment on ignore_count, but that is much more likely
> to be ignored.
How about struct { int ignore_count; } private; ? I don't think
ignore_count_ is clear.
--
Daniel Jacobowitz
CodeSourcery