-
-static int
-mdocwarn(void *arg, int line, int col,
- enum mdoc_warn type, const char *msg)
-{
- struct curparse *curp;
- char *wtype;
-
- curp = (struct curparse *)arg;
- wtype = NULL;
-
- switch (type) {
- case (WARN_COMPAT):
- wtype = "compat";
- if (curp->wflags & WARN_WCOMPAT)
- break;
- return(1);
- case (WARN_SYNTAX):
- wtype = "syntax";
- if (curp->wflags & WARN_WSYNTAX)
- break;
- return(1);
- }
-
- assert(wtype);
- warnx("%s:%d: %s warning: %s (column %d)",
- curp->file, line, wtype, msg, col);
-
- if ( ! (curp->wflags & WARN_WERR))
- return(1);
-
- warnx("%s: considering warnings as errors",
- __progname);