Re: Windows port merge - MS Visual C++ compatibility [PATCH]

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Mon, 10 Mar 2003 22:41:52 +0100

On Monday 10 March 2003 21.30, Guido Serassio wrote:

> > {
> >- cbdataFree ((clientReplyContext *)address);
> >+ clientReplyContext * tmp = (clientReplyContext *)address;
> >+ cbdataFree (tmp);
> > }
> >
> >This looks extraneous. What is the error that VS gives you? I'm
> >stripping this one out of what I'll merge into HEAD.
>
> If I remember good, it gives an "error C2105: '++' needs l-value"
> too. In this moment I can't build the nt branch for the ACL
> problem.

As said earlier the original code here is bad, and no compiler should
accept it..

The argument to cbdataFree MUST be a l-value. A typecasted value is a
r-value.

However, casting into a temporary variable is not correct either,
except for very special cases.

My question is why the cast is at all needed and from where "address"
is?

Regards
Henrik
Received on Mon Mar 10 2003 - 14:41:54 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:19:31 MST