diff options
author | Michael Forney <mforney@mforney.org> | 2022-03-22 01:09:50 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2022-03-22 01:58:31 -0700 |
commit | 2c0de069da49d84c6b03eb6a8519deeaedc598e8 (patch) | |
tree | 33dfe7fb113e238d565219d033f653c898c1a97b | |
parent | 9b786ac07e130d779626e02486bb9988ef97a0ce (diff) | |
download | cproc-2c0de069da49d84c6b03eb6a8519deeaedc598e8.tar.xz |
pp: Ignore pragmas
The standard says we should ignore any pragmas that we don't
recognize.
-rw-r--r-- | pp.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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); } |