You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Peter Johansson <pe...@gmail.com> on 2011/10/18 23:35:10 UTC

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?

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

-- 
Cheers,
Peter

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

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Tony Sweeney wrote on Wed, Oct 19, 2011 at 11:10:35 +0100:
> 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.

Exactly.

If someone wants to send a patch, though, it would be nice to also fix
all other instances of a trailing comma in the C code.  (There is at
least one such instance in subversion/svn/main.c.)

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

Posted by Tony Sweeney <ts...@omnifone.com>.
 

-----Original Message-----
From: Peter Johansson [mailto:peterandrejohansson@gmail.com] 
Sent: 18 October 2011 22:35
To: users@subversion.apache.org
Cc: svndigest-users@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 
______________________________________________________________________