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

Re: compile warnings in trunk

From: Branko Čibej <brane_at_xbc.nu>
Date: 2005-05-10 19:15:44 CEST

Philip Martin wrote:

>Branko ÄŒibej <brane@xbc.nu> writes:
>
>
>> From a strictly language point of view, these warnings are
>> correct. On the other hand, unless they can be turned off by a
>> switch, there's no way you can avoid them short of explicitly casting
>> the arguments to the correct types. And that sort of defeats the
>> whole point of having #defined format strings.
>>
>>Are you sure gcc-4 doesn't have a switch that would turn off these
>>too-pedantic warnings?
>>
>>
>
>Why are the warnings correct?
>
>
Sorry, "correct" isn't the right word; "make sense" would've been better.

> SVN_ERR (svn_stream_printf (stream, subpool,
> "K %" APR_SSIZE_T_FMT "\n%s\n"
> "V %" APR_SIZE_T_FMT "\n",
> item->klen, (const char *) item->key,
> valstr->len));
>
>Argument 4, item->klen, is indeed apr_ssize_t, but the format is
>APR_SSIZE_T_FMT which should match. If that doesn't work it looks
>like either APR on Tiger doesn't set APR_SSIZE_T_FMT correctly, or
>it's a compiler bug.
>
>
I'd say it's compiler overzealousness, not a bug as such. Such warnings
make sense in envionments where the size of the defined type could be
different on different platforms. Of course, the compiler doesn't know
that the format string came from a define, too.

-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue May 10 19:17:41 2005

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.