aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1997-02-16 08:08:25 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1997-02-16 08:08:25 -0500
commit4c8cc616fa702df12354cc06b39f059f9f1c56f8 (patch)
tree4db8aef064f578d498e14c4a1e8bc1694c195d60 /gcc
parent21f18241344b658711a5668f376243884ed92e2f (diff)
downloadgcc-4c8cc616fa702df12354cc06b39f059f9f1c56f8.zip
gcc-4c8cc616fa702df12354cc06b39f059f9f1c56f8.tar.gz
gcc-4c8cc616fa702df12354cc06b39f059f9f1c56f8.tar.bz2
(special_symbol, check_macro_name, collect_expansion): Don't treat "L"
in "L'...'" as identifier. From-SVN: r13660
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cpplib.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index 7bc5c8c..0c0e663 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -1,6 +1,6 @@
/* CPP Library.
Copyright (C) 1986, 87, 89, 92-6, 1997 Free Software Foundation, Inc.
- Written by Per Bothner, 1994-95.
+ Contributed by Per Bothner, 1994-95.
Based on CCCP program by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
@@ -1308,7 +1308,8 @@ collect_expansion (pfile, buf, limit, nargs, arglist)
Don't leave the # in the expansion. */
exp_p--;
SKIP_WHITE_SPACE (p);
- if (p == limit || ! is_idstart[*p])
+ if (p == limit || ! is_idstart[*p]
+ || (*p == 'L' && p + 1 < limit && (p[1] == '\'' || p[1] == '"')))
cpp_error (pfile,
"`#' operator is not followed by a macro argument name");
else
@@ -1369,7 +1370,8 @@ collect_expansion (pfile, buf, limit, nargs, arglist)
while (p != limit && is_idchar[*p]) p++;
id_len = p - id_beg;
- if (is_idstart[c]) {
+ if (is_idstart[c]
+ && ! (id_len == 1 && c == 'L' && (*p == '\'' || *p == '"'))) {
register struct arglist *arg;
for (arg = arglist; arg != NULL; arg = arg->next) {
@@ -1667,7 +1669,8 @@ check_macro_name (pfile, symname, usage)
for (p = symname; is_idchar[*p]; p++)
;
sym_length = p - symname;
- if (sym_length == 0)
+ if (sym_length == 0
+ || (sym_length == 1 && *symname == 'L' && (*p == '\'' || *p == '"')))
cpp_error (pfile, "invalid %s name", usage);
else if (!is_idstart[*symname]) {
U_CHAR *msg; /* what pain... */
@@ -2417,6 +2420,8 @@ special_symbol (hp, pfile)
if (!is_idstart[*ip->cur])
goto oops;
+ if (ip->cur[0] == 'L' && (ip->cur[1] == '\'' || ip->cur[1] == '"'))
+ goto oops;
if (hp = cpp_lookup (pfile, ip->cur, -1, -1))
{
#if 0