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

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Sun, 9 Mar 2003 19:57:13 +0100

Hmm.. the original line looks very odd to me and should break with
most compilers..

The cbdataFree macro has two purposes:

 a) It invalidates (and frees if possible) the referenced data
structure

 b) It nullifies the pointer reference.

'b' requires the argument to be a LVALUE, and a typecasted pointer is
a RVALUE.

It should most likely read

  cbdataFree(address);

Regards
Henrik

On Sunday 09 March 2003 13.12, Robert Collins wrote:
> On Sat, 2003-03-08 at 22:08, Guido Serassio wrote:
> > Hi,
> >
> > This is the 6th of some splitted native Windows patches grouped
> > by functionality.
> >
> > Native Windows port enhancements:
> >
> > - C++ fixes for MS Visual C++ compatibility, See this old
> > squid-dev thread about:
> > http://www.squid-cache.org/mail-archive/squid-dev/200211/0249.htm
> >l
> >
> > - Some casting and prototypes fixes
>
> {
> - 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.
>
> > - some little DNS sources changes for a better build process
> > using MS Visual Studio.
>
> Is there anyway we can avoid the whole file #ifdefs in VS ? I'm
> applying this anyway, but as we get more modular, this is going to
> become....annoying.
>
> Can you enlarge on the TOS casts? They are going to affect all
> platforms, I need to know what they are meant to achieve (i.e. why
> the compilers implicit casting isn't enough).
>
> Other than that, I'm merging them patches in now.
>
> Rob
Received on Sun Mar 09 2003 - 11:53:32 MST

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