aboutsummaryrefslogtreecommitdiffhomepage
path: root/c/lex.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/lex.c')
-rw-r--r--c/lex.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/c/lex.c b/c/lex.c
index 329862e..a2f1596 100644
--- a/c/lex.c
+++ b/c/lex.c
@@ -1668,6 +1668,7 @@ tryinclude(struct lexer *lx, const struct span *span, char *path)
case LXOK:
new.save = xmalloc(sizeof *new.save);
lx->inclnerror = nerror;
+ lx->inclnwarn = nwarn;
memcpy(new.save, lx, sizeof *lx);
*lx = new;
@@ -2036,7 +2037,7 @@ Begin:
markfileonce(lx->fileid, lx->inclguard);
}
struct lexer *sv = lx->save;
- if (sv->inclnerror != nerror) {
+ if (sv->inclnerror != nerror || sv->inclnwarn != nwarn) {
int line;
const char *f = getfilepos(&line, NULL, sv->fileid, sv->chridx-2);
note(NULL, "in file included from %s:%d", f, line);