subversion-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip Martin <phi...@codematters.co.uk>
Subject Re: svn commit: r1804618 - /subversion/trunk/build/generator/gen_base.py
Date Thu, 10 Aug 2017 01:23:47 GMT
Daniel Shahaf <d.s@daniel.shahaf.name> writes:

> Is this loop iteration style valid for empty arrays?  Looking at C89, it's not
> clear to me that sizeof(x[0]) is well-defined for empty arrays.

It builds without warnings using 'gcc -std=c89' but fails if I add
'-pedantic':

../src/subversion/libsvn_subr/errorcode.inc:6:18: warning: ISO C forbids empty initializer
braces [-Wpedantic]
 } svn__errno[] = {
                  ^
../src/subversion/libsvn_subr/errorcode.inc:6:3: error: zero or negative size array ‘svn__errno’
 } svn__errno[] = {
   ^~~~~~~~~~

I suppose I could insert a dummy entry for zero.  The code that uses the
array will never look for zero since there is an earlier return.

-- 
Philip

Mime
View raw message