aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-lex.c
diff options
context:
space:
mode:
authorEric Christopher <echristo@gcc.gnu.org>2004-02-27 02:01:10 +0000
committerEric Christopher <echristo@gcc.gnu.org>2004-02-27 02:01:10 +0000
commit2152660651dd8d705e788e30dc9e6baa68706ab3 (patch)
treee038a62a69bfb1693a9ec4eefdb706a3fe353e15 /gcc/c-lex.c
parent26d8bbbbc39d3621e926b393138125800a5dc90a (diff)
downloadgcc-2152660651dd8d705e788e30dc9e6baa68706ab3.zip
gcc-2152660651dd8d705e788e30dc9e6baa68706ab3.tar.gz
gcc-2152660651dd8d705e788e30dc9e6baa68706ab3.tar.bz2
target-supports.exp (check-iconv-available): New function.
2004-02-26 Eric Christopher <echristo@redhat.com> * lib/target-supports.exp (check-iconv-available): New function. * lib/gcc-dg.exp (dg-require-iconv): New function. Use above. * gcc.dg/charset: New directory. * gcc.dg/charset/charset.exp: New file. * gcc.dg/charset/asm1.c: Ditto. * gcc.dg/charset/asm2.c: Ditto. * gcc.dg/charset/asm3.c: Ditto. * gcc.dg/charset/asm4.c: Ditto. * gcc.dg/charset/asm5.c: Ditto. * gcc.dg/charset/attribute1.c: Ditto. * gcc.dg/charset/attribute2.c: Ditto. * gcc.dg/charset/string1.c: Ditto. * g++.dg/charset: New directory. * g++.dg/dg.exp: Add here. Special options. * g++.dg/charset/charset.exp: New file. * g++.dg/charset/asm1.c: Ditto. * g++.dg/charset/asm2.c: Ditto. * g++.dg/charset/asm3.c: Ditto. * g++.dg/charset/asm4.c: Ditto. * g++.dg/charset/attribute1.c: Ditto. * g++.dg/charset/attribute2.c: Ditto. * g++.dg/charset/extern1.cc: Ditto. * g++.dg/charset/extern2.cc: Ditto. * g++.dg/charset/string1.c: Ditto. 2004-02-26 Eric Christopher <echristo@redhat.com> * c-lex.c (c_lex_string_translate): New variable. (lex_string): Use to determine string translation. * c-pragma.h: Prototype. * c-parse.in (start_string_translation): New. Set above. (stop_string_translation): Ditto. (attribute, attribute_list, asm_def, asm_stmt, asm_operand): Use above functions. * cp/parser.c (cp_parser_declaration): Translate strings unless token is RID_EXTERN. Set c_lex_string_translate for recursive use. (cp_parser_asm_definition): Only translate argument strings to asms. (cp_parser_asm_operand_list): Ditto. (cp_parser_attribute_list): Do not translate attribute strings. From-SVN: r78548
Diffstat (limited to 'gcc/c-lex.c')
-rw-r--r--gcc/c-lex.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index cbd5573..3986b27 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -54,6 +54,7 @@ static splay_tree file_info_tree;
int pending_lang_change; /* If we need to switch languages - C++ only */
int c_header_level; /* depth in C headers - C++ only */
+bool c_lex_string_translate = true; /* If we need to translate characters received. */
static tree interpret_integer (const cpp_token *, unsigned int);
static tree interpret_float (const cpp_token *, unsigned int);
@@ -308,7 +309,7 @@ get_nonpadding_token (void)
timevar_pop (TV_CPP);
return tok;
-}
+}
int
c_lex_with_flags (tree *value, unsigned char *cpp_flags)
@@ -675,7 +676,7 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string)
if (tok->type == CPP_WSTRING)
wide = true;
obstack_grow (&str_ob, &tok->val.str, sizeof (cpp_string));
-
+
tok = get_nonpadding_token ();
if (c_dialect_objc () && tok->type == CPP_ATSIGN)
{
@@ -693,7 +694,9 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string)
if (count > 1 && !objc_string && warn_traditional && !in_system_header)
warning ("traditional C rejects string constant concatenation");
- if (cpp_interpret_string (parse_in, strs, count, &istr, wide))
+ if ((c_lex_string_translate
+ ? cpp_interpret_string : cpp_interpret_string_notranslate)
+ (parse_in, strs, count, &istr, wide))
{
value = build_string (istr.len, (char *)istr.text);
free ((void *)istr.text);