wcc: delete unused warning counters and ww err twin

This commit is contained in:
2026-08-09 04:19:22 +09:00
parent 2a03cfbfa4
commit c9425a3b46
5 changed files with 4 additions and 64 deletions

View File

@@ -1,13 +1,11 @@
/*
* Plan 9 style: short, no levels beyond fatal/error/warn, no colour.
* Plan 9 style: short, no levels beyond fatal/error, no colour.
*/
#include "ww.h"
#include <stdlib.h>
#include <string.h>
Pos noPos = { "<none>", 0, 0 };
int nerrors;
int nwarnings;
FILE *errout; /* set by main; defaults to stderr */
static FILE *
@@ -52,19 +50,4 @@ errorf(Pos p, const char *fmt, ...)
vfprintf(f, fmt, ap);
va_end(ap);
fprintf(f, "\n");
nerrors++;
}
void
warnf(Pos p, const char *fmt, ...)
{
FILE *f = out();
va_list ap;
prefix(p);
fprintf(f, "warning: ");
va_start(ap, fmt);
vfprintf(f, fmt, ap);
va_end(ap);
fprintf(f, "\n");
nwarnings++;
}

View File

@@ -210,9 +210,8 @@ parsetype(Parser *p)
if (p->cur.kind == TK_AT) {
advance(p);
const char *an = expectident(p);
/* p->errs gates the build (cmd/w6c/main.c:82);
* nerrors is advisory-only, so an errorf on a
* clean-recovery path must bump p->errs itself. */
/* errorf only reports; p->errs gates the build
* (cmd/w6c/main.c:82). */
if (strcmp(an, "packed") != 0) {
errorf(p->cur.pos,
"unknown struct attribute '@%s'", an);

View File

@@ -58,13 +58,10 @@ struct Pos {
};
extern Pos noPos;
extern int nerrors;
extern int nwarnings;
extern FILE *errout;
void fatal(const char*, ...) __attribute__((noreturn, format(printf, 1, 2)));
void errorf(Pos, const char*, ...) __attribute__((format(printf, 2, 3)));
void warnf(Pos, const char*, ...) __attribute__((format(printf, 2, 3)));
#define nelem(a) ((sizeof(a) / sizeof((a)[0])))