summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-07-06 09:34:29 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-07-06 09:34:29 +0000
commitc87520eafbd20bdf126e5d00b5cfa57fe4542aa9 (patch)
tree810cd97b87ddbd33dfbfd7f853d04f34440ec959
parent4baed99617de2e5dacb16862a0cecb8885b435f0 (diff)
downloadmandoc-c87520eafbd20bdf126e5d00b5cfa57fe4542aa9.tar.gz
Backed -Wcompat,syntax out of front-end.
-rw-r--r--main.c26
-rw-r--r--mandoc.110
2 files changed, 13 insertions, 23 deletions
diff --git a/main.c b/main.c
index 77bf36fa..d8eea987 100644
--- a/main.c
+++ b/main.c
@@ -65,9 +65,7 @@ struct curparse {
const char *file; /* Current parse. */
int fd; /* Current parse. */
int wflags;
-#define WARN_WALL 0x03 /* All-warnings mask. */
-#define WARN_WCOMPAT (1 << 0) /* Compatibility warnings. */
-#define WARN_WSYNTAX (1 << 1) /* Syntax warnings. */
+#define WARN_WALL (1 << 0) /* All-warnings mask. */
#define WARN_WERR (1 << 2) /* Warnings->errors. */
int fflags;
#define IGN_SCOPE (1 << 0) /* Ignore scope errors. */
@@ -596,13 +594,11 @@ static int
woptions(int *wflags, char *arg)
{
char *v, *o;
- char *toks[5];
+ char *toks[3];
toks[0] = "all";
- toks[1] = "compat";
- toks[2] = "syntax";
- toks[3] = "error";
- toks[4] = NULL;
+ toks[1] = "error";
+ toks[2] = NULL;
while (*arg) {
o = arg;
@@ -611,12 +607,6 @@ woptions(int *wflags, char *arg)
*wflags |= WARN_WALL;
break;
case (1):
- *wflags |= WARN_WCOMPAT;
- break;
- case (2):
- *wflags |= WARN_WSYNTAX;
- break;
- case (3):
*wflags |= WARN_WERR;
break;
default:
@@ -636,6 +626,7 @@ merr(void *arg, int line, int col, const char *msg)
struct curparse *curp;
curp = (struct curparse *)arg;
+
warnx("%s:%d: error: %s (column %d)",
curp->file, line, msg, col);
@@ -650,7 +641,10 @@ mdocwarn(void *arg, int line, int col, const char *msg)
curp = (struct curparse *)arg;
- warnx("%s:%d: warning: %s (column %d)",
+ if ( ! (curp->wflags & WARN_WALL))
+ return(1);
+
+ warnx("%s:%d: syntax warning: %s (column %d)",
curp->file, line, msg, col);
if ( ! (curp->wflags & WARN_WERR))
@@ -668,7 +662,7 @@ manwarn(void *arg, int line, int col, const char *msg)
curp = (struct curparse *)arg;
- if ( ! (curp->wflags & WARN_WSYNTAX))
+ if ( ! (curp->wflags & WARN_WALL))
return(1);
warnx("%s:%d: syntax warning: %s (column %d)",
diff --git a/mandoc.1 b/mandoc.1
index b52a1e54..e34f0ca1 100644
--- a/mandoc.1
+++ b/mandoc.1
@@ -60,15 +60,11 @@ for available formats. Defaults to
Print version and exit.
.\" ITEM
.It Fl W Ns Ar err...
-Print warning messages. May be set to
+Configure warning messages. Use
.Fl W Ns Ar all
-for all warnings,
-.Ar compat
-for groff/troff-compatibility warnings, or
-.Ar syntax
-for syntax warnings. If
+to print warnings,
.Fl W Ns Ar error
-is specified, warnings are considered errors and cause utility
+for warnings to be considered errors and cause utility
termination. Multiple
.Fl W
arguments may be comma-separated, such as