From 89ff1b5e71a6d8aa34b3578282528adb43b198cd Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Wed, 29 May 2013 09:17:48 +0200 Subject: [PATCH] build: be sure to include config.h first in the generated parser Using %code for config.h is wrong, as some headers will already have been included by Bison. In some cases, e.g., glibc's string.h, this results in some declaration not being made for lack of definition of _GNU_SOURCE, which is performed by config.h. * src/parse-gram.y: here. --- src/parse-gram.y | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/parse-gram.y b/src/parse-gram.y index 9a266251..d3698895 100644 --- a/src/parse-gram.y +++ b/src/parse-gram.y @@ -23,9 +23,14 @@ #include "symtab.h" } +%code top +{ + /* On column 0 to please syntax-check. */ +#include +} + %code { - #include #include "system.h" #include "c-ctype.h" -- 2.50.0