aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwelinder@troll.com <welinder@troll.com>2004-09-02 12:30:28 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:03:02 -0700
commit8385b6378b563b3552fbb7f42a4bfc692d3e7cf1 (patch)
treef12eb16335007d1dafffc85a6973c8cc72c67e84
parentFix #warning for lines that end up with precisely 1024 characters. (diff)
downloadsparse-8385b6378b563b3552fbb7f42a4bfc692d3e7cf1.tar.gz
sparse-8385b6378b563b3552fbb7f42a4bfc692d3e7cf1.tar.bz2
sparse-8385b6378b563b3552fbb7f42a4bfc692d3e7cf1.zip
Encountering #warning or #error at the wrong spot means that the file
is not constant. Not that it really matters, but still...
-rw-r--r--pre-process.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pre-process.c b/pre-process.c
index eb52e15..696eba4 100644
--- a/pre-process.c
+++ b/pre-process.c
@@ -1260,6 +1260,8 @@ static int handle_warning(struct stream *stream, struct token **line, struct tok
{
if (false_nesting)
return 1;
+ if (stream->constant == CONSTANT_FILE_MAYBE)
+ MARK_STREAM_NONCONST(token->pos);
warn(token->pos, "%s", show_token_sequence(token->next));
return 1;
}
@@ -1268,6 +1270,8 @@ static int handle_error(struct stream *stream, struct token **line, struct token
{
if (false_nesting)
return 1;
+ if (stream->constant == CONSTANT_FILE_MAYBE)
+ MARK_STREAM_NONCONST(token->pos);
warn(token->pos, "%s", show_token_sequence(token->next));
return 1;
}