aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2022-03-22 01:09:50 -0700
committerMichael Forney <mforney@mforney.org>2022-03-22 01:58:31 -0700
commit2c0de069da49d84c6b03eb6a8519deeaedc598e8 (patch)
tree33dfe7fb113e238d565219d033f653c898c1a97b
parent9b786ac07e130d779626e02486bb9988ef97a0ce (diff)
downloadcproc-2c0de069da49d84c6b03eb6a8519deeaedc598e8.tar.xz
pp: Ignore pragmas
The standard says we should ignore any pragmas that we don't recognize.
-rw-r--r--pp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pp.c b/pp.c
index 110ff66..a819cb0 100644
--- a/pp.c
+++ b/pp.c
@@ -352,7 +352,8 @@ line:
} else if (strcmp(name, "error") == 0) {
error(&tok.loc, "#error directive is not implemented");
} else if (strcmp(name, "pragma") == 0) {
- error(&tok.loc, "#pragma directive is not implemented");
+ while (tok.kind != TNEWLINE && tok.kind != TEOF)
+ next();
} else {
error(&tok.loc, "invalid preprocessor directive #%s", name);
}