aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1994-11-28 16:53:27 -0800
committerJim Wilson <wilson@gcc.gnu.org>1994-11-28 16:53:27 -0800
commit94d681a0a7915475bff8953cc5e5abb182f2022a (patch)
treefe9dc31fc74372938c9d10e34209651f09236b07 /gcc
parentdc93cff0eaaa60fee343e43cea804a5279ca2921 (diff)
downloadgcc-94d681a0a7915475bff8953cc5e5abb182f2022a.zip
gcc-94d681a0a7915475bff8953cc5e5abb182f2022a.tar.gz
gcc-94d681a0a7915475bff8953cc5e5abb182f2022a.tar.bz2
(create_definition): Error if comma not followed by an identifier.
(create_definition): Error if comma not followed by an identifier. (collect_expansion): Error if # used in macro with no arguments. From-SVN: r8567
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cccp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/cccp.c b/gcc/cccp.c
index 58a8236..3e6379a 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -5375,6 +5375,11 @@ create_definition (buf, limit, op)
if (*bp == ',') {
bp++;
SKIP_WHITE_SPACE (bp);
+ /* A comma at this point can only be followed by an identifier. */
+ if (!is_idstart[*bp]) {
+ error ("badly punctuated parameter list in `#define'");
+ goto nope;
+ }
}
if (bp >= limit) {
error ("unterminated parameter list in `#define'");
@@ -5776,7 +5781,7 @@ collect_expansion (buf, end, 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] || nargs == 0)
error ("`#' operator is not followed by a macro argument name");
else
stringify = p;