On Mon, Aug 01, 2016 at 02:41:12AM -0400, Thomas Dickey wrote: >On Mon, Aug 01, 2016 at 04:22:37PM +1000, Brendan O'Dea wrote: >> configure.in doesn't cope with 2.6: >> >> sed -e 's/^2.5.// >> >> resulting in this output from configure: >> >> checking version of flex... 2.6.0 >> ../configure: 5316: test: Illegal number: 2.6.0 > >I did notice that yesterday, but since it built, didn't look too closely.
The periods in that regex should probably be escaped also. >...so after ten years, it's no longer a beta. I can fix this :-) Ha. Actually, my reading of that code is that the intent is that everything other than .0 releases are treated as FLEX_BETA. >> #define YY_SKIP_YYWRAP >> #define yywrap() private_yywrap() >> #define USE_LEXWRAP(name) static int private_yywrap(void) { return 1; } >> #else >> #define USE_LEXWRAP(name) /* nothing */ >> #endif >> [...] >> Out of curiosity, why does USE_LEXWRAP take an option? It doesn't appear to >> do anything with it. > >It's used a little later in filters.h: > > /* > * We'll put a DefineFilter() in each filter program. To handle > special cases > * such as c-filt.c, use DefineOptFilter(). > */ > #define DefineOptFilter(name,options) \ > USE_LEXWRAP(name##_wrap) \ > static void init_filter(int before); \ > static void do_filter(FILE *Input); \ > DCL_LEXFREE \ > FILTER_DEF filter_def = { #name, 1, init_filter, do_filter, options > REF_LEXFREE } That is a different binding of "name". As I read it, you could rewrite it as: #if defined(FLEX_SCANNER) && defined(FLEX_BETA) #define YY_SKIP_YYWRAP #define yywrap() private_yywrap() #define USE_LEXWRAP static int private_yywrap(void) { return 1; } #else #define USE_LEXWRAP /* nothing */ #endif #define DefineOptFilter(name,options) \ USE_LEXWRAP \ ... without losing anything. --bod