This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/38839] BIND(C): Allow non-digit/underscore/alphabetic binding names
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Jan 2009 16:01:00 -0000
- Subject: [Bug fortran/38839] BIND(C): Allow non-digit/underscore/alphabetic binding names
- References: <bug-38839-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from burnus at gcc dot gnu dot org 2009-01-14 16:00 -------
And for the universal-character-name, the following compiles with Intel's icc
void \u01ac(void) {
}
and should be valid C99. ICC generates the identifier "_u01ac". Using "gcc
-fextended-identifiers"
it shows up in the .o file as (readelf -a):
8: 0000000000000000 6 FUNC GLOBAL DEFAULT 1 ^^F^354
In the Fortran 2003 standard one finds:
R509 language-binding-spec is BIND (C [, NAME = scalar-char-initialization-expr
])
C540 (R509) The scalar-char-initialization-expr shall be of default character
kind.
That makes it a bit difficult to use UCNs ... From Fortran 2008 (below R508):
"NOTE 5.5
The C International Standard provides a facility for creating C identifiers
whose characters are not restricted to the C basic character set. Such a C
identifier is referred to as a universal character name (6.4.3 of the C
International Standard). The name of such a C identifier might include
characters that are not part of the representation method used by the processor
for default character. If so, the C entity cannot be referenced from Fortran."
Thus currently we only need to worry about '$' and maybe some others.
Optionally supporting non-default character strings and thus UCN might be done
later on (cf. also PR 38838 comment 3).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38839