[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: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Thu, 10 Aug 2017 00:56:45 +0000

philip_at_apache.org 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
Received on 2017-08-10 02:56:50 CEST

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.