Re: m4(1): add -e flag support

2017-06-14 Thread Brian Callahan
On 6/14/2017 10:18 AM, marc espie wrote: > on wed, jun 14, 2017 at 09:58:54am -0400, brian callahan wrote: >> hi marc -- >> >> how's this version? >> also includes a slight tweak to the single -e flag regress test. >> >> ~brian > comment nit, otherwise good. > >> +extern int error_warns;

Re: m4(1): add -e flag support

2017-06-14 Thread marc espie
on wed, jun 14, 2017 at 09:58:54am -0400, brian callahan wrote: > hi marc -- > > how's this version? > also includes a slight tweak to the single -e flag regress test. > > ~brian comment nit, otherwise good. > +extern int error_warns; /* make warnings cause exit_code > 0 */

Re: m4(1): add -E flag support

2017-06-14 Thread Brian Callahan
Hi Marc -- How's this version? Also includes a slight tweak to the single -E flag regress test. ~Brian Index: usr.bin/m4/eval.c === RCS file: /cvs/src/usr.bin/m4/eval.c,v retrieving revision 1.74 diff -u -p -u -p -r1.74 eval.c ---

Re: m4(1): add -E flag support

2017-06-14 Thread Marc Espie
On Tue, Jun 13, 2017 at 05:05:56PM -0400, Brian Callahan wrote: > Hi -- > > Whoops, that was unintentional. Fixed. > > ~Brian Sorry for not looking sooner. I would rather you use two variables for -E flags. e.g., set error_warns for one -E flag, and fatal_warns for multiple -E flags. That

Re: m4(1): add -E flag support

2017-06-13 Thread Todd C. Miller
On Tue, 13 Jun 2017 17:05:56 -0400, Brian Callahan wrote: > Whoops, that was unintentional. Fixed. Looks good to me. - todd

Re: m4(1): add -E flag support

2017-06-13 Thread Brian Callahan
Hi -- Whoops, that was unintentional. Fixed. ~Brian Index: usr.bin/m4/eval.c === RCS file: /cvs/src/usr.bin/m4/eval.c,v retrieving revision 1.74 diff -u -p -u -p -r1.74 eval.c --- usr.bin/m4/eval.c 5 Feb 2015 12:59:57 -

Re: m4(1): add -E flag support

2017-06-13 Thread Brian Callahan
Hi -- Updated diff attached. Wrapped everything up in an m4_warnx() call and added a regress test for single -E. Thanks! The one fatal_warns check in eval.c seems like a special case, so I left that one as it was. ~Brian Index: usr.bin/m4/eval.c

Re: m4(1): add -E flag support

2017-06-13 Thread Anton Lindqvist
On Tue, Jun 13, 2017 at 03:35:54PM -0400, Brian Callahan wrote: > This diff comes with man page additions explaining the new flag, > as well as a regress test for -E -E behavior. I could not figure > out how to write a regress test that checks for exit status, so > there is no test for single -E

Re: m4(1): add -E flag support

2017-06-13 Thread Todd C. Miller
I don't have an objection to this but wouldn't it be less error-prone to include the check_fatal_warns() checks in a warnx() wrapper? There are some fprintf() calls in tokenizer.l that would need to be converted but that still seems simpler than requiring callers of warnx() or the equivalent to

Re: m4(1): add -E flag support

2017-06-13 Thread Theo de Raadt
The decisions taken seem correct. I'll let m4 people judge the rest of it.

m4(1): add -E flag support

2017-06-13 Thread Brian Callahan
Hi tech -- I've shared this with a few developers, and have been advised to share now with a wider audience. This diff adds -E flag functionality to m4(1). I wrote this diff after noticing a patch in ports/devel/scons by jasper@ with the comment: XXX: OpenBSD's m4(1) lacks the -E option (needs