Commit c29a4cbc by Richard Kenner

(collect_expansion): If traditional...

(collect_expansion): If traditional, set stringify member to
SHARP_TOKEN regardless of the value of stringify_sharp_token_type.

From-SVN: r9334
parent cceb347c
...@@ -6125,18 +6125,26 @@ collect_expansion (buf, end, nargs, arglist) ...@@ -6125,18 +6125,26 @@ collect_expansion (buf, end, nargs, arglist)
if (arg->name[0] == c if (arg->name[0] == c
&& arg->length == id_len && arg->length == id_len
&& bcmp (arg->name, id_beg, id_len) == 0) { && bcmp (arg->name, id_beg, id_len) == 0) {
if (expected_delimiter && warn_stringify) { enum sharp_token_type tpat_stringify;
if (traditional) { if (expected_delimiter) {
warning ("macro argument `%.*s' is stringified.", if (warn_stringify) {
id_len, arg->name); if (traditional) {
} else { warning ("macro argument `%.*s' is stringified.",
warning ("macro arg `%.*s' would be stringified with -traditional.", id_len, arg->name);
id_len, arg->name); } else {
warning ("macro arg `%.*s' would be stringified with -traditional.",
id_len, arg->name);
}
} }
/* If ANSI, don't actually substitute inside a string. */
if (!traditional)
break;
tpat_stringify = SHARP_TOKEN;
} else {
tpat_stringify
= (stringify == id_beg
? stringify_sharp_token_type : NO_SHARP_TOKEN);
} }
/* If ANSI, don't actually substitute inside a string. */
if (!traditional && expected_delimiter)
break;
/* make a pat node for this arg and append it to the end of /* make a pat node for this arg and append it to the end of
the pat list */ the pat list */
tpat = (struct reflist *) xmalloc (sizeof (struct reflist)); tpat = (struct reflist *) xmalloc (sizeof (struct reflist));
...@@ -6145,9 +6153,7 @@ collect_expansion (buf, end, nargs, arglist) ...@@ -6145,9 +6153,7 @@ collect_expansion (buf, end, nargs, arglist)
= concat == id_beg ? concat_sharp_token_type : NO_SHARP_TOKEN; = concat == id_beg ? concat_sharp_token_type : NO_SHARP_TOKEN;
tpat->raw_after = NO_SHARP_TOKEN; tpat->raw_after = NO_SHARP_TOKEN;
tpat->rest_args = arg->rest_args; tpat->rest_args = arg->rest_args;
tpat->stringify tpat->stringify = tpat_stringify;
= ((traditional ? expected_delimiter : stringify == id_beg)
? stringify_sharp_token_type : NO_SHARP_TOKEN);
if (endpat == NULL) if (endpat == NULL)
defn->pattern = tpat; defn->pattern = tpat;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment