summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Worth <[email protected]>2010-06-02 15:49:54 -0700
committerCarl Worth <[email protected]>2010-06-02 15:49:54 -0700
commit14c98a56442a076a831aee85e9b3e54d934ec360 (patch)
tree257cda3d9cec00b24fa5471879c9e17a6c4655f2
parent22b3aced03c1a243ba03fbcba5aa51f97e4f0abb (diff)
Restore error message for a macro with unbalanced parentheses.
We had to remove this earlier because our recursive function calls caused the same nodes to be examined for expansion more than once. And in the test suite, one node would be examined before it had its closing parenthesis and then again later after the parenthesis was added. So we removed this error message to allow the test case to pass. Now that we've removed the unnecessary recursive function call we can catch this error case and report it as desired.
-rw-r--r--glcpp-parse.y5
1 files changed, 4 insertions, 1 deletions
diff --git a/glcpp-parse.y b/glcpp-parse.y
index 1c7c84dac7a..b07714eebd2 100644
--- a/glcpp-parse.y
+++ b/glcpp-parse.y
@@ -956,7 +956,7 @@ typedef enum function_status
* Macro name not followed by a '('. This is not an error, but
* simply that the macro name should be treated as a non-macro.
*
- * FUNCTION_UNBLANCED_PARENTHESES
+ * FUNCTION_UNBALANCED_PARENTHESES
*
* Macro name is not followed by a balanced set of parentheses.
*/
@@ -1065,6 +1065,9 @@ _glcpp_parser_expand_function (glcpp_parser_t *parser,
case FUNCTION_NOT_A_FUNCTION:
return NULL;
case FUNCTION_UNBALANCED_PARENTHESES:
+ fprintf (stderr, "Error: Macro %s call has unbalanced parentheses\n",
+ identifier);
+ exit (1);
return NULL;
}