aboutsummaryrefslogtreecommitdiffhomepage
path: root/c/lex.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-11-22 11:01:46 +0100
committerlemon <lsof@mailbox.org>2025-11-22 12:26:29 +0100
commit4444c247ea8b906f511864bcfb3ce62ed9653ba3 (patch)
tree5da1018b83f384927b0f02f486cfe4d34c13730e /c/lex.c
parentc2f9d128ecd15c9f285426b4e7b9bc2cd3d53732 (diff)
c: move warning for extension keyword til after preprocessor
Diffstat (limited to 'c/lex.c')
-rw-r--r--c/lex.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/c/lex.c b/c/lex.c
index afadffc..548f82c 100644
--- a/c/lex.c
+++ b/c/lex.c
@@ -33,6 +33,7 @@ identkeyword(struct token *tk, const char *s, int len)
};
int l = 0, h = arraylength(kwtab) - 1, i, cmp;
+ tk->extwarn = 0;
if (len > TKWMAXLEN_) goto ident;
/* binary search over sorted array */
while (l <= h) {
@@ -579,8 +580,7 @@ Begin:
}
tmp[n] = 0;
if (!identkeyword(tk, tmp, n) && ccopt.pedant)
- warn(&(struct span) {{ idx, lx->chridx - idx, lx->fileid }},
- "%'tk in %M is an extension", tk);
+ tk->extwarn = 1;
goto End;
}
case 0: if (lx->idx >= lx->ndat) RET(TKEOF);