From cdc076e6adf2e8066872d30535c71e128c5375ca Mon Sep 17 00:00:00 2001 From: lemon Date: Thu, 19 Mar 2026 22:09:22 +0100 Subject: io: make -w suppress notes too --- src/c.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/c.c') diff --git a/src/c.c b/src/c.c index e7f902e..fcde10e 100644 --- a/src/c.c +++ b/src/c.c @@ -310,11 +310,11 @@ putdecl(CComp *cm, const Decl *decl) Match: if ((cm->env->up != NULL && decl->scls == SCSTATIC) || (l->isdef && decl->isdef)) { error(&decl->span, "redefinition of '%s'", decl->name); - note(&l->span, "previously defined here"); + note(DGERROR, &l->span, "previously defined here"); break; } else if (!redeclarationok(l, decl)) { error(&decl->span, "incompatible redeclaration of '%s'", decl->name); - note(&l->span, "previously declared here"); + note(DGERROR, &l->span, "previously declared here"); break; } if (l->isdef && !decl->isdef) return l - declsbuf.p; @@ -801,7 +801,7 @@ callexpr(CComp *cm, const Span *span_, const Expr *callee) td->nmemb, td->nmemb != 1 ? "s" : ""); printsig = 1; } - if (printsig) note(&callee->span, "function signature is '%ty'", ty); + if (printsig) note(DGERROR, &callee->span, "function signature is '%ty'", ty); ex = mkexpr(ECALL, span, ty.t == TYFUNC ? td->ret : ty, .narg = args.n, .sub = alloc(&cm->exarena, (args.n+1)*sizeof(Expr), 0)); @@ -2229,7 +2229,7 @@ tagtype(CComp *cm, enum toktag kind) &tk, kind); else error(&tk.span, "redefinition of '%tt %s'", kind, tag); - note(&span, "previous definition:"); + note(DGERROR, &span, "previous definition:"); } } if (tt == TYENUM) @@ -2241,7 +2241,7 @@ tagtype(CComp *cm, enum toktag kind) if (t.t != tt) { error(&tk.span, "declaring tagged type %'tk as %tt clashes with previous definition", &tk, kind); - note(&span, "previous definition:"); + note(DGERROR, &span, "previous definition:"); } return t; } @@ -4021,7 +4021,7 @@ genswitch(CComp *cm, Function *fn, const Expr *ex) assert(c->val >= prev); if (c->val == prev) { error(&c->span, "duplicate case value"); - note(&c[-1].span, "previously defined here"); + note(DGERROR, &c[-1].span, "previously defined here"); } } EMITS { -- cgit v1.2.3