After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 112220 - generates invalid code for enum used as union discriminator
generates invalid code for enum used as union discriminator
Status: RESOLVED FIXED
Product: ORBit2
Classification: Deprecated
Component: general
unspecified
Other Linux
: Normal minor
: ---
Assigned To: ORBit maintainers
ORBit maintainers
Depends on:
Blocks:
 
 
Reported: 2003-05-04 16:37 UTC by Sebastian Rittau
Modified: 2006-11-23 10:41 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastian Rittau 2003-05-04 16:37:53 UTC
As reported on the Debian BTS as #131331
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=131331) by Jochen Voss:

========================================================================

Hello,

when I use an CORBA <enum_type> as a union discriminator,
orbit-idl silently generates code, which does not compile.

Example: I use the following IDL file:

== testunion.idl starts at next line =================================
module TestUnion {
  interface Frosch {
    union MyUnion switch (enum E2 { A, B }) {
    case A:
      long x;
    case B: 
      string s;
    };

    attribute MyUnion U;
  };
};
== testunion.idl ends at previous line ===============================

Now I call orbit-idl:

    voss@tatonka [~/bugreport/orbit] orbit-idl testunion.idl 
    voss@tatonka [~/bugreport/orbit] grep TestUnion_Frosch_MyUnion_E2 *
    testunion-common.c:static const TestUnion_Frosch_MyUnion_E2
anon_sublabel_values_array8[] =
    testunion-common.c:   { {(CORBA_TypeCode) &
TC_TestUnion_Frosch_MyUnion_E2_struct,
    testunion-common.c:   {(CORBA_TypeCode) &
TC_TestUnion_Frosch_MyUnion_E2_struct,
    testunion-common.c:   (CORBA_TypeCode) &
TC_TestUnion_Frosch_MyUnion_E2_struct, 0, -1, 0, 0
    testunion-skels.c:       value._d = *((TestUnion_Frosch_MyUnion_E2 *)
_ORBIT_curptr);
    testunion-stubs.c:          *((TestUnion_Frosch_MyUnion_E2 *)
_ORBIT_curptr);
    testunion.h:      TestUnion_Frosch_MyUnion_E2 _d;

As you can see, TestUnion_Frosch_MyUnion_E2 is never defined,
but used in severl places.  Consequently the generated files
refuse to compile.

Jochen
Comment 1 Michael Meeks 2003-05-05 08:51:31 UTC
Since I dislike groping in the IDL compiler, and have no need of this
myself; it'd be quickest if Jochen (/someone) could hack up a small
libIDL/other patch to implement this - should be fairly easy;

Thanks for the report though.
Comment 2 Sebastian Rittau 2003-05-05 09:33:32 UTC
> Since I dislike groping in the IDL compiler, and have no need of this
> myself; it'd be quickest if Jochen (/someone) could hack up a small
> libIDL/other patch to implement this - should be fairly easy;

I will look into it.
Comment 3 Kjartan Maraas 2006-11-22 19:37:40 UTC
Is this fixed in ORBit2?
Comment 4 Sebastian Rittau 2006-11-22 19:56:20 UTC
I just checked with ORBit2, which defines TestUnion_Frosch_MyUnion_E2. This bug can be closed.
Comment 5 Michael Meeks 2006-11-23 10:41:50 UTC
Thanks Sebastian, marked fixed.