Reserved names in C++ [Was: Re: mingw __dllexport__]

Roberto Bagnara bagnara@cs.unipr.it
Thu, 14 Nov 2002 07:21:09 +0100


Kevin Ryde wrote:
> Have to change the way __GMP_DECLSPEC is arranged.

I don't know if strict conformance to standards is one of GMP's goals.
If it is, it would be better to avoid using names that are reserved
to the language's implementation.  I enclose below an excerpt from the
C++ standard.
All the best

     Roberto

-- 
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara@cs.unipr.it


17.4.3.1.2 Global names                           [lib.global.names]

  1 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 upper-case letter (2.11) 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. 165)

-------- Footnotes
165) Such names are also reserved in namespace ::std (17.4.3.1).