diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-09-20 20:31:37 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-09-20 20:31:37 +0000 |
commit | 865c4e44475a4e78fef3deb41aef6152793ce596 (patch) | |
tree | 00694b7f29cada5340d6da00c4838abdd73404a6 /gcc/doc/cpp.texi | |
parent | 73a991443f15b27ad2705034699beec4ff8106c6 (diff) | |
download | gcc-865c4e44475a4e78fef3deb41aef6152793ce596.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104462 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/doc/cpp.texi')
-rw-r--r-- | gcc/doc/cpp.texi | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi index f5f29a6397b..c019adbac67 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, |