diff options
Diffstat (limited to 'c/lex.c')
| -rw-r--r-- | c/lex.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1507,6 +1507,7 @@ tryinclude(struct lexer *lx, const struct span *span, char *path) /* fallthru */ case LXOK: new.save = xmalloc(sizeof *new.save); + lx->inclnerror = nerror; memcpy(new.save, lx, sizeof *lx); *lx = new; @@ -1850,6 +1851,11 @@ Begin: markfileonce(lx->fileid, lx->inclguard); } struct lexer *sv = lx->save; + if (sv->inclnerror != nerror) { + int line; + const char *f = getfilepos(&line, NULL, sv->fileid, sv->chridx-2); + note(NULL, "in file included from %s:%d", f, line); + } memcpy(lx, sv, sizeof *lx); free(sv); --includedepth; |