Home Help Center

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

rowanwrowanw Member Rowan WorthOrganization: DownUnder GeosolutionsProject: Abstraction layer for multiple data sources
Just upgraded from 3.4.2 and hit this. Reproduced with a minimal test case:
$ cat lol.ice
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 lol.ice
/tmp/lol.ice:6: 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.

Cheers,
-Rowan

Comments

  • rowanwrowanw Member Rowan WorthOrganization: DownUnder GeosolutionsProject: Abstraction layer for multiple data sources
    Aha, it's not just enums. With a struct definition like this:
    module TypeMember {
    	struct Event {
    		string description;
    		int type;	// comment!
    	};
    };
    

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

    -Rowan
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    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.

    Cheers,
    Benoit.
  • rowanwrowanw Member Rowan WorthOrganization: DownUnder GeosolutionsProject: Abstraction layer for multiple data sources
    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!
    -Rowan
Sign In or Register to comment.