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

Martin Corino mcorino at remedy.nl
Tue Feb 5 03:51:11 CST 2008


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_'. Nonetheless I agree using 'true' or 'false' as 
identifiers is maybe not the best thing to do;-)

regards,
Martin.

-- 
----------------------------------------------------------------------
                           Martin J.N. Corino | Remedy IT Expertise BV
          Postbus 101 |  2650 AC Berkel en Rodenrijs | The Netherlands
                       tel: +31 (10) 522 0139 | fax: +31 (33) 246 6511
                                  World Wide Web: http://www.remedy.nl
----------------------------------------------------------------------



More information about the Ace-users mailing list