[omniORB] 2.6.1 / error in code generated for unions...

Ted McFadden mcfadden@dstc.edu.au
Tue, 19 Jan 1999 13:40:47 +1000 (EST)


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

---559023410-33463914-916717247=:2710
Content-Type: TEXT/PLAIN; charset=US-ASCII


(This bug did not turn up in a search of the archive, please disregard if
it is a known problem)

For unions like:

   union switch(long){
      case 2: string aString;
   };

the generated code for getting/setting the discriminator is:
 
	CORBA::Long _d () const { return pd__d;}
	void _d(CORBA::Long _value) {}            // EMPTY??

The union can still be set to 2 by calling aString(*) and the _default
value but nothing else. Most of the copying and streaming code generated
appears to be prepared to handle the other values if they could be set.

There is an attached UnionTrouble.idl file that illustrates the problem
with a few simple unions.

One other thing, the legal:

 union bad switch(long){
     case 1:
     case 2: string test;
  };

will not compile, complaining about redefinitions.


Cheers,

Ted.

-- 
Ted McFadden   
http://www.dstc.edu.au/BDU/staff/ted-mcfadden.html
DSTC Level 7, GPS Building 78, Staff House Road 
The University of Queensland St Lucia 4072 +61 7 3365-4310


---559023410-33463914-916717247=:2710
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="UnionTrouble.idl"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.SOL.4.05.9901191340470.2710@suntan.dstc.edu.au>
Content-Description: 
Content-Disposition: attachment; filename="UnionTrouble.idl"

DQptb2R1bGUgVW5pb25Ucm91YmxlICB7DQoNCiAgLy9maXJzdCB0ZXN0IGNh
c2UgdGFrZW4gZnJvbSBidWcgcmVwb3J0ICMzNA0KDQoNCiAgLy8gZ2VuZXJh
dGVkIF9kKENPUkJBOjpCb29sZWFuKSBpZ25vcmVzIGl0cyBhcmcsIGNhbid0
DQogIC8vIHNldCBkaXNjcmltaW5hdG9yLCBjYW4gb25seSBzZXQgdG8gRkFM
U0UgYnkgY2FsbGluZw0KICAvLyBfZGVmYXVsdCgpDQoNCiAgdW5pb24gWCBz
d2l0Y2ggKGJvb2xlYW4pIHsNCiAgICBjYXNlIFRSVUU6IHNob3J0IHM7DQog
IH07DQoNCiAvLyBfZCBpZ25vcmVzIGFyZywgY2FuIG9ubHkgc2V0IGRpc2Ny
aW1pbmF0b3IgdG8gLTIxNDc0ODM2NDcNCiAvLyB2aWEgX2RlZmF1bHQoKSBv
ciAyIHZpYSAgc3RyaW5nX2Zvcl90d28oLi4uKS4NCg0KICB1bmlvbiBDaG9v
c2VMb25nIHN3aXRjaChsb25nKXsNCiAgICBjYXNlIDI6IHN0cmluZyBzdHJp
bmdfZm9yX3R3bzsNCiAgfTsNCg0KICBlbnVtIENob2ljZSB7IG9uZSwgdHdv
LCB0aHJlZSwgZm91ciAgfTsNCiAgDQogIHVuaW9uIENob29zZU9uZSBzd2l0
Y2ggKCBDaG9pY2UgKSB7DQogICAgIGNhc2UgdHdvOiBzdHJpbmcgZm9yX3R3
bzsNCiAgfTsNCg0KLy8gIHdpbGwgbm90IGNvbXBpbGUgDQovLyAgdW5pb24g
YmFkIHN3aXRjaChsb25nKXsNCi8vICAgICBjYXNlIDE6DQovLyAgICAgY2Fz
ZSAyOiBzdHJpbmcgdGVzdDsNCi8vICB9Ow0KfTsNCg0K
---559023410-33463914-916717247=:2710--