Re: m4(1): Don't need to link with -ly

2017-06-16 Thread Todd C. Miller
On Fri, 16 Jun 2017 16:22:15 -0400, Brian Callahan wrote:

> m4 links with -ly, presumably for the yyerror() function.
> But there already is a yyerror() in usr.bin/m4/expr.c, which is
> written specifically for m4. So we don't need -ly.

OK, but if you want to remove -ll as well you could do this.
Either way OK millert@

 - todd

Index: usr.bin/m4/Makefile
===
RCS file: /cvs/src/usr.bin/m4/Makefile,v
retrieving revision 1.13
diff -u -p -u -r1.13 Makefile
--- usr.bin/m4/Makefile 12 May 2014 19:11:19 -  1.13
+++ usr.bin/m4/Makefile 16 Jun 2017 20:58:42 -
@@ -8,8 +8,8 @@ CFLAGS+=-DEXTENDED -I.
 CDIAGFLAGS=-W -Wall -Wstrict-prototypes -pedantic \
-Wno-unused -Wno-char-subscripts -Wno-sign-compare
 
-LDADD= -ly -ll -lm -lutil
-DPADD= ${LIBY} ${LIBL} ${LIBM} ${LIBUTIL}
+LDADD= -lm -lutil
+DPADD= ${LIBM} ${LIBUTIL}
 
 SRCS=  eval.c expr.c look.c main.c misc.c gnum4.c trace.c tokenizer.l parser.y
 MAN=   m4.1
Index: usr.bin/m4/tokenizer.l
===
RCS file: /cvs/src/usr.bin/m4/tokenizer.l,v
retrieving revision 1.9
diff -u -p -u -r1.9 tokenizer.l
--- usr.bin/m4/tokenizer.l  15 Jun 2017 13:48:42 -  1.9
+++ usr.bin/m4/tokenizer.l  16 Jun 2017 21:00:34 -
@@ -37,6 +37,8 @@ oct   0[0-7]*
 dec[1-9][0-9]*
 radix  0[rR][0-9]+:[0-9a-zA-Z]+
 
+%option noyywrap
+
 %%
 {ws}   {/* just skip it */}
 {hex}|{oct}|{dec}  { yylval = number(); return(NUMBER); }



m4(1): Don't need to link with -ly

2017-06-16 Thread Brian Callahan
Hi tech --

m4 links with -ly, presumably for the yyerror() function.
But there already is a yyerror() in usr.bin/m4/expr.c, which is
written specifically for m4. So we don't need -ly.

OK?

~Brian

Index: Makefile
===
RCS file: /cvs/src/usr.bin/m4/Makefile,v
retrieving revision 1.13
diff -u -p -u -p -r1.13 Makefile
--- Makefile12 May 2014 19:11:19 -  1.13
+++ Makefile16 Jun 2017 20:11:21 -
@@ -8,8 +8,8 @@ CFLAGS+=-DEXTENDED -I.
 CDIAGFLAGS=-W -Wall -Wstrict-prototypes -pedantic \
-Wno-unused -Wno-char-subscripts -Wno-sign-compare
 
-LDADD= -ly -ll -lm -lutil
-DPADD= ${LIBY} ${LIBL} ${LIBM} ${LIBUTIL}
+LDADD= -ll -lm -lutil
+DPADD= ${LIBL} ${LIBM} ${LIBUTIL}
 
 SRCS=  eval.c expr.c look.c main.c misc.c gnum4.c trace.c tokenizer.l parser.y
 MAN=   m4.1