delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/04/18/13:16:35

X-Spam-Check-By: sourceware.org
From: "Dave Korn" <dave DOT korn AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
References: <1cbe225f0704160234u24b104a5o9b459178e895a5a8 AT mail DOT gmail DOT com> <018901c7800b$5c4ec450$2e08a8c0 AT CAM DOT ARTIMI DOT COM> <4623592C DOT 2000905 AT sh DOT cvut DOT 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
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <4623592C.2000905@sh.cvut.cz>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
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/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019