On Mon, Sep 16, 2019 at 11:38:30AM +0200, Marc Espie wrote: > On Mon, Sep 16, 2019 at 05:07:21PM +0800, Michael Mikonos wrote: > > Hello, > > > > When building flex on clang 8.0.1 (i386) I noticed that assert() > > expands to nothing. This happens because of a fallback declaration > > of assert() in flexdef.h when HAVE_ASSERT_H is not set. Instead of > > changing flexdef.h the following patch follows the existing pattern > > in Makefile of adding -DHAVE_SOMETHING. Does this look OK? > > > > - Michael > > > > > > Index: Makefile > > =================================================================== > > RCS file: /cvs/src/usr.bin/lex/Makefile,v > > retrieving revision 1.17 > > diff -u -p -u -r1.17 Makefile > > --- Makefile 30 Apr 2017 20:30:39 -0000 1.17 > > +++ Makefile 16 Sep 2019 08:55:42 -0000 > > @@ -12,7 +12,7 @@ > > # To bootstrap lex, cp initscan.c to scan.c and run make. > > > > PROG= lex > > -CFLAGS+=-I. -I${.CURDIR} -DHAVE_CONFIG_H > > +CFLAGS+=-I. -I${.CURDIR} -DHAVE_CONFIG_H -DHAVE_ASSERT_H > > SRCS= buf.c ccl.c dfa.c ecs.c filter.c gen.c main.c misc.c \ > > nfa.c options.c parse.y regex.c scan.l scanflags.c \ > > scanopt.c skel.c sym.c tables.c tables_shared.c \ > > Nope, you want to fix config.h
Thanks for the suggestion. I missed that config.h already contained other HAVE_* definitions. This patch has the same effect; config.h is updated manually but it has happened before in r1.5. Index: config.h =================================================================== RCS file: /cvs/src/usr.bin/lex/config.h,v retrieving revision 1.5 diff -u -p -u -r1.5 config.h --- config.h 19 Nov 2015 23:48:06 -0000 1.5 +++ config.h 16 Sep 2019 09:46:36 -0000 @@ -137,6 +137,8 @@ /* Define to 1 if the system has the type `_Bool'. */ #define HAVE__BOOL 1 +#define HAVE_ASSERT_H 1 + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/"