[Ace-users] [tao-users] tao_idl and enum

Jules Colding colding at 42tools.com
Tue Feb 5 04:08:54 CST 2008


On Tue, 2008-02-05 at 10:51 +0100, Martin Corino wrote:
> On Tuesday 05 February 2008, Jules Colding wrote:
> > On Tue, 2008-02-05 at 08:32 +0100, Martin Corino wrote:
> > > Hi,
> > >
> > > On Tuesday 05 February 2008, khan_069 wrote:
> > > > Hi
> > > >
> > > > I am using TAO1.5 and when i compile a IDL file containing following
> > > > enumeration
> > > >
> > > > enum test{false=0,true=1};
> > > >
> > > > it throws error saying "Illegal syntax following enum body statement"
> > > >
> > > > but i remove explicit assignment in enum like
> > > >
> > > > enum test{false,true};
> > > >
> > > > this works properly
> > > >
> > > > Any idea why the first syntax is not allowed?
> > >
> > > Because this not compliant with CORBA IDL enum syntax.
> > > CORBA IDL does not allow to set arbitrary values for enumerators.
> > > The second form is the only allowed form.
> >
> > Yes, but please do not use "false" and "true". C++ wouldn't be to happy
> > I guess...
> 
> That is why the CORBA spec defines that identifiers matching C++ keywords will 
> be prefixed by '_cxx_'. 

Ah, yes - section 1.1.2 actually. I forgot.

Thanks,
  jules


> Nonetheless I agree using 'true' or 'false' as 
> identifiers is maybe not the best thing to do;-)
> 
> regards,
> Martin.
> 



More information about the Ace-users mailing list