From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13805 invoked by alias); 29 Jul 2009 13:41:40 -0000 Received: (qmail 13794 invoked by uid 22791); 29 Jul 2009 13:41:39 -0000 X-SWARE-Spam-Status: No, hits=-3.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 29 Jul 2009 13:41:34 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MW9PM-0001s5-Sg for gdb@sources.redhat.com; Wed, 29 Jul 2009 13:41:29 +0000 Received: from h86-62-88-129.ln.rinet.ru ([86.62.88.129]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 29 Jul 2009 13:41:28 +0000 Received: from vladimir by h86-62-88-129.ln.rinet.ru with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 29 Jul 2009 13:41:28 +0000 To: gdb@sources.redhat.com From: Vladimir Prus Subject: Re: Private data members Date: Wed, 29 Jul 2009 13:41:00 -0000 Message-ID: References: <200907291245.32359.vladimir@codesourcery.com> <20090729133846.GA29761@caradoc.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.10.9 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-07/txt/msg00227.txt.bz2 Daniel Jacobowitz wrote: > 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; ? Might work. > I don't think ignore_count_ is clear. Well, it's a convention for naming private variables used by roughly half of C++ developers, so I expect many current and future contributors know it already. - Volodya