Re: /bzr/squid3/trunk/ r11285: ICC build issue in ConnStateData::getConn

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Mon, 14 Mar 2011 10:01:25 -0600

On 03/11/2011 06:16 PM, Amos Jeffries wrote:
> ------------------------------------------------------------
> revno: 11285
> committer: Amos Jeffries <squid3_at_treenet.co.nz>
> branch nick: trunk
> timestamp: Fri 2011-03-11 18:16:37 -0700
> message:
> ICC build issue in ConnStateData::getConn
>
> ICC complains about:
> "type qualifier on return type is meaningless
> inline ConnStateData * const getConn() const;
> "
>
> I believe this is const-correct. The incorrect version would be "& const"
> But there is no harm in combining the two getConn() methods.
> modified:
> src/client_side_request.cci
> src/client_side_request.h

> ConnStateData *
> -ClientHttpRequest::getConn()
> -{
> - if (!cbdataReferenceValid(conn_))
> - return NULL;
> -
> - return conn_;
> -}
> -
> -ConnStateData * const
> ClientHttpRequest::getConn() const

Perhaps the author meant to write the second one as
const ConnStateData *getConn() instead of
ConnStateData *const getConn()?
Then it would make sense and would not need fixing, I guess.

Whether it is a good idea to return non-constant ConnStateData object
from a constant ClientHttpRequest object is a different question. If
modifying ConnStateData object does not really alter the
ClientHttpRequest state, then it is appropriate.

HTH,

Alex.
Received on Mon Mar 14 2011 - 16:01:32 MDT

This archive was generated by hypermail 2.2.0 : Mon Mar 14 2011 - 12:00:04 MDT