The %union definition uses the time_t structure. In order to use this
structure, the <time.h> header has to be included. Otherwise, the build
breaks with some C libraries, such as musl:

In file included from coord-config-lex.l:23:0:
coord-config-parse.y:107:2: error: unknown type name ‘time_t’
  time_t timestamp;
  ^

This patch includes <time.h> using the '%code requires' directive of
Yacc.

Signed-off-by: Thomas Petazzoni <thomas.petazz...@free-electrons.com>
---
 addrdb/coord-config-parse.y | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/addrdb/coord-config-parse.y b/addrdb/coord-config-parse.y
index 2e10a88..85ee058 100644
--- a/addrdb/coord-config-parse.y
+++ b/addrdb/coord-config-parse.y
@@ -102,6 +102,10 @@
 
 %}
 
+%code requires {
+#include <time.h>
+}
+
 %union {
        unsigned long number;
        time_t timestamp;
-- 
2.7.4


------------------------------------------------------------------------------
_______________________________________________
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel

Reply via email to