summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2010-05-26 08:09:29 -0700
committerCarl Worth <cworth@cworth.org>2010-05-26 08:09:29 -0700
commitd5cd40343f4a83d3270cb87ef38e85dcb9682e8c (patch)
treee2eee8447e60f48718890556132407a93a2ab8d0
parent0197e9b64f0e64a617537c5ad1465b4a8706fe1c (diff)
Expand macro arguments before performing argument substitution.
As required by the C99 specification of the preprocessor. With this fix, tests 33 through 36 now pass.
-rw-r--r--glcpp-parse.y9
1 files changed, 5 insertions, 4 deletions
diff --git a/glcpp-parse.y b/glcpp-parse.y
index e25cfa9..3b736f8 100644
--- a/glcpp-parse.y
+++ b/glcpp-parse.y
@@ -854,10 +854,11 @@ _glcpp_parser_expand_function_onto (glcpp_parser_t *parser,
token_list_t *argument;
argument = _argument_list_member_at (arguments,
parameter_index);
- for (j = argument->head; j; j = j->next)
- {
- _token_list_append (substituted, j->token);
- }
+ /* Before substituting, we expand the argument
+ * tokens. */
+ _glcpp_parser_expand_token_list_onto (parser,
+ argument,
+ substituted);
} else {
_token_list_append (substituted, i->token);
}