[Patch, Fortran, OOP] PR 46313: OOP-ABI issue, ALLOCATE issue, CLASS renaming issue
Tobias Schlüter
tobias.schlueter@physik.uni-muenchen.de
Sun Nov 7 16:52:00 GMT 2010
On 2010-11-07 16:49, Janus Weil wrote:
> Btw, what is the reason for the macro adding *two* underscores in
> front, instead of just one?
I got curious and did some googling. Tthe C standard has this:
7.1.3 Reserved identifiers
Each header declares or defines all identifiers listed in its
associated subclause, and optionally declares or defines identifiers
listed in its associated future library directions subclause and
identifiers which are always reserved either for any use or for use as
file scope identifiers.
* All identifiers that begin with an underscore and either an
uppercase letter or another underscore are always reserved for any use.
...
So if the compiler can't use a character the user can't put into
identifiers ('.' or '$'), it reverts to something that isn't allowed to
put into identifiers: two underscores in the beginning. I think the
lesson for us is: '.' and '$' aren't portable.
Cheers,
- Tobi
More information about the Gcc-patches
mailing list