Subject: | compilation failure with gcc 2.95.3 |
We have a pretty old version of gcc on some of our systems and it does
not like it when there is code above the declarations in functions. It
fails with the following error:
BerkeleyDB.xs: In function `db_errcall_cb':
BerkeleyDB.xs:1347: parse error before `*'
BerkeleyDB.xs:1348: `sv' undeclared (first use in this function)
BerkeleyDB.xs:1348: (Each undeclared identifier is reported only once
BerkeleyDB.xs:1348: for each function it appears in.)
make: *** [BerkeleyDB.o] Error 1
/usr/bin/make -- NOT OK
I have attached a patch that moves the declaration of 'sv' up to the top
of the function. After applying that patch BerkeleyDB compiles and
installs just fine.
Thanks,
Mark Drago.
Subject: | berkeley_db_ansi_c_declaration.patch |
diff -ru BerkeleyDB-0.32/BerkeleyDB.xs BerkeleyDB-0.32.modified/BerkeleyDB.xs
--- BerkeleyDB-0.32/BerkeleyDB.xs Tue Jul 10 08:28:00 2007
+++ BerkeleyDB-0.32.modified/BerkeleyDB.xs Tue Sep 18 16:41:24 2007
@@ -1326,6 +1326,8 @@
db_errcall_cb(const char * db_errpfx, char * buffer)
#endif
{
+ SV * sv;
+
Trace(("In errcall_cb \n")) ;
#if 0
@@ -1344,7 +1346,7 @@
#endif
- SV * sv = perl_get_sv(ERR_BUFF, FALSE) ;
+ sv = perl_get_sv(ERR_BUFF, FALSE) ;
if (sv) {
if (db_errpfx)
sv_setpvf(sv, "%s: %s", db_errpfx, buffer) ;
Only in BerkeleyDB-0.32.modified: BerkeleyDB.xs~