Issue 104: Problems with underscores (c_mapping-rtf) Source: (, ) Nature: Uncategorized Severity: Summary: Summary: The C mapping advises avoiding the indiscriminate use of underscores in identifiers. To whom is this addressed? Should it be a more general restriction? Resolution: resolved Revised Text: Existing sentence 19.2 v 2.2 Due to such ambiguities, it is advisable to avoid the indiscriminate use of underscores in identifiers. replace with Due to such ambiguities, IDL developers targeting C language should avoid indiscriminate use of underscores in identifiers or consider how the language mapping will construct C language names. Actions taken: September 11, 1996: Received issue December 12, 1996: moved from cxx_revision to c-rev-wg October 5, 2000: closed issue Discussion: End of Annotations:===== From geoff Wed Sep 11 13:24:42 1996 Received: by amethyst.omg.org.omg.org (5.4R2.01/1.34) id AA05241; Wed, 11 Sep 1996 13:24:42 -0400 Date: Wed, 11 Sep 1996 13:24:42 -0400 From: geoff (Geoffrey Speare) Message-Id: <9609111724.AA05241@amethyst.omg.org.omg.org> To: issue-logger@omg.org Subject: C Mapping: problems with underscores X-Omg-Issue: 104 Date: Mon, 9 Sep 1996 17:04:44 PDT Sender: Bill Janssen From: Bill Janssen To: issues@omg.org Subject: C Mapping: problems with underscores Cc: orbos@omg.org In section 14.2 of the CORBA C mapping, there is an explanation of how the C mapping for type names can easily be confused, due to the permissibility of underscores in the IDL type names, and their similar use in the C type names. This section includes the statement, ``Due to such ambiguities, it is advisable to avoid the indiscriminate use of underscores in identifiers.'' To whom is this statement addressed? The user of the C mapping can't influence how the (perhaps COBOL-thinking) designer, of the IDL he happens to have to use, used underscores. Shouldn't either the C mapping be fixed to not have this unfortunate confusion, or the use of underscores in OMG IDL be eliminated or somehow curtailed? Bill >From mail Thu Oct 31 13:17 EST 1996 Date: 31 Oct 96 09:58:59 -0800 From: "KCOLEMAN.US.ORACLE.COM" To: c-rev-wg@omg.org Subject: Comments on current C issues Content-Length: 4445 Some comments on the issues Bill has posted on his Web page: Issue 104 - Underscores in IDL identifiers --------- I do not believe it is reasonable to change the IDL definition at this point to preclude the use of underscores in identifiers. I don't think problems in the C mapping justify breaking existing IDL. If it really seems inappropriate, I'd favor striking the statement. On the other hand, it isn't entirely out of line either. I have users writing IDL and implementing servers exclusively in C. They certainly have control over the use of underscores in their own IDL, and they've learned the hard way just how difficult it is to unravel the mess made by underscores in IDL identifiers. I'd like to tatoo this warning across their foreheads. Date: Mon, 13 Mar 2000 18:11:24 -0500 From: "Barker, Thomas" Subject: Issues to be discused and voted by 3/24/2000(COB) To: "'C-RFT'" Message-id: <99AA2270B1E6D111BCE10000F805F17F043EB1FD@emss35m02.owg.fs.lmco.com> MIME-version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-transfer-encoding: 7BIT Content-Type: text/plain; charset=iso-8859-1 X-UIDL: K,Ie9SN0!!?]7!!*@,!! I want to start making some progress on the C RTF (I aplologize for not getting to it earlier, but it been a bad fall and winter). I think that many of the issues can be dealt with quickly so I propose to try to kill about 10 per week for the next couple of months. This batch seemed typical. I just took the first 10 from the list at http://www.omg.org/issues/c_mapping-rtf.html. I'd think the requirement for a vote by 3/24 seems reasonable, but if I discusion between now and 3/17 indicates that any particular issue(s) are not agreeable to everyone I will pull that issue(s) from the list to be voted in this batch. I have gone through the issues, copied the name and summary sentence into this note, then proposed a resolution for each. Tom Issue 53: C keywords Summary: There seems to be no provision for the possibility of C keywords appearing in IDL. Discussion - I think this refers to fact that the C++ Language binding has a paragraph addressing this topic and C does not. I propose we include the C++ paragraph in the C Language Binding almost verbatim and add it to section 1.2. We will have to generate the required table as a section 1.2.1. The new paragraph will be: "To avoid C compilation problems, every use in OMG IDL of a C keyword as an identifier is mapped into the same name preceeded by the prefix "_cxx_". For example, an IDL interface named "case" would be named "_cxx_case" when it is mapped into C. For consistency, this rule also applies to identifiers that are derived from IDL identifiers. For example, an IDL interface "case" generates the names "_cxx_case_var" and "_cxx_case_ptr", that is, the IDL compiler behaves as if the interfaces were named "cxx_try" and then applies the normal mapping rules. The complete list of C keywords can be found in Section 1.xx on page 1-xxx. " The only objection to this might be the use of _cxx_ as the prefix. I argue that the common name would allow more interactions between C and C++ modules, particularly for those of us that use a common ORB for both languages. However, I could easily be talked out of that position. Issue 104: Problems with underscores Summary: The C mapping advises avoiding the indiscriminate use of underscores in identifiers. To whom is this addressed? Should it be a more general restriction? Current sentence - "Due to such ambiguities, it is advisable to avoid the indiscriminate use of underscores in identifiers." paragraph 1.2 Scoped Names Discussion - I could argue that the sentence is adequate, as it appears directly under an example where defined IDL would have resulted in duplicate names. We could however clarify it with the extended sentence: "Due to such ambiguities, IDL developers targeting C language should avoid indiscriminate use of underscores in identifiers or consider how the language mapping will construct C language names."