dpkg: FTBFS (amd64/gcc-4.0): array type has incomplete element type
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Debian |
Fix Released
|
Unknown
|
|||
Ubuntu |
Fix Released
|
High
|
Scott James Remnant (Canonical) |
Bug Description
Automatically imported from Debian bug report #299699 http://
In Debian Bug tracker #299699, Adam Heath (doogie-debian) wrote : Re: Bug#299699: dpkg: FTBFS (amd64/gcc-4.0): array type has incomplete element type | #1 |
In Debian Bug tracker #299699, Andreas Jochens (aj-andaco) wrote : | #2 |
On 05-Mar-15 17:48, Adam Heath wrote:
> I don't agree with the patch; move the struct definition.
Hello,
thank you for your fast reply to my report.
Is the following patch OK?
Regards
Andreas Jochens
diff -urN ../tmp-
--- ../tmp-
+++ ./include/
@@ -30,7 +30,6 @@
const char *canon;
};
-extern const struct fieldinfo fieldinfos[];
extern const struct nickname nicknames[];
extern const int nfields; /* = elements in fieldinfos, including the sentinels */
@@ -68,6 +67,8 @@
unsigned int integer;
};
+extern const struct fieldinfo fieldinfos[];
+
void parseerr(FILE *file, const char *filename, int lno, FILE *warnto, int *warncount,
In Debian Bug tracker #299699, Scott James Remnant (Canonical) (canonical-scott) wrote : Re: Bug#299699: dpkg: FTBFS (amd64/gcc-4.0): array type has incomplete element type | #3 |
On Tue, 2005-03-15 at 17:48 -0600, Adam Heath wrote:
> On Tue, 15 Mar 2005, Andreas Jochens wrote:
>
> > the latest version of gcc-4.0 is even more restrictive than the previous
> > ones. There is a new error message 'array type has incomplete element type'
> > for constructs like 'extern struct st x[];' when 'struct st' has not
> > been defined.
> >
> > The attached patch includes the patch from BTS bug #282669. This part has
> > already been applied to 'experimental' (thanks!).
> I don't agree with the patch; move the struct definition.
>
The fieldinfo struct definition includes members of a function typedef
which have struct fieldinfo pointers as arguments.
Moving the definition of the extern arrays to the bottom of the file
(while retaining the fieldinfo struct prototype at the top) is the right
solution.
Scott
--
Have you ever, ever felt like this?
Had strange things happen? Are you going round the twist?
In Debian Bug tracker #299699, Scott James Remnant (Canonical) (canonical-scott) wrote : tagging 299699 | #4 |
# Automatically generated email from bts, devscripts version 2.8.6
tags 299699 pending
In Debian Bug tracker #299699, Scott James Remnant (Canonical) (canonical-scott) wrote : | #5 |
# Automatically generated email from bts, devscripts version 2.8.6
tags 299699 - pending
In Debian Bug tracker #299699, Scott James Remnant (Canonical) (canonical-scott) wrote : Fixed in upload of dpkg 1.13.2 to experimental | #6 |
tag 136110 + fixed-in-
tag 143882 + fixed-in-
tag 164595 + fixed-in-
tag 173205 + fixed-in-
tag 184635 + fixed-in-
tag 193877 + fixed-in-
tag 223381 + fixed-in-
tag 237684 + fixed-in-
tag 253860 + fixed-in-
tag 258608 + fixed-in-
tag 261822 + fixed-in-
tag 263743 + fixed-in-
tag 264195 + fixed-in-
tag 270241 + fixed-in-
tag 277890 + fixed-in-
tag 282790 + fixed-in-
tag 284499 + fixed-in-
tag 286632 + fixed-in-
tag 287152 + fixed-in-
tag 291816 + fixed-in-
tag 296030 + fixed-in-
tag 299090 + fixed-in-
tag 299699 + fixed-in-
tag 53376 + fixed-in-
tag 6633 + fixed-in-
tag 77109 + fixed-in-
tag 92263 + fixed-in-
tag 957 + fixed-in-
tag 95755 + fixed-in-
quit
This message was generated automatically in response to an
upload to the experimental distribution. The .changes file follows.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.7
Date: Fri, 18 Mar 2005 16:21:32 +0000
Source: dpkg
Binary: dpkg dselect dpkg-dev
Architecture: source i386 all
Version: 1.13.2
Distribution: experimental
Urgency: low
Maintainer: Dpkg Development <email address hidden>
Changed-By: Scott James Remnant <email address hidden>
Description:
dpkg - Package maintenance system for Debian
dpkg-dev - Package building tools for Debian
dselect - a user tool to manage Debian packages
Closes: 957 6633 53376 77109 92263 95755 136110 143882 164595 173205 184635 193877 223381 237684 253860 258608 261822 263743 264195 270241 277890 282790 284499 286632 287152 291816 296030 299090 299699
Changes:
dpkg (1.13.2) experimental; urgency=low
.
* md5sum has been removed, the coreutils or textutils version will be
diverted to /usr/bin/md5sum. Closes: #6633, #136110.
The following bugs are filed against the dpkg md5sum, so no longer apply.
Closes: #95755, #193877, #223381, #264195, #270241, #286632,
* Take Replaces into account when installing packages; don't issue a
"trying to overwrite" error if the file that already exists is in
a package that Replaces the one being installed.
Closes: #164595, #184635, #277890.
* Allow actions and status changes to be logged to a file. Disabled by
default, uncomment line in /etc/dpkg/dpkg.cfg to enable.
Closes: #957, #53376, #77109, #143882, #284499.
* Don't truncate output of 'dpkg -l' when stdout is not a tty.
Closes: #92263, #253860, #258608, #261822, #282790.
* Fix further compilation problems with gcc 4.0. Closes: #299699
* Handle tar files without trailing slash in directory names.
Closes: #287152.
* Output arguments to maintainer scripts with -D2. Closes: #237684,
#296030.
.
* Architecture Support:
- Added ppc64. Closes: #263743.
- Split archtable into cputable and ostable, archtable is retained
for compatibility with other packages that might use it only.
- dpkg-archite...
In Debian Bug tracker #299699, Scott James Remnant (Canonical) (canonical-scott) wrote : | #7 |
tag 136110 - pending
tag 143882 - pending
tag 164595 - pending
tag 173205 - pending
tag 184635 - pending
tag 193877 - pending
tag 223381 - pending
tag 237684 - pending
tag 253860 - pending
tag 258608 - pending
tag 261822 - pending
tag 263743 - pending
tag 264195 - pending
tag 270241 - pending
tag 277890 - pending
tag 282790 - pending
tag 284499 - pending
tag 286632 - pending
tag 287152 - pending
tag 291816 - pending
tag 296030 - pending
tag 299090 - pending
tag 299699 - pending
tag 53376 - pending
tag 6633 - pending
tag 77109 - pending
tag 92263 - pending
tag 957 - pending
tag 95755 - pending
Debian Bug Importer (debzilla) wrote : | #8 |
Automatically imported from Debian bug report #299699 http://
Debian Bug Importer (debzilla) wrote : | #9 |
Message-Id: <email address hidden>
Date: Tue, 15 Mar 2005 22:51:55 +0100
From: Andreas Jochens <email address hidden>
To: Debian Bug Tracking System <email address hidden>
Subject: dpkg: FTBFS (amd64/gcc-4.0): array type has incomplete element type
Package: dpkg
Severity: normal
Tags: patch
Hello,
the latest version of gcc-4.0 is even more restrictive than the previous
ones. There is a new error message 'array type has incomplete element type'
for constructs like 'extern struct st x[];' when 'struct st' has not
been defined.
When building 'dpkg' on amd64 with gcc-4.0,
I get the following error:
gcc -g -O2 -Wall -Wwrite-strings -Wpointer-arith -Wimplicit -Wnested-externs -Wstrict-prototypes -Wmissing-
In file included from ../../lib/
../../include/
../../lib/dump.c: In function 'w_charfield':
../../lib/
../../lib/dump.c: In function 'w_booleandefno':
../../lib/
make[3]: *** [dump.o] Error 1
make[3]: Leaving directory `/dpkg-
With the attached patch 'dpkg' can be compiled
on amd64 using gcc-4.0.
The attached patch includes the patch from BTS bug #282669. This part has
already been applied to 'experimental' (thanks!).
Regards
Andreas Jochens
diff -urN ../tmp-
--- ../tmp-
+++ ./include/
@@ -30,7 +30,7 @@
const char *canon;
};
-extern const struct fieldinfo fieldinfos[];
+extern const struct fieldinfo *fieldinfos;
extern const struct nickname nicknames[];
extern const int nfields; /* = elements in fieldinfos, including the sentinels */
diff -urN ../tmp-
--- ../tmp-
+++ ./lib/parse.c 2005-03-15 22:34:59.432555170 +0100
@@ -39,7 +39,7 @@
#include <sys/mman.h>
#endif
-const struct fieldinfo fieldinfos[]= {
+const struct fieldinfo *fieldinfos= {
/* NB: capitalisation of these strings is important. */
{ "Package", f_name, w_name },
{ "Essential", f_boolean, w_booleandefno, PKGIFPOFF(
diff -urN ../tmp-
--- ../tmp-
+++ ./lib/mlib.c 2005-03-15 22:33:48.819188906 +0100
@@ -189,7 +189,7 @@
switch(
case BUFFER_WRITE_BUF:
- (char*)
+ data->data.ptr ...
Debian Bug Importer (debzilla) wrote : | #10 |
Message-ID: <email address hidden>
Date: Tue, 15 Mar 2005 17:48:32 -0600 (CST)
From: Adam Heath <email address hidden>
To: Andreas Jochens <email address hidden>, <email address hidden>
Subject: Re: Bug#299699: dpkg: FTBFS (amd64/gcc-4.0): array type has incomplete
element type
tag 299699 - patch
thanks
On Tue, 15 Mar 2005, Andreas Jochens wrote:
> the latest version of gcc-4.0 is even more restrictive than the previous
> ones. There is a new error message 'array type has incomplete element type'
> for constructs like 'extern struct st x[];' when 'struct st' has not
> been defined.
>
> When building 'dpkg' on amd64 with gcc-4.0,
> I get the following error:
>
> gcc -g -O2 -Wall -Wwrite-strings -Wpointer-arith -Wimplicit -Wnested-externs -Wstrict-prototypes -Wmissing-
> In file included from ../../lib/
> ../../include/
> ../../lib/dump.c: In function 'w_charfield':
> ../../lib/
> ../../lib/dump.c: In function 'w_booleandefno':
> ../../lib/
> make[3]: *** [dump.o] Error 1
> make[3]: Leaving directory `/dpkg-
>
> With the attached patch 'dpkg' can be compiled
> on amd64 using gcc-4.0.
>
> The attached patch includes the patch from BTS bug #282669. This part has
> already been applied to 'experimental' (thanks!).
>
> Regards
> Andreas Jochens
I don't agree with the patch; move the struct definition.
Debian Bug Importer (debzilla) wrote : | #11 |
Message-ID: <email address hidden>
Date: Wed, 16 Mar 2005 08:19:36 +0100
From: Andreas Jochens <email address hidden>
To: Adam Heath <email address hidden>
Cc: Andreas Jochens <email address hidden>, <email address hidden>
Subject: Re: Bug#299699: dpkg: FTBFS (amd64/gcc-4.0): array type has incomplete element type
On 05-Mar-15 17:48, Adam Heath wrote:
> I don't agree with the patch; move the struct definition.
Hello,
thank you for your fast reply to my report.
Is the following patch OK?
Regards
Andreas Jochens
diff -urN ../tmp-
--- ../tmp-
+++ ./include/
@@ -30,7 +30,6 @@
const char *canon;
};
-extern const struct fieldinfo fieldinfos[];
extern const struct nickname nicknames[];
extern const int nfields; /* = elements in fieldinfos, including the sentinels */
@@ -68,6 +67,8 @@
unsigned int integer;
};
+extern const struct fieldinfo fieldinfos[];
+
void parseerr(FILE *file, const char *filename, int lno, FILE *warnto, int *warncount,
Debian Bug Importer (debzilla) wrote : | #12 |
Message-Id: <email address hidden>
Date: Wed, 16 Mar 2005 21:13:48 +0000
From: Scott James Remnant <email address hidden>
To: <email address hidden>, Adam Heath <email address hidden>
Cc: Andreas Jochens <email address hidden>
Subject: Re: Bug#299699: dpkg: FTBFS (amd64/gcc-4.0): array type has
incomplete element type
--=-5lZDfOS506+
Content-Type: text/plain
Content-
On Tue, 2005-03-15 at 17:48 -0600, Adam Heath wrote:
> On Tue, 15 Mar 2005, Andreas Jochens wrote:
>=20
> > the latest version of gcc-4.0 is even more restrictive than the previou=
s
> > ones. There is a new error message 'array type has incomplete element t=
ype'
> > for constructs like 'extern struct st x[];' when 'struct st' has not
> > been defined.
> >
> > The attached patch includes the patch from BTS bug #282669. This part h=
as
> > already been applied to 'experimental' (thanks!).
> I don't agree with the patch; move the struct definition.
>=20
The fieldinfo struct definition includes members of a function typedef
which have struct fieldinfo pointers as arguments.
Moving the definition of the extern arrays to the bottom of the file
(while retaining the fieldinfo struct prototype at the top) is the right
solution.
Scott
--=20
Have you ever, ever felt like this?
Had strange things happen? Are you going round the twist?
--=-5lZDfOS506+
Content-Type: application/
Content-
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
iD8DBQBCOKGMIex
wJkOxf4bTl6hJcj
=8cdF
-----END PGP SIGNATURE-----
--=-5lZDfOS506+
Debian Bug Importer (debzilla) wrote : | #13 |
Message-Id: <email address hidden>
Date: Wed, 16 Mar 2005 21:13:52 +0000
From: Scott James Remnant <email address hidden>
To: <email address hidden>
Subject: tagging 299699
# Automatically generated email from bts, devscripts version 2.8.6
tags 299699 pending
Debian Bug Importer (debzilla) wrote : | #14 |
Message-Id: <email address hidden>
Date: Fri, 18 Mar 2005 16:32:28 +0000
From: Scott James Remnant <email address hidden>
To: <email address hidden>
Subject: tagging 299699
# Automatically generated email from bts, devscripts version 2.8.6
tags 299699 - pending
Debian Bug Importer (debzilla) wrote : | #15 |
Message-Id: <email address hidden>
Date: Fri, 18 Mar 2005 11:47:13 -0500
From: Scott James Remnant <email address hidden>
To: <email address hidden>
Cc: Scott James Remnant <email address hidden>, Dpkg Development <email address hidden>
Subject: Fixed in upload of dpkg 1.13.2 to experimental
tag 136110 + fixed-in-
tag 143882 + fixed-in-
tag 164595 + fixed-in-
tag 173205 + fixed-in-
tag 184635 + fixed-in-
tag 193877 + fixed-in-
tag 223381 + fixed-in-
tag 237684 + fixed-in-
tag 253860 + fixed-in-
tag 258608 + fixed-in-
tag 261822 + fixed-in-
tag 263743 + fixed-in-
tag 264195 + fixed-in-
tag 270241 + fixed-in-
tag 277890 + fixed-in-
tag 282790 + fixed-in-
tag 284499 + fixed-in-
tag 286632 + fixed-in-
tag 287152 + fixed-in-
tag 291816 + fixed-in-
tag 296030 + fixed-in-
tag 299090 + fixed-in-
tag 299699 + fixed-in-
tag 53376 + fixed-in-
tag 6633 + fixed-in-
tag 77109 + fixed-in-
tag 92263 + fixed-in-
tag 957 + fixed-in-
tag 95755 + fixed-in-
quit
This message was generated automatically in response to an
upload to the experimental distribution. The .changes file follows.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.7
Date: Fri, 18 Mar 2005 16:21:32 +0000
Source: dpkg
Binary: dpkg dselect dpkg-dev
Architecture: source i386 all
Version: 1.13.2
Distribution: experimental
Urgency: low
Maintainer: Dpkg Development <email address hidden>
Changed-By: Scott James Remnant <email address hidden>
Description:
dpkg - Package maintenance system for Debian
dpkg-dev - Package building tools for Debian
dselect - a user tool to manage Debian packages
Closes: 957 6633 53376 77109 92263 95755 136110 143882 164595 173205 184635 193877 223381 237684 253860 258608 261822 263743 264195 270241 277890 282790 284499 286632 287152 291816 296030 299090 299699
Changes:
dpkg (1.13.2) experimental; urgency=low
.
* md5sum has been removed, the coreutils or textutils version will be
diverted to /usr/bin/md5sum. Closes: #6633, #136110.
The following bugs are filed against the dpkg md5sum, so no longer apply.
Closes: #95755, #193877, #223381, #264195, #270241, #286632,
* Take Replaces into account when installing packages; don't issue a
"trying to overwrite" error if the file that already exists is in
a package that Replaces the one being installed.
Closes: #164595, #184635, #277890.
* Allow actions and status changes to be logged to a file. Disabled by
default, uncomment line in /etc/dpkg/dpkg.cfg to enable.
Closes: #957, #53376, #77109, #143882, #284499.
* Don't truncate output of 'dpkg -l' when stdout is not a tty.
Closes: #92263, #253860, #258608, #261822, #282790.
* Fix further compilation problems with gcc 4.0. Closes: #299699
* Handle tar files without trailing slash in directory names.
Closes: #287152....
Debian Bug Importer (debzilla) wrote : | #16 |
Message-ID: <email address hidden>
Date: Sun, 20 Mar 2005 14:33:18 +0000
From: Scott James Remnant <email address hidden>
To: <email address hidden>
tag 136110 - pending
tag 143882 - pending
tag 164595 - pending
tag 173205 - pending
tag 184635 - pending
tag 193877 - pending
tag 223381 - pending
tag 237684 - pending
tag 253860 - pending
tag 258608 - pending
tag 261822 - pending
tag 263743 - pending
tag 264195 - pending
tag 270241 - pending
tag 277890 - pending
tag 282790 - pending
tag 284499 - pending
tag 286632 - pending
tag 287152 - pending
tag 291816 - pending
tag 296030 - pending
tag 299090 - pending
tag 299699 - pending
tag 53376 - pending
tag 6633 - pending
tag 77109 - pending
tag 92263 - pending
tag 957 - pending
tag 95755 - pending
Scott James Remnant (Canonical) (canonical-scott) wrote : | #17 |
We can fix this by taking the experimental branch of dpkg, or back-porting the
patch.
Matthias Klose (doko) wrote : | #18 |
fixed in 1.13.x
In Debian Bug tracker #299699, Scott James Remnant (Canonical) (canonical-scott) wrote : closing 299699 | #20 |
# Automatically generated email from bts, devscripts version 2.8.6
close 299699
tag 299699 - patch
thanks
On Tue, 15 Mar 2005, Andreas Jochens wrote:
> the latest version of gcc-4.0 is even more restrictive than the previous prototypes -Wmissing- declarations -Wbad-function-cast -Wcast-qual -Wcast-align -Winline -Wmissing-noreturn -Wsign-compare -DHAVE_CONFIG_H -D_GNU_SOURCE -DLOCALEDIR= \"/usr/ share/locale\ " -I../../intl -I../intl -I../../include -I../.. -I../../lib -I../include -I.. -I. -I../../optlib -DUSE_ZLIB -DUSE_BZ2LIB -DCOPYINGFILE= \"/usr/ share/doc/ dpkg/copyright\ " -c ../../lib/dump.c dump.c: 37: parsedump. h:33: error: array type has incomplete element type dump.c: 95: warning: cast discards qualifiers from pointer target type dump.c: 133: warning: cast discards qualifiers from pointer target type 1.10.27/ build/lib'
> ones. There is a new error message 'array type has incomplete element type'
> for constructs like 'extern struct st x[];' when 'struct st' has not
> been defined.
>
> When building 'dpkg' on amd64 with gcc-4.0,
> I get the following error:
>
> gcc -g -O2 -Wall -Wwrite-strings -Wpointer-arith -Wimplicit -Wnested-externs -Wstrict-prototypes -Wmissing-
> In file included from ../../lib/
> ../../include/
> ../../lib/dump.c: In function 'w_charfield':
> ../../lib/
> ../../lib/dump.c: In function 'w_booleandefno':
> ../../lib/
> make[3]: *** [dump.o] Error 1
> make[3]: Leaving directory `/dpkg-
>
> With the attached patch 'dpkg' can be compiled
> on amd64 using gcc-4.0.
>
> The attached patch includes the patch from BTS bug #282669. This part has
> already been applied to 'experimental' (thanks!).
>
> Regards
> Andreas Jochens
I don't agree with the patch; move the struct definition.