Issue 10558: Allowing mutual recursion for IDL structs - clarification needed (corba-rtf) Source: Borland Software Corporation (Mr. Naveed Shaikh, nobody) Nature: Uncategorized Issue Severity: Summary: There was an issue 8969 (Allowing mutual recursion for IDL structures) posted sometime back on CORBA RTF (www.omg.org/issues/issue8969.txt). I am looking for a clarification in the proposed resolution, which allows for the mutual recursion between non-nested structures (CORBA 3.0 specification, section 3.11.2.3). The proposal essentially extends the definition of incompleteness of a struct/union as follows: The original definition was: o A struct/union is termed incomplete until its full definition is provided; that is, until the scope of the struct/union definition is closed by a terminating "}" The introduced proposal added to the original definition: o If a sequence member of a structure or union refers to an incomplete type, the structure or union itself remains incomplete until the member's definition is completed Section 3.11.2.3 also says that "an incomplete type can only appear as the element type of a sequence definition". Question 1: Is following legal under the new scheme? struct Foo; typedef sequence<Foo> FooSeq; struct Bar { FooSeq fs; }; // Bar remains incomplete since it is holding an incomplete sequence type struct FooX { Bar b; // Is this valid with Bar marked incomplete here? }; struct Foo { Bar b; }; // According to the proposal, Foo and Bar are complete now Use of Bar under FooX apparently conflicts with the condition that incomplete type can only appear in a sequence definition. Question 2: Also is it must that there is a mutual recursion between non-nested structures? Consider the following: struct Foo; typedef sequence<Foo> FooSeq; struct Bar { FooSeq fs; }; // Bar remains incomplete struct Foo { long a; }; // Is Bar also complete here when Foo is complete even though Foo doesn't recurse on Bar? Is the above IDL valid under the new proposal? There is no constraint in section 3.11.2.3, which doesn't allow for this so it stands valid as per spec. Was issue 8969 also intended to make such cases valid? Resolution: Revised Text: Actions taken: December 1, 2006: received issue April 11, 2012: Deferred Discussion: End of Annotations:===== ubject: Allowing mutual recursion for IDL structs - clarification needed Date: Fri, 1 Dec 2006 17:30:51 +0800 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Allowing mutual recursion for IDL structs - clarification needed thread-index: AccVK2ROjEv13VyoSGOtW7LLYBc7CQ== From: "Naveed Shaikh" To: , Cc: "Naveed Shaikh" X-OriginalArrivalTime: 01 Dec 2006 09:30:55.0009 (UTC) FILETIME=[66755110:01C7152B] X-TM-AS-Product-Ver: SMEX-7.0.0.1499-3.6.1039-14846.002 X-TM-AS-Result: No--13.802900-8.000000-31 There was an issue 8969 (Allowing mutual recursion for IDL structures) posted sometime back on CORBA RTF (www.omg.org/issues/issue8969.txt). I am looking for a clarification in the proposed resolution, which allows for the mutual recursion between non-nested structures (CORBA 3.0 specification, section 3.11.2.3). The proposal essentially extends the definition of incompleteness of a struct/union as follows: The original definition was: o A struct/union is termed incomplete until its full definition is provided; that is, until the scope of the struct/union definition is closed by a terminating "}" The introduced proposal added to the original definition: o If a sequence member of a structure or union refers to an incomplete type, the structure or union itself remains incomplete until the member's definition is completed Section 3.11.2.3 also says that "an incomplete type can only appear as the element type of a sequence definition". Question 1: Is following legal under the new scheme? struct Foo; typedef sequence FooSeq; struct Bar { FooSeq fs; }; // Bar remains incomplete since it is holding an incomplete sequence type struct FooX { Bar b; // Is this valid with Bar marked incomplete here? }; struct Foo { Bar b; }; // According to the proposal, Foo and Bar are complete now Use of Bar under FooX apparently conflicts with the condition that incomplete type can only appear in a sequence definition. Question 2: Also is it must that there is a mutual recursion between non-nested structures? Consider the following: struct Foo; typedef sequence FooSeq; struct Bar { FooSeq fs; }; // Bar remains incomplete struct Foo { long a; }; // Is Bar also complete here when Foo is complete even though Foo doesn't recurse on Bar? Is the above IDL valid under the new proposal? There is no constraint in section 3.11.2.3, which doesn't allow for this so it stands valid as per spec. Was issue 8969 also intended to make such cases valid?