Comment 3 for bug 15356

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <email address hidden>
Date: Sun, 13 Mar 2005 14:05:09 +0100
From: Andreas Jochens <email address hidden>
To: Debian Bug Tracking System <email address hidden>
Subject: samba: FTBFS (amd64/gcc-4.0): array type has incomplete element type

Package: samba
Severity: normal
Tags: patch

When building 'samba' on amd64 with gcc-4.0,
I get the following error:

Compiling dynconfig.c
In file included from include/smb.h:1673,
                 from include/includes.h:817,
                 from dynconfig.c:21:
include/popt_common.h:25: error: array type has incomplete element type
include/popt_common.h:26: error: array type has incomplete element type
include/popt_common.h:27: error: array type has incomplete element type
include/popt_common.h:28: error: array type has incomplete element type
make[1]: *** [dynconfig.o] Error 1
make[1]: Leaving directory `/samba-3.0.10/source'
make: *** [build-stamp] Error 2

With the attached patch 'samba' can be compiled
on amd64 using gcc-4.0.

Regards
Andreas Jochens

diff -urN ../tmp-orig/samba-3.0.10/debian/patches/gcc4-fix.patch ./debian/patches/gcc4-fix.patch
--- ../tmp-orig/samba-3.0.10/debian/patches/gcc4-fix.patch 1970-01-01 01:00:00.000000000 +0100
+++ ./debian/patches/gcc4-fix.patch 2005-03-11 12:49:11.159111783 +0100
@@ -0,0 +1,57 @@
+diff -urN source.orig/include/popt_common.h samba/source/include/popt_common.h
+--- source.orig/include/popt_common.h 2004-10-25 23:05:06.000000000 +0200
++++ samba/source/include/popt_common.h 2005-03-11 12:48:21.334047738 +0100
+@@ -22,10 +22,10 @@
+ #define _POPT_COMMON_H
+
+ /* Common popt structures */
+-extern struct poptOption popt_common_samba[];
+-extern struct poptOption popt_common_connection[];
+-extern struct poptOption popt_common_version[];
+-extern struct poptOption popt_common_credentials[];
++extern struct poptOption *popt_common_samba;
++extern struct poptOption *popt_common_connection;
++extern struct poptOption *popt_common_version;
++extern struct poptOption *popt_common_credentials;
+
+ #ifndef POPT_TABLEEND
+ #define POPT_TABLEEND { NULL, '\0', 0, 0, 0, NULL, NULL }
+diff -urN source.orig/lib/popt_common.c samba/source/lib/popt_common.c
+--- source.orig/lib/popt_common.c 2004-10-25 23:04:59.000000000 +0200
++++ samba/source/lib/popt_common.c 2005-03-11 12:48:50.942166331 +0100
+@@ -114,7 +114,7 @@
+ }
+ }
+
+-struct poptOption popt_common_connection[] = {
++struct poptOption *popt_common_connection = {
+ { NULL, 0, POPT_ARG_CALLBACK, popt_common_callback },
+ { "socket-options", 'O', POPT_ARG_STRING, NULL, 'O', "socket options to use",
+ "SOCKETOPTIONS" },
+@@ -125,7 +125,7 @@
+ POPT_TABLEEND
+ };
+
+-struct poptOption popt_common_samba[] = {
++struct poptOption *popt_common_samba = {
+ { NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE, popt_common_callback },
+ { "debuglevel", 'd', POPT_ARG_STRING, NULL, 'd', "Set debug level", "DEBUGLEVEL" },
+ { "configfile", 's', POPT_ARG_STRING, NULL, 's', "Use alternative configuration file", "CONFIGFILE" },
+@@ -134,7 +134,7 @@
+ POPT_TABLEEND
+ };
+
+-struct poptOption popt_common_version[] = {
++struct poptOption *popt_common_version = {
+ { NULL, 0, POPT_ARG_CALLBACK, popt_common_callback },
+ { "version", 'V', POPT_ARG_NONE, NULL, 'V', "Print version" },
+ POPT_TABLEEND
+@@ -382,7 +382,7 @@
+
+
+
+-struct poptOption popt_common_credentials[] = {
++struct poptOption *popt_common_credentials = {
+ { NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE, popt_common_credentials_callback },
+ { "user", 'U', POPT_ARG_STRING, NULL, 'U', "Set the network username", "USERNAME" },
+ { "no-pass", 'N', POPT_ARG_NONE, &cmdline_auth_info.got_pass, 0, "Don't ask for a password" },