bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: inttypes.h error for Bison


From: Joel E. Denny
Subject: Re: inttypes.h error for Bison
Date: Mon, 2 Jul 2007 22:48:51 -0400 (EDT)

On Tue, 3 Jul 2007, Bruno Haible wrote:

> It will not cause trouble, but it will not fix the problem either, in general:
> On a platform where <stdint.h> is POSIX compliant and <inttypes.h> is not,
> this patch will have no effect, and <inttypes.h> will still try to use
> INT32_MAX etc. which are not defined.
> 
> I'm applying this fix for the general problem.

Thanks.

> > I must confess that I don't understand these issues.  The above tests an 
> > example from the manual that Bison users should be able to compile after 
> > installing Bison.  Do we expect Bison users to use Bison's config.h or to 
> > use Gnulib in their parsers?
> 
> There's no reason to enforce such a requirement. The calc++-scanner.cc
> example is fine as is; only the examples/calc++/Makefile.am is lacking a
> custom definition of DEFAULT_INCLUDES that will override automake's default
> definition.

Ok, I misread your earlier discussion on this.  The following Bison patch 
fixes the tests for me.  Is it reasonable?

Index: ChangeLog
===================================================================
RCS file: /sources/bison/bison/ChangeLog,v
retrieving revision 1.1707
diff -p -u -r1.1707 ChangeLog
--- ChangeLog   2 Jul 2007 02:07:19 -0000       1.1707
+++ ChangeLog   3 Jul 2007 02:46:44 -0000
@@ -1,3 +1,13 @@
+2007-07-02  Joel E. Denny  <address@hidden>
+
+       Fix C++ test cases after recent Gnulib changes.  Discussed starting at
+       <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
+       * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
+       definition in order to avoid Gnulib headers since we don't use config.h
+       here.
+       * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
+       rather than AT_DATA so that config.h is included.
+
 2007-07-01  Joel E. Denny  <address@hidden>
 
        * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
Index: examples/calc++/Makefile.am
===================================================================
RCS file: /sources/bison/bison/examples/calc++/Makefile.am,v
retrieving revision 1.6
diff -p -u -r1.6 Makefile.am
--- examples/calc++/Makefile.am 19 Dec 2006 07:52:02 -0000      1.6
+++ examples/calc++/Makefile.am 3 Jul 2007 02:46:44 -0000
@@ -44,6 +44,7 @@ $(calc_extracted): $(doc) $(extexi)
 ## Parser generation.  ##
 ## ------------------- ##
 
+DEFAULT_INCLUDES = -I. -I$(srcdir)
 BUILT_SOURCES = $(calc_extracted) $(calc_sources_generated)
 CLEANFILES = $(srcdir)/*.output *.tmp
 MAINTAINERCLEANFILES = $(srcdir)/*.stamp $(BUILT_SOURCES)
Index: tests/output.at
===================================================================
RCS file: /sources/bison/bison/tests/output.at,v
retrieving revision 1.16
diff -p -u -r1.16 output.at
--- tests/output.at     17 Jan 2007 08:36:07 -0000      1.16
+++ tests/output.at     3 Jul 2007 02:46:44 -0000
@@ -157,7 +157,7 @@ AT_CHECK_CONFLICTING_OUTPUT([foo.y],
 m4_define([AT_CHECK_OUTPUT_FILE_NAME],
 [AT_SETUP([Output file name: $1])
 
-AT_DATA([glr.y],
+AT_DATA_GRAMMAR([glr.y],
 [[%glr-parser
 %code {
   int yylex (void);
@@ -171,7 +171,7 @@ AT_CHECK([ls "AS_ESCAPE([$1.c])" "AS_ESC
 AT_COMPILE([glr.o], [-c "AS_ESCAPE([$1.c])"])
 $2
 
-AT_DATA([cxx.y],
+AT_DATA_GRAMMAR([cxx.y],
 [[%skeleton "lalr1.cc"
 %code { int yylex (yy::parser::semantic_type*); }
 %%




reply via email to

[Prev in Thread] Current Thread [Next in Thread]