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

RE: subversion-1/svn_wc.h:1210: error: comma at end of enumerator list

From: Tony Sweeney <tsweeney_at_omnifone.com>
Date: Wed, 19 Oct 2011 11:10:35 +0100

 

-----Original Message-----
From: Peter Johansson [mailto:peterandrejohansson_at_gmail.com]
Sent: 18 October 2011 22:35
To: users_at_subversion.apache.org
Cc: svndigest-users_at_lists.sourceforge.net
Subject: subversion-1/svn_wc.h:1210: error: comma at end of enumerator
list

Hello,

When I compiled with GCC (4.2.1) with compiler option -pedantic against
header file `svn_wc.h' in subversion version 1.7 I get the following
error:

In file included from main.cc:1:
/opt/local/include/subversion-1/svn_wc.h:1210: error: comma at end of
enumerator list
make: *** [main] Error 1

I suspect this is caused by a typo in svn_wc.h at line 1210:

   /** The operation skipped the path because it was conflicted.
    * @since New in 1.7. */
   svn_wc_notify_skip_conflicted,

} svn_wc_notify_action_t;

because other enums in the same file have no comma after the last item.
Is there are reason to have this comma that I'm missing or could it be
removed?

----------------------------------------------------------------------

The trailing comma is explicitly invalid per ANSI C 89 (though some
compilers, notably GCC, permitted it). C99 removes this restriction.
It's valid everywhere without the comma, so it's perfectly safe (and
probably desirable) to remove it. A Google search on 'trailing comma
enum' will find many instances of people submitting similar patches to
other open source projects.

Tony.

Thanks and please let me know if you need further information from me.

--
Cheers,
Peter
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.1831 / Virus Database: 2092/4560 - Release Date:
10/18/11
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
Received on 2011-10-19 12:11:11 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.