diff options
author | Brian Callahan <bcallah@cvs.openbsd.org> | 2017-06-15 13:48:43 +0000 |
---|---|---|
committer | Brian Callahan <bcallah@cvs.openbsd.org> | 2017-06-15 13:48:43 +0000 |
commit | 091eeacaac7ad3be6504703535fa542aceb49f51 (patch) | |
tree | e66e1c29fa13f8ed26dfe45864c5d59f5c001ec6 /usr.bin/m4/tokenizer.l | |
parent | ec91d0dcf7aee9849fae3c7da637679ff1069753 (diff) |
Add -E flag (make warnings fatal), following the behavior of GNU m4 1.4.9+
Help and direction millert@ espie@ anton@ deraadt@
ok espie@
Diffstat (limited to 'usr.bin/m4/tokenizer.l')
-rw-r--r-- | usr.bin/m4/tokenizer.l | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/usr.bin/m4/tokenizer.l b/usr.bin/m4/tokenizer.l index 4adabd7e98f..3ffadd4fa29 100644 --- a/usr.bin/m4/tokenizer.l +++ b/usr.bin/m4/tokenizer.l @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: tokenizer.l,v 1.8 2012/04/12 17:00:11 espie Exp $ */ +/* $OpenBSD: tokenizer.l,v 1.9 2017/06/15 13:48:42 bcallah Exp $ */ /* * Copyright (c) 2004 Marc Espie <espie@cvs.openbsd.org> * @@ -22,6 +22,7 @@ #include <stdint.h> #include <limits.h> +extern void m4_warnx(const char *, ...); extern int mimic_gnu; extern int32_t yylval; @@ -65,9 +66,8 @@ number() errno = 0; l = strtol(yytext, NULL, 0); if (((l == LONG_MAX || l == LONG_MIN) && errno == ERANGE) || - l > INT32_MAX || l < INT32_MIN) { - fprintf(stderr, "m4: numeric overflow in expr: %s\n", yytext); - } + l > INT32_MAX || l < INT32_MIN) + m4_warnx("numeric overflow in expr: %s", yytext); return l; } @@ -82,7 +82,7 @@ parse_radix() l = 0; base = strtol(yytext+2, &next, 0); if (base > 36 || next == NULL) { - fprintf(stderr, "m4: error in number %s\n", yytext); + m4_warnx("error in number %s", yytext); } else { next++; while (*next != 0) { @@ -95,8 +95,7 @@ parse_radix() d = *next - 'A' + 10; } if (d >= base) { - fprintf(stderr, - "m4: error in number %s\n", yytext); + m4_warnx("error in number %s", yytext); return 0; } l = base * l + d; |