This forum has been archived. Please start a new discussion on GitHub.

3.5.1: slice2java/cs/py parsing issue: "enum `Foo' must have at least one enumerator"

Just upgraded from 3.4.2 and hit this. Reproduced with a minimal test case:
$ cat
module CommentedEnum {
	enum Abbreviations {
		LOL,	// Laugh out Loud
		ROFL,	// Rolling on the Floor Laughing
		TANSTAAFL,	// There Ain't No Such Thing As A Free Lunch
$ slice2java
/tmp/ enum `Abbreviations' must have at least one enumerator

Well fair enough, but I have three enumerators in there! It seems to be fooled by the comments - if I switch to /* */ style comments everything works again.

slice2java/cs/py all give the same error, slice2cpp appears unaffected. Didn't test anything else.



  • Aha, it's not just enums. With a struct definition like this:
    module TypeMember {
    	struct Event {
    		string description;
    		int type;	// comment!

    The generated is missing the "type" field. I thought this one was going to be a keyword issue for sure :)

  • benoit
    benoit Rennes, France

    Are you using a binary distribution downloaded from our website or did you build Ice yourself?

    This is a known problem with mcpp. We provide a patch to fix it in the 3rd party source package available on our download page: ZeroC - Download

    This shouldn't occur if you're using one of our binary distributions since we built mcpp with this patch.

  • Aha! That would certainly explain it, as I did build from source.

    I guess there is also a test for this that I didn't end up running. "make all" failed during the java part as I don't have the requisite berkeley DB library. However as I'm not currently interested in the freeze stuff (and couldn't find a simple way to _not_ build it) I manually invoked ant to build the Ice jar and left it at that.

    Thanks for the prompt response, and my apologies for wasting your time!