delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/01/21/08:54:38

Message-Id: <200101211354.IAA23490@qnx.com>
Subject: Re: Another item for develop.txi
To: djgpp-workers AT delorie DOT com
Date: Sun, 21 Jan 2001 08:54:15 -0500 (EST)
From: "Alain Magloire" <alain AT qnx DOT com>
In-Reply-To: <Pine.SUN.3.91.1010121093218.13920L-100000@is> from "Eli Zaretskii" at Jan 21, 2001 09:33:43 AM
X-Mailer: ELM [version 2.5 PL0b1]
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> 
> 
> On Sun, 21 Jan 2001, Martin Str|mberg wrote:
> 
> >  @item
> > +When writing prototypes in header files remember to prefix any formal
> > +arguments that you use with the underscore character (@samp{_}) to avoid
> > +polluting the name space.
> 
> I don't think formal parameters pollute the namespace, at least not in 
> most cases, but the text is okay, IMHO.  I suggest to add an example of a 
> good prototype, though.

Well I can show a bad example ;-)
# cat x.cc
---------------
int x (int __op);

int x (int op)
{
 return op;
}
---------------
# g++ -c x.cc

Now try to compile this with g++.
Variables, macros, etc .. that are start with a leading '_' are reserved
by the C/C++ implementation, I do not have the C standard at hand so do not
remember the wording.

-- 
au revoir, alain
----
Aussi haut que l'on soit assis, on est toujours assis que sur son cul !!!

- Raw text -


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