From 2c0de069da49d84c6b03eb6a8519deeaedc598e8 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 22 Mar 2022 01:09:50 -0700 Subject: pp: Ignore pragmas The standard says we should ignore any pragmas that we don't recognize. --- pp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } -- cgit v1.2.3