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

Re: svn commit: r1412911 - in /subversion/trunk: subversion/libsvn_fs_fs/fs_fs.c subversion/libsvn_repos/reporter.c tools/client-side/svn-bench/null-log-cmd.c tools/server-side/fsfs-reorg.c

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Fri, 23 Nov 2012 16:37:12 +0000 (GMT)

Bert Huijben wrote:

> I can easily make these cases a compile error with Visual C++,
> but that will probably make other developers call it a broken/
> old/(fill in your own curse word) compiler for following such
> an old standard.

> Suggestions?

Honestly, I would like to suggest that we find out whether Subversion packagers who have complained about their compiler not supporting this construct have an acceptable alternative.

And then, if they do, I would like to add this constuct to a list of exceptions to C'89 that we allow in our code, and then use it, because it significantly improves code readability.

We already have other exceptions to strict C'89 compliance, which nobody has complained about.  Here's a couple of examples reported by "gcc -pedantic":

subversion/libsvn_subr/cmdline.c:621:26: ISO C forbids passing argument 3 of 'svn_auth_set_parameter' between function pointer and 'void *'
subversion/libsvn_subr/win32_crashrpt.c:1:0: ISO C forbids an empty translation unit

- Julian

> URL: http://svn.apache.org/viewvc?rev=1412911&view=rev
> Log:
> Do not use non-constant initializers in struct variables, since this
> violates our C'89 coding standard.  Although most compilers used for
> Subversion support non-constant initializers, some do not, such as Solaris
> SunPRO.  Note that GCC requires the '-pedantic' option to report this.
>
> A previous commit of this kind was r1352068.
Received on 2012-11-23 17:37:49 CET

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.