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

Re: svn commit: r1101091 - /subversion/trunk/subversion/libsvn_subr/cache-membuffer.c

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Tue, 10 May 2011 09:46:42 +0100

Stefan Fuhrmann <eqfox_at_web.de> writes:

> On 09.05.2011 18:43, Philip Martin wrote:
>> stefan2_at_apache.org writes:
>>
>>> Author: stefan2
>>> Date: Mon May 9 16:28:16 2011
>>> New Revision: 1101091
>>> (svn_cache__membuffer_cache_create): formatting fixes; add missing cast
>>> - c = apr_palloc(pool, segment_count * sizeof(*c));
>>> + c = (svn_membuffer_t *)apr_palloc(pool, segment_count * sizeof(*c));
>> Why is that cast necessary?
>>
> The Microsoft compiler issued a warning here and
> the explicit cast silences it. Maybe, it's a C99 thing?
> Curiously, it would not generate a warning before
> when the line read
>
> svn_membuffer_t *c = apr_palloc(...)

It's allowed by C99. Sounds like a compiler bug. We have dozens of
other calls of the form

  variable = apr_palloc(...);

Is this the only one that causes a warning?

-- 
Philip
Received on 2011-05-10 10:47:19 CEST

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.