Bug#280265: libgda2: FTBFS (amd64/gcc-3.4): label at end of compound statement

Andreas Jochens Andreas Jochens <aj@andaco.de>, 280265@bugs.debian.org
Mon, 08 Nov 2004 14:57:29 +0100


Package: libgda2
Severity: normal
Tags: patch

When building 'libgda2' with gcc-3.4 on amd64 I get the following error:

 x86_64-linux-gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"libgda\" -DVERSION=\"1.0.4\" -DBONOBO_EXPLICIT_TRANSLATION_DOMAIN=\"libgda-2\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DGETTEXT_PACKAGE=\"libgda-2\" -DHAVE_LOCALE_H=1 -DHAVE_LC_MESSAGES=1 -DHAVE_BIND_TEXTDOMAIN_CODESET=1 -DHAVE_GETTEXT=1 -DHAVE_DCGETTEXT=1 -DENABLE_NLS=1 -DHAVE_SQLITE=1 -DHAVE_POPT_H=1 -DHAVE_READLINE_READLINE_H=1 -DHAVE_READLINE_HISTORY_H=1 -I. -I. -I.. -I.. -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2 -DLIBGDA_PLUGINDIR=\"/usr/lib/libgda/providers\" -DLIBGDA_LOCALEDIR=\"/usr/share/locale\" -DLIBGDA_GLOBAL_CONFIG_FILE=\"/etc/libgda/config\" -g -O2 -Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-sign-compare -MT gda-util.lo -MD -MP -MF .deps/gda-util.Tpo -c gda-util.c  -fPIC -DPIC -o .libs/gda-util.o
