Menu

#1008 Generated identifiers contain double underscores which are reserved names

v1.0 (example)
closed-rejected
nobody
None
5
2015-06-03
2015-06-02
No

The generated names for the structures, enumerators and structure members created with soapcpp2 contain double underscores (e.g. ns__data). Such names are reserved for the C or C++ implementation, and thus should not be used in programs.

gSoap therefore needs to generate alternate names that do not contain double underscores.

Discussion

  • Robert van Engelen

    This has been thoroughly tested with compiler developers for over a decade and never had trouble with compiling and linking (naming conventions reflect linkage rules). The way the double underscores are introduced (e.g. within names, after alphanums) is generally fine.

     
    • Anthony Williams

      I was having a discussion with one of the gcc standard library developers last month, and they said that they really wished users would stop using the reserved names in their programs, as it limits their ability to choose names for the library internals.

      It may not have caused a problem in the past, but that doesn't mean it won't in the future.

      The C++ standard says:

      "17.6.4.3.2 Global names
      [global.names]
      Certain sets of names and function signatures are always reserved to the implementation:
      — Each name that contains a double underscore _ _ or begins with an underscore followed by an uppercase
      letter (2.12) is reserved to the implementation for any use.
      — Each name that begins with an underscore is reserved to the implementation for use as a name in the
      global namespace."

      I strongly suggest that you reconsider this.

       
  • Robert van Engelen

    • status: open --> closed-rejected
     

Log in to post a comment.