There are a couple issues that cause syck to FTBFS on my system.

One is an undeclared build-dep on re2c.  Without re2c installed, my
build fails like so:

then mv -f ".deps/yaml2byte.Tpo" ".deps/yaml2byte.Po"; else rm -f 
".deps/yaml2byte.Tpo"; exit 1; fi
yaml2byte.c: In function `syck_yaml2byte_handler':
yaml2byte.c:192: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
yaml2byte.c:202: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
yaml2byte.c:205: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
yaml2byte.c: In function `syck_yaml2byte':
yaml2byte.c:230: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
re2c token.re > token.c.new && mv token.c.new token.c
/bin/sh: re2c: command not found
make[3]: *** [token.c] Error 127
make[3]: Leaving directory `/space/debian/syck-0.42/lib'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/space/debian/syck-0.42'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/space/debian/syck-0.42'
make: *** [debian/stamp-makefile-build] Error 2


The second issue is what is likely causing the test cases to fail, and
that is some missing includes.  Without these includes, pointers
returned by functions are assumed to be integers, and are therefore
truncated on 64-bit systems where pointers are larger than integers.

This patch fixes both issues.


diff -urN syck-0.42.orig/lib/syck.c syck-0.42/lib/syck.c
--- syck-0.42.orig/lib/syck.c	2005-05-04 09:08:10.646628000 -0600
+++ syck-0.42/lib/syck.c	2005-05-04 09:42:29.352658029 -0600
@@ -7,6 +7,7 @@
  * Copyright (C) 2003 why the lucky stiff
  */
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include "syck.h"
diff -urN syck-0.42.orig/debian/control syck-0.42/debian/control
--- syck-0.42.orig/debian/control	2005-05-04 09:08:10.657370000 -0600
+++ syck-0.42/debian/control	2005-05-04 09:27:26.942512833 -0600
@@ -2,7 +2,7 @@
 Priority: optional
 Section: devel
 Maintainer: Robert Jordens <[EMAIL PROTECTED]>
-Build-Depends: debhelper (>= 4.1.67), cdbs, dh-buildinfo, flex, python2.3-dev, python-dev, php4-dev (>= 4:4.3.10-10)
+Build-Depends: debhelper (>= 4.1.67), cdbs, dh-buildinfo, flex, python2.3-dev, python-dev, php4-dev (>= 4:4.3.10-10), re2c
 Standards-Version: 3.6.1
 
 Package: libsyck0-dev
diff -urN syck-0.42.orig/lib/bytecode.c syck-0.42/lib/bytecode.c
--- syck-0.42.orig/lib/bytecode.c	2004-04-30 06:31:06.000000000 -0600
+++ syck-0.42/lib/bytecode.c	2005-05-04 09:18:16.585097700 -0600
@@ -8,6 +8,10 @@
  *
  * Copyright (C) 2003 why the lucky stiff
  */
+
+#include <stdlib.h>
+#include <string.h>
+
 #include "syck.h"
 #include "gram.h"
 
diff -urN syck-0.42.orig/lib/handler.c syck-0.42/lib/handler.c
--- syck-0.42.orig/lib/handler.c	2004-04-30 06:31:06.000000000 -0600
+++ syck-0.42/lib/handler.c	2005-05-04 09:18:25.057753846 -0600
@@ -7,6 +7,9 @@
  * Copyright (C) 2003 why the lucky stiff
  */
 
+#include <stdlib.h>
+#include <string.h>
+
 #include "syck.h"
 
 SYMID 
diff -urN syck-0.42.orig/lib/implicit.re syck-0.42/lib/implicit.re
--- syck-0.42.orig/lib/implicit.re	2004-04-30 06:31:06.000000000 -0600
+++ syck-0.42/lib/implicit.re	2005-05-04 09:19:31.928846777 -0600
@@ -7,6 +7,7 @@
  * Copyright (C) 2003 why the lucky stiff
  */
 
+#include <stdlib.h>
 #include "syck.h"
 
 #define YYCTYPE     char
diff -urN syck-0.42.orig/lib/node.c syck-0.42/lib/node.c
--- syck-0.42.orig/lib/node.c	2004-04-30 06:31:06.000000000 -0600
+++ syck-0.42/lib/node.c	2005-05-04 09:18:30.621230341 -0600
@@ -7,6 +7,9 @@
  * Copyright (C) 2003 why the lucky stiff
  */
 
+#include <stdlib.h>
+#include <string.h>
+
 #include "syck.h"
 
 /*
diff -urN syck-0.42.orig/lib/token.re syck-0.42/lib/token.re
--- syck-0.42.orig/lib/token.re	2004-04-30 06:31:06.000000000 -0600
+++ syck-0.42/lib/token.re	2005-05-04 09:19:06.444472089 -0600
@@ -6,6 +6,8 @@
  *
  * Copyright (C) 2003 why the lucky stiff
  */
+#include <stdlib.h>
+#include <string.h>
 #include "syck.h"
 #include "gram.h"
 
diff -urN syck-0.42.orig/lib/yaml2byte.c syck-0.42/lib/yaml2byte.c
--- syck-0.42.orig/lib/yaml2byte.c	2004-04-30 06:31:06.000000000 -0600
+++ syck-0.42/lib/yaml2byte.c	2005-05-04 09:18:47.227675450 -0600
@@ -9,6 +9,8 @@
 //   WARNING WARNING WARNING  --- THIS IS *NOT JUST* PLAYING
 //   ANYMORE! -- WHY HAS EMBRACED THIS AS THE REAL THING!
 // 
+#include <stdlib.h>
+#include <string.h>
 #include <syck.h>
 #include <assert.h>
 #define YAMLBYTE_UTF8

Reply via email to