Mail Archives: djgpp-workers/2001/01/21/08:54:38
>
>
> 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 -