Re: Failing build on opensolaris

From: Henrik Nordström <henrik_at_henriknordstrom.net>
Date: Thu, 28 Oct 2010 20:14:18 +0200

ons 2010-10-27 klockan 20:29 +0200 skrev Kinkie:
> The build is failing on
>
> ../../src/comm.cc: In member function `void
> ClientInfo::setWriteLimiter(int, double, double)':
> ../../src/comm.cc:2156: warning: right-hand operand of comma has no effect
>
> That line is
> cbdataReference(quotaQueue);
>
> where in cbdata.h
> #define cbdataReference(var) (cbdataInternalLock(var), var)
>
> Fixing this would seem simple, but it probably breaks encapsulation
> (that "Internal" soeems suspicious to me).
> Anyone willing to take on this, or to share a hint on how to do it?

The compiler is right in erroring out on this. The result of
cbdataReference MUST NOT be thrown away. It's your reference to the
object and should later be passed to cbdataReferenceDone.

It's also usable for accessing the object, but it's not really the
intention that holders of cbdata references should access the content of
the object, just pass it back in a callback.

Regards
Henrik
Received on Thu Oct 28 2010 - 18:14:22 MDT

This archive was generated by hypermail 2.2.0 : Fri Oct 29 2010 - 12:00:06 MDT