[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#318612: marked as done (gcc-4.0: gcc 4.0 refuses to compile void foo(struct bar[]); 3.4 is OK)



Your message dated Sat, 16 Jul 2005 17:35:17 +0200
with message-id <87irza932i.fsf@debian.org>
and subject line Bug#318612: gcc-4.0: gcc 4.0 refuses to compile void foo(struct bar[]); 3.4 is OK
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 16 Jul 2005 14:21:10 +0000
>From jbj@image.dk Sat Jul 16 07:21:10 2005
Return-path: <jbj@image.dk>
Received: from smtp010.tiscali.dk [212.54.64.103] 
	by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
	id 1DtnXS-0001Y8-00; Sat, 16 Jul 2005 07:21:10 -0700
Received: from jbj2.jbj.homelinux.com (62.79.69.37.adsl.he.tiscali.dk [62.79.69.37])
	by smtp010.tiscali.dk (8.12.10/8.12.10) with ESMTP id j6GEL7tG028850;
	Sat, 16 Jul 2005 16:21:07 +0200 (MEST)
Received: from jbj3.jbj.homelinux.com ([10.80.80.83])
	by jbj2.jbj.homelinux.com with esmtp (Exim 3.36 #1 (Debian))
	id 1DtnXP-0000do-00; Sat, 16 Jul 2005 16:21:07 +0200
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Jakob Bohm <jbj@image.dk>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: gcc-4.0: gcc 4.0 refuses to compile void foo(struct bar[]); 3.4 is OK
X-Mailer: reportbug 3.15
Date: Sat, 16 Jul 2005 16:21:07 +0200
Message-Id: <[🔎] E1DtnXP-0000do-00@jbj2.jbj.homelinux.com>
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02

Package: gcc-4.0
Version: 4.0.1-2
Severity: important

gcc 4.0 fails to compile the following 3 line sample:

struct bar;
void baz(struct bar*);
void foo(struct bar[]);

gcc 3.4 and older do not complain.

The issue is that gcc-3.4 and older realize that [] in a parameter is the
same as * and accepts the incomplete structure type, gcc 4.0 does not.

This causes the Linux kernel, version 2.6.11 to miscompile i2c.h preventing
kernel recompile (Someone else has opened a bug against the kernel, but I
still see this as a general gcc bug).

Transcript:

lindev@src.12:~/x1 0$ gcc-4.0 --verbose -Wall -c test1.c
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --enable-nls --without-included-gettext --enable-threads=posix --program-suffix=-4.0 --enable-__cxa_atexit --enable-libstdcxx-allocator=mt --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-gc=boehm --enable-java-awt=gtk --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr --disable-werror --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.0.1 (Debian 4.0.1-2)
 /usr/lib/gcc/i486-linux-gnu/4.0.1/cc1 -quiet -v test1.c -quiet -dumpbase test1.c -mtune=i486 -auxbase test1 -Wall -version -o /tmp/cc7VWjlw.s
ignoring nonexistent directory "/usr/local/include/i486-linux-gnu"
ignoring nonexistent directory "/usr/include/i486-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc/i486-linux-gnu/4.0.1/include
 /usr/include
End of search list.
GNU C version 4.0.1 (Debian 4.0.1-2) (i486-linux-gnu)
        compiled by GNU C version 4.0.1 (Debian 4.0.1-2).
GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129254
test1.c:3: error: array type has incomplete element type

lindev@src.12:~/x1 0$ gcc-3.4 --verbose -Wall -c test1.c
Reading specs from /usr/lib/gcc/i486-linux-gnu/3.4.5/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --libexecdir=/usr/lib --with-gxx-include-dir=/usr/include/c++/3.4 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --program-suffix=-3.4 --enable-__cxa_atexit --enable-libstdcxx-allocator=mt --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-gc=boehm --enable-java-awt=gtk --disable-werror i486-linux-gnu
Thread model: posix
gcc version 3.4.5 20050706 (prerelease) (Debian 3.4.4-5)
 /usr/lib/gcc/i486-linux-gnu/3.4.5/cc1 -quiet -v test1.c -quiet -dumpbase test1.c -mtune=i486 -auxbase test1 -Wall -version -o /tmp/cctzdJGc.s
ignoring nonexistent directory "/usr/local/include/i486-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/i486-linux-gnu/3.4.5/../../../../i486-linux-gnu/include"
ignoring nonexistent directory "/usr/include/i486-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc/i486-linux-gnu/3.4.5/include
 /usr/include
End of search list.
GNU C version 3.4.5 20050706 (prerelease) (Debian 3.4.4-5) (i486-linux-gnu)
        compiled by GNU C version 3.4.5 20050706 (prerelease) (Debian 3.4.4-5).
GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129254
 as -V -Qy --32 -o test1.o /tmp/cctzdJGc.s
GNU assembler version 2.16.1 (i486-linux-gnu) using BFD version 2.16.1 Debian GNU/Linux



-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.11jbj3.2.10
Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8)

Versions of packages gcc-4.0 depends on:
ii  binutils                    2.16.1-2     The GNU assembler, linker and bina
ii  cpp-4.0                     4.0.1-2      The GNU C preprocessor
ii  gcc-4.0-base                4.0.1-2      The GNU Compiler Collection (base 
ii  libc6                       2.3.2.ds1-22 GNU C Library: Shared libraries an
ii  libgcc1                     1:4.0.1-2    GCC support library

Versions of packages gcc-4.0 recommends:
ii  libc6-dev                   2.3.2.ds1-22 GNU C Library: Development Librari
ii  libmudflap0-dev             4.0.1-2      GCC mudflap support libraries (dev

-- no debconf information

---------------------------------------
Received: (at 318612-done) by bugs.debian.org; 16 Jul 2005 15:35:49 +0000
>From falk@debian.org Sat Jul 16 08:35:48 2005
Return-path: <falk@debian.org>
Received: from smtp06.web.de [217.72.192.224] 
	by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
	id 1Dtohg-0008E5-00; Sat, 16 Jul 2005 08:35:48 -0700
Received: from [82.82.216.59] (helo=juist)
	by smtp06.web.de with asmtp (TLSv1:DES-CBC3-SHA:168)
	(WEB.DE 4.105 #297)
	id 1DtohB-000324-00
	for 318612-done@bugs.debian.org; Sat, 16 Jul 2005 17:35:17 +0200
Received: from falk by juist with local (Exim 4.52)
	id 1DtohB-0001zi-3e
	for 318612-done@bugs.debian.org; Sat, 16 Jul 2005 17:35:17 +0200
To: 318612-done@bugs.debian.org
Subject: Re: Bug#318612: gcc-4.0: gcc 4.0 refuses to compile void foo(struct
 bar[]); 3.4 is OK
References: <[🔎] E1DtnXP-0000do-00@jbj2.jbj.homelinux.com>
From: Falk Hueffner <falk@debian.org>
X-Face: "iUeUu$b*W_"w?tV83Y3*r:`rh&dRv}$YnZ3,LVeCZSYVuf[Gpo*5%_=/\_!gc_,SS}[~xZ
 wY77I-M)xHIx:2f56g%/`SOw"Dx%4Xq0&f\Tj~>|QR|vGlU}TBYhiG(K:2<T^
Date: Sat, 16 Jul 2005 17:35:17 +0200
In-Reply-To: <[🔎] E1DtnXP-0000do-00@jbj2.jbj.homelinux.com> (Jakob Bohm's
 message of "Sat, 16 Jul 2005 16:21:07 +0200")
Message-ID: <87irza932i.fsf@debian.org>
User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.5 (cilantro, linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: falk@debian.org
X-Sender: falk.hueffner@web.de
Delivered-To: 318612-done@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02

Jakob Bohm <jbj@image.dk> writes:

> Package: gcc-4.0
> Version: 4.0.1-2
> Severity: important
>
> gcc 4.0 fails to compile the following 3 line sample:
>
> struct bar;
> void baz(struct bar*);
> void foo(struct bar[]);
>
> gcc 3.4 and older do not complain.
>
> The issue is that gcc-3.4 and older realize that [] in a parameter
> is the same as * and accepts the incomplete structure type, gcc 4.0
> does not.

It isn't the same; you cannot have arrays of incomplete types. This
was accidentally accepted anyway in earlier gccs, but that is now
fixed. You'll have to fix your code.

-- 
	Falk



Reply to: