Issue 5440: Prohibit extracting from any into _out type? (cxx_revision) Source: Floorboard Software (Mr. Jonathan Biggar, jon(at)floorboard.com) Nature: Uncategorized Issue Severity: Summary: Just as we prohibited direct extraction from any any into a _var type due to the perils of memory management problems, we ought to prohibit extracting into _out types of variable sized structured types for the same reason Resolution: Revised Text: Actions taken: June 25, 2002: received issue Discussion: deferred in June 2011 to the next RTF End of Annotations:===== Sender: jbiggar@Resonate.com Date: Mon, 24 Jun 2002 16:27:13 -0700 From: Jonathan Biggar X-Mailer: Mozilla 4.79 [en] (X11; U; SunOS 5.6 sun4u) X-Accept-Language: en To: cxx-revision@omg.org, issues@omg.org Subject: Prohibit extracting from any into _out type? Just as we prohibited direct extraction from any any into a _var type due to the perils of memory management problems, we ought to prohibit extracting into _out types of variable sized structured types for the same reason. -- Jon Biggar Floorboard Software jon@floorboard.com jon@biggar.org Reply-To: "Michi Henning" From: "Michi Henning" To: Subject: Re: issue 5440 -- C++ RTF issue Date: Wed, 26 Jun 2002 07:31:56 +1000 Organization: Triodia Technologies X-Mailer: Microsoft Outlook Express 6.00.2600.0000 > This is issue # 5440 Jonathan Biggar > > > Prohibit extracting from any into _out type? > > Just as we prohibited direct extraction from any any into a _var > type > due to the perils of memory management problems, we ought to > prohibit > extracting into _out types of variable sized structured types for > the > same reason Sounds sensible to me. Although, I would have thought that this goes without saying, given that applications aren't meant to ever be using the _out types anyway... Cheers, Michi. -- Michi Henning Ph: +61 4 1118-2700 Triodia Technologies http://www.triodia.com/staff/michi Sender: jbiggar@Resonate.com Date: Tue, 25 Jun 2002 14:46:52 -0700 From: Jonathan Biggar X-Mailer: Mozilla 4.79 [en] (X11; U; SunOS 5.6 sun4u) X-Accept-Language: en To: Michi Henning CC: cxx_revision@omg.org Subject: Re: issue 5440 -- C++ RTF issue Michi Henning wrote: > > > This is issue # 5440 Jonathan Biggar > > > > > > Prohibit extracting from any into _out type? > > > > Just as we prohibited direct extraction from any any into a _var type > > due to the perils of memory management problems, we ought to prohibit > > extracting into _out types of variable sized structured types for the > > same reason > > Sounds sensible to me. Although, I would have thought that this goes > without saying, given that applications aren't meant to ever be using > the _out types anyway... Not really true, you use the out type whenever you access the formal out parameter inside a method implementation: // IDL interface A { void op(out string s); }; // C++ class My_A : public POA_A { public: void op(CORBA::String_out s) throw(CORBA::SystemException) { CORBA::Any an_any; an_any >>= s; // oops, memory management error! } }; -- Jon Biggar Floorboard Software jon@floorboard.com jon@biggar.org Reply-To: "Michi Henning" From: "Michi Henning" To: "Jonathan Biggar" Cc: Subject: Re: issue 5440 -- C++ RTF issue Date: Wed, 26 Jun 2002 07:54:57 +1000 Organization: Triodia Technologies X-Mailer: Microsoft Outlook Express 6.00.2600.0000 > Not really true, you use the out type whenever you access the formal out > parameter inside a method implementation: > > // IDL > interface A { > void op(out string s); > }; > > // C++ > > class My_A : public POA_A { > public: > void op(CORBA::String_out s) throw(CORBA::SystemException) { > CORBA::Any an_any; > > an_any >>= s; // oops, memory management error! > } > }; Ah, I see what you mean. Hmmm... trying to do this isn't unreasonable though. Might be nicer to overload the Any extrators for out types as well? Cheers, Michi. -- Michi Henning Ph: +61 4 1118-2700 Triodia Technologies http://www.triodia.com/staff/michi Sender: jbiggar@Resonate.com Date: Tue, 25 Jun 2002 16:11:03 -0700 From: Jonathan Biggar X-Mailer: Mozilla 4.79 [en] (X11; U; SunOS 5.6 sun4u) X-Accept-Language: en To: Michi Henning CC: cxx_revision@omg.org Subject: Re: issue 5440 -- C++ RTF issue Michi Henning wrote: > > > Not really true, you use the out type whenever you access the formal out > > parameter inside a method implementation: > > > > // IDL > > interface A { > > void op(out string s); > > }; > > > > // C++ > > > > class My_A : public POA_A { > > public: > > void op(CORBA::String_out s) throw(CORBA::SystemException) { > > CORBA::Any an_any; > > > > an_any >>= s; // oops, memory management error! > > } > > }; > > Ah, I see what you mean. Hmmm... trying to do this isn't unreasonable > though. > Might be nicer to overload the Any extrators for out types as well? Ick. The number of generated functions for the C++ mapping is already huge. I'd rather not add more. Anyway, if we were to do that, we ought to go back and make extracting into a _var legal as well, requiring a generated extractor that copies the data from the Any. Better to make it illegal just like for _var types and be consistent. -- Jon Biggar Floorboard Software jon@floorboard.com jon@biggar.org Reply-To: "Michi Henning" From: "Michi Henning" To: "Jonathan Biggar" Cc: Subject: Re: issue 5440 -- C++ RTF issue Date: Wed, 26 Jun 2002 20:12:00 +1000 Organization: Triodia Technologies X-Mailer: Microsoft Outlook Express 6.00.2600.0000 > > > > Ah, I see what you mean. Hmmm... trying to do this isn't > > unreasonable > > though. > > Might be nicer to overload the Any extrators for out types as > > well? > > Ick. The number of generated functions for the C++ mapping is > > already > huge. I'd rather not add more. > > Anyway, if we were to do that, we ought to go back and make > > extracting > into a _var legal as well, requiring a generated extractor that > > copies > the data from the Any. Better to make it illegal just like for _var > types and be consistent. I guess so. But it's yet another special case to remember... Cheers, Michi. -- Michi Henning Ph: +61 4 1118-2700 Triodia Technologies http://www.triodia.com/staff/michi