From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11580 invoked by alias); 29 Jul 2009 13:39:01 -0000 Received: (qmail 11565 invoked by uid 22791); 29 Jul 2009 13:39:01 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 29 Jul 2009 13:38:52 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 5AEF91061C; Wed, 29 Jul 2009 13:38:49 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id EA472104E1; Wed, 29 Jul 2009 13:38:48 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1MW9Mk-0007oA-E6; Wed, 29 Jul 2009 09:38:46 -0400 Date: Wed, 29 Jul 2009 13:39:00 -0000 From: Daniel Jacobowitz To: Vladimir Prus Cc: gdb@sources.redhat.com Subject: Re: Private data members Message-ID: <20090729133846.GA29761@caradoc.them.org> Mail-Followup-To: Vladimir Prus , gdb@sources.redhat.com References: <200907291245.32359.vladimir@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200907291245.32359.vladimir@codesourcery.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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/msg00226.txt.bz2 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