subversion-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip Martin <>
Subject Re: svn commit: r1804618 - /subversion/trunk/build/generator/
Date Thu, 10 Aug 2017 01:23:47 GMT
Daniel Shahaf <> 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

../src/subversion/libsvn_subr/ warning: ISO C forbids empty initializer
braces [-Wpedantic]
 } svn__errno[] = {
../src/subversion/libsvn_subr/ 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.


View raw message