[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/5] build: be sure to include config.h first in the generated pa
From: |
Akim Demaille |
Subject: |
[PATCH 1/5] build: be sure to include config.h first in the generated parser |
Date: |
Thu, 30 May 2013 10:50:15 +0200 |
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 9a26625..d369889 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 <config.h>
+}
+
%code
{
- #include <config.h>
#include "system.h"
#include "c-ctype.h"
--
1.8.2.3
- [PATCH 0/5] {master} minor fixes, Akim Demaille, 2013/05/30
- [PATCH 3/5] fix a memory leak, Akim Demaille, 2013/05/30
- [PATCH 4/5] build: locally disable new GCC warnings that fail on Flex generated code, Akim Demaille, 2013/05/30
- [PATCH 1/5] build: be sure to include config.h first in the generated parser,
Akim Demaille <=
- [PATCH 5/5] xml: use %empty in the text output, Akim Demaille, 2013/05/30
- [PATCH 2/5] regen, Akim Demaille, 2013/05/30
- Re: [PATCH 0/5] {master} minor fixes, Akim Demaille, 2013/05/30