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

Re: svn commit: r1804618 - /subversion/trunk/build/generator/gen_base.py

From: Philip Martin <philip_at_codematters.co.uk>
Date: Thu, 10 Aug 2017 02:23:47 +0100

Daniel Shahaf <d.s_at_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

../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.

Received on 2017-08-10 03:24:02 CEST

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