summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c26
1 files changed, 10 insertions, 16 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)",