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

Re: OWC meets subversion.

From: NormW <normw_at_gknw.net>
Date: Mon, 14 Nov 2011 21:59:21 +1100

G/E,
On 14/11/2011 5:26 PM, Daniel Shahaf wrote:
> On Monday, November 14, 2011 8:27 AM, "NormW"<normw_at_gknw.net> wrote:
>> Hi,
>>
>
> Well, perhaps fix the compiler instead of rewriting everyone's switch
> statements? :-)
A question to that effect was asked on the OWC developer site and the
reply suggested that adding 64-bit int switch support would be of such a
major effort this close to 2.0 (rumored March 2012) that it would not be
considered. Note that that question preceded this thread.

If the life of Subversion hung on need for 64-switch blocks, would
happily aim OWC at other tasks, but the one instance (for now anyway)
that can readily be replaced as shown adds yet another compiler (also
Open Source) to the potential build methods.

> (But not opposed to committing this if people can't build svn
> because of this.)
>
>> FYI: The 'warn' blips; at least the first 2 are already noted in the
>> source, while for #3 it's unclear how this can return an int....
>>
>
> If we make this return an int then we'd have to cast it at the callsite
> (it's a callback function). *shrug*
Not a dev guru, but AFAIK a call to abort() is not likely to return to
the 'abort_on_pool_failure' function at all, so it would more logically
be defined as 'void' and not 'int', which removes the compiler warning
about a missing 'return'??

>>> D:\Projects\srcs\subversion-1.7.1\subversion\libsvn_subr\skel.c(233): Warning! W136: Comparison equivalent to 'unsigned == 0'
>
> The code is correct (and future-proof if len ever becomes signed).
>
>>> D:\Projects\srcs\subversion-1.7.1\subversion\libsvn_subr\stream.c(1066): Warning! W136: Comparison equivalent to 'unsigned == 0'
>
> Same
>
>>> D:\Projects\srcs\subversion-1.7.1\subversion\libsvn_ra_svn\marshal.c(577): Warning! W124: Comparison result always 0
>
> Same issue as in the 2nd warning: checks for overflow by checking
> whether it's "> APR_SIZE_MAX". Perhaps we should restructure the check?
>
>>> D:\Projects\srcs\subversion-1.7.1\subversion\libsvn_ra_neon\merge.c(159): Warning! W113: Pointer type mismatch
>>> D:\Projects\srcs\subversion-1.7.1\subversion\libsvn_ra_neon\merge.c(159): Note! N2003: source conversion type is 'void *'
>>> D:\Projects\srcs\subversion-1.7.1\subversion\libsvn_ra_neon\merge.c(159): Note! N2004: target conversion type is 'enum svn_recurse_kind '
>
> Casting an enum { x=1, y=2 } to/from a void*.
>
> We could restructure this with sentinels, I suppose:
>
> static void *recurse[2];
>
> apr_hash_set(valid_targets, key, klen,&recurse[FALSE]);
> apr_hash_set(valid_targets, key, klen,&recurse[TRUE]);
>
>>> D:\Projects\srcs\subversion-1.7.1\subversion\svnlook\main.c(2376): Warning! W136: Comparison equivalent to 'unsigned == 0'
>
> Again: too trigger-happy. It's valid to ask whether an unsigned is nonpositive.
>
>>
>> Not saying these are bugs - just what the OWC 1.9 says. (Hence FYI).
>> Norm
>>
>
> Thanks for your input,
>
> Daniel
Don't thank me - the OWC knows a lot more about this stuff than I do!
Happily however it can't send mails.
Regards
Norm
Received on 2011-11-14 12:01:03 CET

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.