Issue 2563: Content of an Any is a pointer to the type -- Issue (c_mapping-rtf) Source: (, ) Nature: Uncategorized Issue Severity: Summary: Summary: In PIN4O.00001 OMG have ruled that the content of an any is a pointer to the type. So a long in an Any looks like this; any ----> long But what about strings? As this type includes a pointer part itself the above rules would make the following appear to be the conformant case; any----> ptr to string -----> string : option 1 Having a pointer to a pointer is a bit unwieldy but appears to follow the rules. Collapsing this to simply a pointer to the str thus; any----> string : option 2 is more natural for programmers but ambiguous within the spec. We would like to know which of these two options is correct. Section C - Interpretation Responses The Open Group Initial Response: This request is being sent for review by OMG. We request that OMG rule which of the two options is correct or whether both are equally so. Consultants Initial Response: We recommend this request be sent to OMG for a binding interpretation. We recommend a PIN be granted to clarify the requirements for branding irrespective of which of the two options OMG selects. Resolution: urgent resolution, issue closed Revised Text: Resolution: Add the following sentence to v 2.3 standard in section 19.7 Mapping for Basic Data Types after the sentence: "TypeCodes are described in "TypeCodes" on page 8-35/ The _value member for an any is a pointer to the actual value of the datum." "Note that this holds true when the datum is itself implemented as a pointer, e.g. in the case of a CORBA string, the _value member would be a pointer(CORBA_char**) to string(CORBA_char*)." Actions taken: March 30, 1999: received issue August 4, 1999: closed issue Discussion: End of Annotations:===== X-Sender: andrew@emerald.omg.org Date: Tue, 30 Mar 1999 11:39:38 -0500 To: issues@omg.org From: Andrew Watson Subject: TOG issue req.1.O.00011 Cc: c_mapping-rtf@omg.org Component: CORBA Section B - Interpretation Request Details Version/Release: VSORB 1.1.0 Testset: iiop/all/all Test No: 0 Waiver Reason: Grey area in the Specification Test Results: not applicable Additional Commentary: In PIN4O.00001 OMG have ruled that the content of an any is a pointer to the type. So a long in an Any looks like this; any ----> long But what about strings? As this type includes a pointer part itself the above rules would make the following appear to be the conformant case; any----> ptr to string -----> string : option 1 Having a pointer to a pointer is a bit unwieldy but appears to follow the rules. Collapsing this to simply a pointer to the str thus; any----> string : option 2 is more natural for programmers but ambiguous within the spec. We would like to know which of these two options is correct. Section C - Interpretation Responses The Open Group Initial Response: This request is being sent for review by OMG. We request that OMG rule which of the two options is correct or whether both are equally so. Consultants Initial Response: We recommend this request be sent to OMG for a binding interpretation. We recommend a PIN be granted to clarify the requirements for branding irrespective of which of the two options OMG selects. X-My-Real-Login-Name: sugino; 10.35.109.43 Date: Thu, 01 Apr 1999 18:23:54 +0900 From: Yasuaki Sugino To: Juergen Boldt , issues@emerald.omg.org, c_mapping-rtf@emerald.omg.org References: <3.0.32.19990331102658.006f6b0c@emerald.omg.org> Subject: Re: issue 2563 -- C mapping RTF Issue -- URGENT Hi, members, Juergen Boldt wrote Wed, 31 Mar 1999 10:26:59 -0500 Subject : issue 2563 -- C mapping RTF Issue -- URGENT Juergen> This is issue # 2563 Juergen> Juergen> Content of an Any is a pointer to the type -- Issue Juergen> Juergen> In PIN4O.00001 OMG have ruled that the content of an any is a Juergen> pointer to the type. So a long in an Any looks like this; Juergen> Juergen> any ----> long Yes. You are correct on above part. Any has a pointer to a long type instance. Juergen> Juergen> But what about strings? As this type includes a pointer part Juergen> itself the above rules would make the following appear to be the Juergen> conformant case; Juergen> Juergen> any----> ptr to string -----> string : option 1 Juergen> Is that conformant case !? Why do you think so complexly ? I don't think so. Juergen> Having a pointer to a pointer is a bit unwieldy but appears to follow Juergen> the rules. Collapsing this to simply a pointer to the str thus; Juergen> Juergen> any----> string : option 2 Juergen> Juergen> is more natural for programmers but ambiguous within the spec. I believe option 2 conforms to CORBA specification. "17.12 Mapping for Strings" of CORBA 2.1 specification states: "OMG IDL strings are mapped to 0-byte terminated character arrays." This sentence means that string type does *not* includes a pointer part. String type has just a character array. Since C language can't help treating a character array as a pointer(char*), in other words, the pointer is used as an expression of string type instance, it seems string type includes a pointer part, but that is only a surface impression. In option 2, Any has a pointer to a string type instance. Since string type has just a character array as CORBA specification states, I believe option 2 is correct. I would like to vote for option 2. ----- Best Regards Yasuaki SUGINO FUJITSU LIMITED X-Sender: andrew@emerald.omg.org Date: Fri, 9 Apr 1999 19:51:21 -0400 To: Jenny Wilkinson From: Andrew Watson Subject: Re: review of req.1.O.00011 (OMG issue 2563) Cc: ogomgorb@rdg.opengroup.org, issues@omg.org, c_mapping-rtf@omg.org Jenny, You wrote: > INTERPRETATION REQUEST DOCUMENT TOG Reference: req.1.O.00011 Here is the OMG reply to your interpretation request: > Additional Commentary: > In PIN4O.00001 OMG have ruled that the content of an any is a > pointer to the type. So a long in an Any looks like this; > > any ----> long > > But what about strings? As this type includes a pointer part > itself the above rules would make the following appear to be > the > conformant case; > > any----> ptr to string -----> string : option 1 > > Having a pointer to a pointer is a bit unwieldy but appears to > follow > the rules. Collapsing this to simply a pointer to the str thus; > > any----> string : option 2 > > is more natural for programmers but ambiguous within the spec. > > We would like to know which of these two options is correct. In response to this issue, the C mapping RTF passed the following resolution: Add the following sentence to v 2.3 standard in section 19.7 Mapping for Basic Data Types after the sentence: "TypeCodes are described in "TypeCodes" on page 8-35/ The _value member for an any is a pointer to the actual value of the datum." "Note that this holds true when the datum is itself implemented as a pointer, e.g. in the case of a CORBA string, the _value member would be a pointer(CORBA_char**) to string(CORBA_char*)." Regards, Andrew Andrew Watson Tel: +1 508 820 4300 x111 Vice President & Technical Director, Fax: +1 508 820 4303 Object Management Group, Email: andrew@omg.org 492 Old Connecticut Path, Lat/Lon: 42.3122 N 71.3927 W Framingham, MA 01701, USA http://www.omg.org/~andrew