gda-util.c: In function `gda_type_to_string':
gda-util.c:64: error: label at end of compound statement
gda-util.c: In function `gda_sql_replace_placeholders':
gda-util.c:152: warning: passing arg 1 of `sql_parse' discards qualifiers from pointer target type
gda-util.c:146: warning: unused variable `str'
make[2]: *** [gda-util.lo] Error 1
make[2]: Leaving directory `/libgda2-1.0.4/build-tree/libgda-1.0.4/libgda'

With the attached patch 'libgda2' can be compiled on amd64 using gcc-3.4.

Regards
Andreas Jochens

diff -urN ../tmp-orig/libgda2-1.0.4/debian/patches/003_gcc-3.4_fix.patch ./debian/patches/003_gcc-3.4_fix.patch
--- ../tmp-orig/libgda2-1.0.4/debian/patches/003_gcc-3.4_fix.patch	1970-01-01 00:00:00.000000000 +0000
+++ ./debian/patches/003_gcc-3.4_fix.patch	2004-11-03 09:14:22.814366456 +0000
@@ -0,0 +1,86 @@
+--- gda-util.c	2004-01-15 12:56:40.000000000 +0100
++++ libgda-1.0.4/libgda/gda-util.c	2004-07-20 15:33:52.641654120 +0200
+@@ -60,7 +60,6 @@
+ 	case GDA_VALUE_TYPE_TIME : return "time";
+ 	case GDA_VALUE_TYPE_TIMESTAMP : return "timestamp";
+ 	case GDA_VALUE_TYPE_TINYINT : return "tinyint";
+-	default:
+ 	}
+ 
+ 	return "string";
+diff -urN tmp/providers/ldap/gda-ldap-provider.c libgda-1.0.4/providers/ldap/gda-ldap-provider.c
+--- tmp/providers/ldap/gda-ldap-provider.c	2003-02-03 18:12:13.000000000 +0100
++++ libgda-1.0.4/providers/ldap/gda-ldap-provider.c	2004-07-20 16:41:30.597709115 +0200
+@@ -275,7 +275,6 @@
+ 	switch (feature) {
+ 	case GDA_CONNECTION_FEATURE_SQL :
+ 		return TRUE;
+-	default :
+ 	}
+ 
+ 	return FALSE;
+@@ -466,7 +465,6 @@
+ 		return get_ldap_tables (cnc, params);
+ 	case GDA_CONNECTION_SCHEMA_TYPES :
+ 		return get_ldap_types (cnc, params);
+-	default :
+ 	}
+ 
+ 	return NULL;
+diff -urN tmp/providers/mysql/gda-mysql-provider.c libgda-1.0.4/providers/mysql/gda-mysql-provider.c
+--- tmp/providers/mysql/gda-mysql-provider.c	2003-11-26 22:01:22.000000000 +0100
++++ libgda-1.0.4/providers/mysql/gda-mysql-provider.c	2004-07-20 16:40:32.877135258 +0200
+@@ -510,7 +510,6 @@
+ 
+ 		g_free (str);
+ 		break;
+-	default:
+ 	}
+ 
+ 	return reclist;
+@@ -655,7 +654,6 @@
+ 	case GDA_CONNECTION_FEATURE_SQL :
+ 	case GDA_CONNECTION_FEATURE_TRANSACTIONS :
+ 		return TRUE;
+-	default :
+ 	}
+ 
+ 	return FALSE;
+@@ -1187,7 +1185,6 @@
+ 		return get_mysql_tables (cnc, params);
+ 	case GDA_CONNECTION_SCHEMA_TYPES :
+ 		return get_mysql_types (cnc, params);
+-	default :
+ 	}
+ 
+ 	return NULL;
+diff -urN tmp/providers/sqlite/gda-sqlite-provider.c libgda-1.0.4/providers/sqlite/gda-sqlite-provider.c
+--- tmp/providers/sqlite/gda-sqlite-provider.c	2004-07-20 16:07:47.549789000 +0200
++++ libgda-1.0.4/providers/sqlite/gda-sqlite-provider.c	2004-07-20 16:41:01.180532007 +0200
+@@ -624,7 +624,6 @@
+ 	case GDA_CONNECTION_FEATURE_TRIGGERS :
+ 	case GDA_CONNECTION_FEATURE_VIEWS :
+ 		return TRUE;
+-	default:
+ 	}
+ 
+ 	return FALSE;
+@@ -810,7 +809,6 @@
+ 		return get_tables (cnc);
+ 	case GDA_CONNECTION_SCHEMA_TYPES :
+ 		return get_types ();
+-	default:
+ 	}
+ 
+ 	return NULL;
+diff -urN tmp/providers/xml/gda-xml-provider.c libgda-1.0.4/providers/xml/gda-xml-provider.c
+--- tmp/providers/xml/gda-xml-provider.c	2003-09-02 01:55:02.000000000 +0200
++++ libgda-1.0.4/providers/xml/gda-xml-provider.c	2004-07-20 16:41:47.837297080 +0200
+@@ -681,7 +681,6 @@
+ 		return get_tables (cnc, xmldb);
+ 	case GDA_CONNECTION_SCHEMA_TYPES :
+ 		return get_types (cnc);
+-	default :
+ 	}
+ 
+ 	return NULL;
diff -urN ../tmp-orig/libgda2-1.0.4/debian/patches/004_amd64_lib.patch ./debian/patches/004_amd64_lib.patch
--- ../tmp-orig/libgda2-1.0.4/debian/patches/004_amd64_lib.patch	1970-01-01 00:00:00.000000000 +0000
+++ ./debian/patches/004_amd64_lib.patch	2004-11-03 09:46:01.444730768 +0000
@@ -0,0 +1,72 @@
+diff -urN tmp/aclocal.m4 libgda-1.0.4/aclocal.m4
+--- tmp/aclocal.m4	2004-04-18 19:09:26.000000000 +0000
++++ libgda-1.0.4/aclocal.m4	2004-11-03 09:45:23.908437152 +0000
+@@ -2887,7 +2887,7 @@
+   hardcode_into_libs=yes
+ 
+   case $LD in # libtool.m4 will add one of these switches to LD
+-  *"-m elf_x86_64"*|*"-m elf64ppc"*|*"-m elf64_s390"*|*"-m elf64_sparc"*)
++  *"-m elf64ppc"*|*"-m elf64_s390"*|*"-m elf64_sparc"*)
+     sys_lib_dlsearch_path_spec="/lib64 /usr/lib64"
+     sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64"
+     ;;
+diff -urN tmp/configure libgda-1.0.4/configure
+--- tmp/configure	2004-04-18 19:09:46.000000000 +0000
++++ libgda-1.0.4/configure	2004-11-03 09:45:08.787735848 +0000
+@@ -8694,7 +8694,7 @@
+   hardcode_into_libs=yes
+ 
+   case $LD in # libtool.m4 will add one of these switches to LD
+-  *"-m elf_x86_64"*|*"-m elf64ppc"*|*"-m elf64_s390"*|*"-m elf64_sparc"*)
++  *"-m elf64ppc"*|*"-m elf64_s390"*|*"-m elf64_sparc"*)
+     sys_lib_dlsearch_path_spec="/lib64 /usr/lib64"
+     sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64"
+     ;;
+@@ -12241,7 +12241,7 @@
+   hardcode_into_libs=yes
+ 
+   case $LD in # libtool.m4 will add one of these switches to LD
+-  *"-m elf_x86_64"*|*"-m elf64ppc"*|*"-m elf64_s390"*|*"-m elf64_sparc"*)
++  *"-m elf64ppc"*|*"-m elf64_s390"*|*"-m elf64_sparc"*)
+     sys_lib_dlsearch_path_spec="/lib64 /usr/lib64"
+     sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64"
+     ;;
+@@ -15225,7 +15225,7 @@
+   hardcode_into_libs=yes
+ 
+   case $LD in # libtool.m4 will add one of these switches to LD
+-  *"-m elf_x86_64"*|*"-m elf64ppc"*|*"-m elf64_s390"*|*"-m elf64_sparc"*)
++  *"-m elf64ppc"*|*"-m elf64_s390"*|*"-m elf64_sparc"*)
+     sys_lib_dlsearch_path_spec="/lib64 /usr/lib64"
+     sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64"
+     ;;
+@@ -17493,7 +17493,7 @@
+   hardcode_into_libs=yes
+ 
+   case $LD in # libtool.m4 will add one of these switches to LD
+-  *"-m elf_x86_64"*|*"-m elf64ppc"*|*"-m elf64_s390"*|*"-m elf64_sparc"*)
++  *"-m elf64ppc"*|*"-m elf64_s390"*|*"-m elf64_sparc"*)
+     sys_lib_dlsearch_path_spec="/lib64 /usr/lib64"
+     sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64"
+     ;;
+@@ -21221,7 +21221,7 @@
+ 
+ 
+ case $host_cpu in
+-x86_64* | sparc64*) lib="lib64";;
++sparc64*) lib="lib64";;
+ *) lib="lib";;
+ esac
+ 
+diff -urN tmp/configure.in libgda-1.0.4/configure.in
+--- tmp/configure.in	2004-04-12 16:31:45.000000000 +0000
++++ libgda-1.0.4/configure.in	2004-11-03 09:44:04.646486800 +0000
+@@ -113,7 +113,7 @@
+ dnl Test for lib64 architectures
+ dnl FIXME: should really check target
+ case $host_cpu in
+-x86_64* | sparc64*) lib="lib64";;
++sparc64*) lib="lib64";;
+ *) lib="lib";;
+ esac
+