X-Spam-Check-By: sourceware.org
From: "Dave Korn" <dave.korn@artimi.com>
To: <cygwin@cygwin.com>
References: <1cbe225f0704160234u24b104a5o9b459178e895a5a8@mail.gmail.com> <018901c7800b$5c4ec450$2e08a8c0@CAM.ARTIMI.COM> <4623592C.2000905@sh.cvut.cz>
Subject: RE: C++ name with leading underscore character not Compiling
Date: Mon, 16 Apr 2007 12:29:00 +0100
Message-ID: <019c01c7801a$6db51f00$2e08a8c0@CAM.ARTIMI.COM>
MIME-Version: 1.0
Content-Type: text/plain; 	charset="iso-8859-1"
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <4623592C.2000905@sh.cvut.cz>
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id l3IHGNHB002206

On 16 April 2007 12:08, Václav Haisman wrote:

> Dave Korn wrote:
>> On 16 April 2007 10:34, Chelton Evans wrote:
>> 
>>> I believe it is legal to have a C++ variable name with a leading
>>>  underscore.
>> 
>>   No.  All names beginning with an underscore are reserved for the
>> implementation. 
>> 
> Nit pick, IIRC only names that start with underscore and capital letter
> or that start with double underscores are reserved. Single underscore
> and small letter should be available to users.

  Thanks for the correction.  I'm referring to the C standard; I think C++
follows basically the same rules but don't have a spec handy to refer to.
FTR, the relevant section is 7.1.3, which lists the following rules:

- All identifiers that begin with an underscore and either an uppercase letter
or another underscore are always reserved for any use.
- All identifiers that begin with an underscore are always reserved for use as
identifers with file scope in both the ordinary and tag name spaces.


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


