[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 18:22:53 CEST

Ben Collins-Sussman wrote:

> Doing a clean build of trunk on OSX Tiger (which now uses gcc 4.0),
> I'm seeing these warnings, because gcc has apparently tightened up
> its type-checking. But I'm not sure that we can do anything about
> them, can we? Maybe just forcibly cast the argument to an int?
>
>
>
> subversion/libsvn_subr/hash.c: In function 'hash_write':
> subversion/libsvn_subr/hash.c:204: warning: format '%d' expects type
> 'int', but argument 4 has type 'apr_ssize_t'
> subversion/libsvn_subr/hash.c:227: warning: format '%d' expects type
> 'int', but argument 4 has type 'apr_ssize_t'
>
> subversion/libsvn_repos/dump.c: In function 'write_hash_to_stringbuf':
> subversion/libsvn_repos/dump.c:76: warning: format '%d' expects type
> 'int', but argument 3 has type 'apr_ssize_t'
> subversion/libsvn_repos/dump.c:113: warning: format '%d' expects type
> 'int', but argument 3 has type 'apr_ssize_t'

 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?

-- 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 18:24:34 2005

This is an archived mail posted to the Subversion Dev mailing list.