summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2009-07-12 22:44:46 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2009-07-12 22:44:46 +0000
commit01aba4c830ffb46d317dbee5008164e239712c1a (patch)
tree3825b624b1b6324fbb38851376d750a2fc653e3e /usr.bin
parent31ef1ce0e9d80ed34071bc98f128ab5d287cf750 (diff)
sync to 1.7.23: Fewer knobs: provide -Wall -Werror but not -Wsyntax -Wcompat.
The simplification of the internal code has already been done before, this is just the user interface adjustment.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mandoc/main.c21
-rw-r--r--usr.bin/mandoc/mandoc.114
2 files changed, 11 insertions, 24 deletions
diff --git a/usr.bin/mandoc/main.c b/usr.bin/mandoc/main.c
index d9d1fc6868c..da270a17142 100644
--- a/usr.bin/mandoc/main.c
+++ b/usr.bin/mandoc/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.12 2009/07/12 18:28:29 schwarze Exp $ */
+/* $Id: main.c,v 1.13 2009/07/12 22:44:45 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -52,9 +52,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. */
@@ -582,13 +580,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;
@@ -597,12 +593,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:
@@ -622,6 +612,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);
diff --git a/usr.bin/mandoc/mandoc.1 b/usr.bin/mandoc/mandoc.1
index d134e82bcea..d200120c997 100644
--- a/usr.bin/mandoc/mandoc.1
+++ b/usr.bin/mandoc/mandoc.1
@@ -1,4 +1,4 @@
-.\" $Id: mandoc.1,v 1.7 2009/06/23 23:40:59 schwarze Exp $
+.\" $Id: mandoc.1,v 1.8 2009/07/12 22:44:45 schwarze Exp $
.\"
.\" Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: June 23 2009 $
+.Dd $Mdocdate: July 12 2009 $
.Dt MANDOC 1
.Os
.\" SECTION
@@ -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