[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: "new" as function parameter doesn't work with C++-compilers

From: SteveKing <steveking_at_gmx.ch>
Date: 2003-06-09 14:33:57 CEST

----- Original Message -----
From: "Greg Stein" <gstein@lyra.org>
To: "SteveKing" <dev@tortoisesvn.tigris.org>
>
> I don't see that at all. Line 67 of svn_wc.h is a comment. I don't see a
> parameter named 'new' anywhere in the headers.

line 65 to 67 in revision 6174 read:
typedef svn_error_t *svn_wc_relocation_validator(void *baton,

const char *old,

const char *new);

The problem is the third parameter.
(file subversion/include/svn_wc.h)

> Second, we wrap all of our headers with:
>
> #ifdef __cplusplus
> extern "C" {
> #endif /* __cplusplus */
>
> which I would hope avoid problems with identifiers like 'new'. Not that I
> support doing that when it is so easy to change, but it should prevent
> problems like you're seeing.

Obviously it didn't. But I'll check my settings...
Hmmm - I think that only prevents errors in functions, not in typedefs?

> >...
> > May I ask to change that?
>
> Change what? :-)

See above.
Even with the #ifdef in the header which should prevent
such errors I strongly recommend not using "new" or any
other C++ keyword as parameter or variable names.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jun 9 14:37:00 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.