aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc/cpp.texi
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2005-09-20 21:31:37 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2005-09-20 21:31:37 +0100
commitaf15a2fed76b5da2faf0c2ee9e052923c7562e8f (patch)
tree00694b7f29cada5340d6da00c4838abdd73404a6 /gcc/doc/cpp.texi
parent6fff2603132ecacd4e5cdd97ea92ab5443de613f (diff)
downloadgcc-af15a2fed76b5da2faf0c2ee9e052923c7562e8f.zip
gcc-af15a2fed76b5da2faf0c2ee9e052923c7562e8f.tar.gz
gcc-af15a2fed76b5da2faf0c2ee9e052923c7562e8f.tar.bz2
c.opt (fextended-identifiers): New.
gcc: * c.opt (fextended-identifiers): New. * c-opts.c (c_common_handle_option): Handle -fextended-identifiers. * doc/cpp.texi: Update documentation of extended identifiers. * doc/cppopts.texi (-fextended-identifiers): Document. gcc/testsuite: * g++.dg/cpp/ucnid-1.C, g++.dg/cpp/normalize-1.C, g++.dg/other/ucnid-1.C, gcc.dg/cpp/normalize-1.c, gcc.dg/cpp/normalize-2.c, gcc.dg/cpp/normalize-3.c, gcc.dg/cpp/normalize-4.c, gcc.dg/cpp/ucnid-1.c, gcc.dg/cpp/ucnid-2.c, gcc.dg/cpp/ucnid-3.c, gcc.dg/cpp/ucnid-4.c, gcc.dg/cpp/ucnid-5.c, gcc.dg/cpp/ucnid-7.c,gcc.dg/ucnid-1.c, gcc.dg/ucnid-2.c, gcc.dg/ucnid-3.c, gcc.dg/ucnid-4.c, gcc.dg/ucnid-5.c, gcc.dg/ucnid-6.c: Add -fextended-identifiers. * gcc.dg/cpp/ucnid-8.c: New test. libcpp: * include/cpplib.h (struct cpp_options): Add extended_identifiers. * init.c (struct lang_flags, lang_defaults): Add extended_identifiers. (cpp_set_lang): Use it. * lex.c (forms_identifier_p): Check extended_identifiers. From-SVN: r104462
Diffstat (limited to 'gcc/doc/cpp.texi')
-rw-r--r--gcc/doc/cpp.texi18
1 files changed, 11 insertions, 7 deletions
diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi
index f5f29a6..c019adb 100644
--- a/gcc/doc/cpp.texi
+++ b/gcc/doc/cpp.texi
@@ -281,11 +281,11 @@ the character in the source character set that they represent, then
converted to the execution character set, just like unescaped
characters.
+Unless the experimental @option{-fextended-identifiers} option is used,
GCC does not permit the use of characters outside the ASCII range, nor
-@samp{\u} and @samp{\U} escapes, in identifiers. We hope this will
-change eventually, but there are problems with the standard semantics
-of such ``extended identifiers'' which must be resolved through the
-ISO C and C++ committees first.
+@samp{\u} and @samp{\U} escapes, in identifiers. Even with that
+option, characters outside the ASCII range can only be specified with
+the @samp{\u} and @samp{\U} escapes, not used directly in identifiers.
@node Initial processing
@section Initial processing
@@ -510,8 +510,10 @@ In the 1999 C standard, identifiers may contain letters which are not
part of the ``basic source character set'', at the implementation's
discretion (such as accented Latin letters, Greek letters, or Chinese
ideograms). This may be done with an extended character set, or the
-@samp{\u} and @samp{\U} escape sequences. GCC does not presently
-implement either feature in the preprocessor or the compiler.
+@samp{\u} and @samp{\U} escape sequences. The implementation of this
+feature in GCC is experimental; such characters are only accepted in
+the @samp{\u} and @samp{\U} forms and only if
+@option{-fextended-identifiers} is used.
As an extension, GCC treats @samp{$} as a letter. This is for
compatibility with some systems, such as VMS, where @samp{$} is commonly
@@ -3791,7 +3793,9 @@ character set may be controlled by the user, with the
The C and C++ standards allow identifiers to be composed of @samp{_}
and the alphanumeric characters. C++ and C99 also allow universal
character names, and C99 further permits implementation-defined
-characters.
+characters. GCC currently only permits universal character names if
+@option{-fextended-identifiers} is used, because the implementation of
+universal character names in identifiers is experimental.
GCC allows the @samp{$} character in identifiers as an extension for
most targets. This is true regardless of the @option{std=} switch,