lex: %option not supported by solaris lex

it turns out that we don't need to tell lex we don't plan to use unput;
we can just.... not use unput. however, if we're flex, use the command
line option if it's available, to avoid warnings
This commit is contained in:
Daria Phoebe Brashear
2018-04-19 17:32:59 -04:00
committed by Nico Williams
parent 6b3ce5d229
commit 78c915f65a
5 changed files with 5 additions and 4 deletions

View File

@@ -59,6 +59,9 @@ fi
dnl AC_KRB_PROG_YACC dnl AC_KRB_PROG_YACC
AC_PROG_YACC AC_PROG_YACC
AM_PROG_LEX AM_PROG_LEX
AS_IF([$LEX --nounput -V > /dev/null 2>&1 && test $? -eq 0],
[AC_SUBST([FLEXNOUNPUTARGS], ["--nounput"])],
[AC_SUBST([FLEXNOUNPUTARGS], [""])])
dnl AC_PROG_RANLIB dnl AC_PROG_RANLIB
AC_PROG_AWK AC_PROG_AWK
AC_KRB_PROG_LN_S AC_KRB_PROG_LN_S

View File

@@ -3,6 +3,7 @@
include $(top_srcdir)/Makefile.am.common include $(top_srcdir)/Makefile.am.common
YFLAGS = -d YFLAGS = -d
LFLAGS = @FLEXNOUNPUTARGS@
lib_LTLIBRARIES = libcom_err.la lib_LTLIBRARIES = libcom_err.la
libcom_err_la_LDFLAGS = -version-info 2:3:1 libcom_err_la_LDFLAGS = -version-info 2:3:1

View File

@@ -53,8 +53,6 @@ static int getstring(void);
%} %}
%option nounput
%% %%
et { return ET; } et { return ET; }
error_table { return ET; } error_table { return ET; }

View File

@@ -9,6 +9,7 @@ endif
AM_CPPFLAGS += $(ROKEN_RENAME) AM_CPPFLAGS += $(ROKEN_RENAME)
YFLAGS = -d YFLAGS = -d
LFLAGS = @FLEXNOUNPUTARGS@
include_HEADERS = sl.h include_HEADERS = sl.h

View File

@@ -53,8 +53,6 @@ static char * handle_string(void);
%} %}
%option nounput
%% %%
[A-Za-z][-A-Za-z0-9_]* { [A-Za-z][-A-Za-z0-9_]* {
yylval.string = strdup ((const char *)yytext); yylval.string = strdup ((const char *)yytext);