aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
authorAl Viro <viro@ftp.linux.org.uk>2007-05-25 04:57:39 +0100
committerJosh Triplett <josh@freedesktop.org>2007-05-26 17:38:30 -0700
commit79c710e888c8e1b35df69df2b49eaad9d7b4eab3 (patch)
tree713bab457c2ae8195b3a34bfbbdf8dd0eaf7d57f
parent6f85533c740fed63cc5da96e4ccef7f418ca29fc (diff)
downloadsparse-dev-79c710e888c8e1b35df69df2b49eaad9d7b4eab3.tar.gz
check for whitespace before object-like macro body
6.10.3(3) requires a whitespace between object-like macro and its replacement list. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--pre-process.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/pre-process.c b/pre-process.c
index 2b9cecc6..8fca3835 100644
--- a/pre-process.c
+++ b/pre-process.c
@@ -1089,11 +1089,16 @@ static int do_handle_define(struct stream *stream, struct token **line, struct t
arglist = NULL;
expansion = left->next;
- if (!expansion->pos.whitespace && match_op(expansion, '(')) {
- arglist = expansion;
- expansion = parse_arguments(expansion);
- if (!expansion)
- return 1;
+ if (!expansion->pos.whitespace) {
+ if (match_op(expansion, '(')) {
+ arglist = expansion;
+ expansion = parse_arguments(expansion);
+ if (!expansion)
+ return 1;
+ } else if (!eof_token(expansion)) {
+ warning(expansion->pos,
+ "no whitespace before object-like macro body");
+ }
}
expansion = parse_expansion(expansion, arglist, name);