From c9b5b68c7394a43875fa11ffff0deb619ca99fab Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 3 May 2020 10:29:17 +0200 Subject: [PATCH] examples: beware of intl portability issues Reported by Horst von Brand. https://lists.gnu.org/r/bug-bison/2020-04/msg00033.html * examples/c/bistromathic/Makefile: libintl might not be needed, but libm probably is. * examples/c/bistromathic/parse.y: Include locale.h. --- examples/c/bistromathic/Makefile | 4 ++-- examples/c/bistromathic/parse.y | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/c/bistromathic/Makefile b/examples/c/bistromathic/Makefile index c1ac6887..99c8dcfc 100644 --- a/examples/c/bistromathic/Makefile +++ b/examples/c/bistromathic/Makefile @@ -5,7 +5,7 @@ BASE = bistromathic BISON = bison XSLTPROC = xsltproc -# We need to find the headers and libs for readline and intl. +# We need to find the headers and libs for readline (and possibly intl). # You probably need to customize this for your own environment. CPPFLAGS = -I/opt/local/include LDFLAGS = -L/opt/local/lib @@ -14,7 +14,7 @@ LDFLAGS = -L/opt/local/lib BISON_LOCALEDIR = $(shell $(BISON) $(BISON_FLAGS) --print-localedir) CPPFLAGS += -DENABLE_NLS -DBISON_LOCALEDIR='"$(BISON_LOCALEDIR)"' -LIBS = -lreadline -lintl +LIBS = -lreadline -lm # In some environments, -lintl is needed. all: $(BASE) diff --git a/examples/c/bistromathic/parse.y b/examples/c/bistromathic/parse.y index ffed690e..479d1bf4 100644 --- a/examples/c/bistromathic/parse.y +++ b/examples/c/bistromathic/parse.y @@ -2,6 +2,7 @@ %code top { #include // isdigit + #include // LC_ALL #include // cos, sin, etc. #include // va_start #include // printf