aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/main.c
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
commit9ec599e169a4b65549aa1f9fb509e693d152244e (patch)
tree0b48f77c42b2e452a4ab99e5cd1ddab20df15b36 /main.c
parent48ef4044a299e0b5996e03ddd8f3b1c6df26796e (diff)
downloadmandoc-9ec599e169a4b65549aa1f9fb509e693d152244e.tar.gz
mandoc-9ec599e169a4b65549aa1f9fb509e693d152244e.tar.zst
mandoc-9ec599e169a4b65549aa1f9fb509e693d152244e.zip
Backed -Wcompat,syntax out of front-end.
Diffstat (limited to 'main.c')
-rw-r--r--main.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/main.c b/main.c
index 18bcf656..b2602c40 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.35 2009/07/06 09:21:24 kristaps Exp $ */
+/* $Id: main.c,v 1.36 2009/07/06 09:34:29 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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)",