[email protected] wrote on Thu, 10 Aug 2017 00:09 +0000:
> +++ subversion/trunk/build/generator/gen_base.py Thu Aug 10 00:09:21 2017
> @@ -288,15 +288,21 @@ class GeneratorBase:
> + # errno names can vary depending on the Python, and possibly the
> + # OS, version and they are not even used by normal release builds
> + # so omit them from the tarball. We always want the struct itself
> + # so that SVN_DEBUG builds still compile.
> + write_struct('svn__errno',
> + [] if self.release_mode else errno.errorcode.items())
Passing an empty list to write_struct() will define svn__errno as:
static struct {…} svn__errno[] = {};
svn__errno is iterated on with:
for (i = 0; i < sizeof(svn__errno)/sizeof(svn__errno[0]); i++)
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.
IIRC, this question affects Windows debug builds since they define SVN_DEBUG.
Cheers,
Daniel