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

Bug#310624: marked as done (gcc-3.3: Old code is not compiled with gcc > 2.95 (with error: initializer element is not constant))



Your message dated Thu, 09 Jun 2005 20:08:29 +0200
with message-id <87aclzh082.fsf@debian.org>
and subject line Bug#310624: gcc-3.3: Old code is not compiled with gcc > 2.95 (with error: initializer element is not constant)
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; 24 May 2005 19:54:11 +0000
>From bearing@mail333.com Tue May 24 12:54:11 2005
Return-path: <bearing@mail333.com>
Received: from a84-231-161-166.elisa-laajakaista.fi (quimpy.research.nokia.com) [84.231.161.166] (mail)
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1DafTf-00016b-00; Tue, 24 May 2005 12:54:11 -0700
Received: from niko by quimpy.research.nokia.com with local (Exim 3.36 #1 (Debian))
	id 1Dafcd-0000GB-00
	for <submit@bugs.debian.org>; Tue, 24 May 2005 23:03:27 +0300
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Debian User <bearing@mail333.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: gcc-3.3: Old code is not compiled with gcc > 2.95 (with error: initializer
 element is not constant)
X-Mailer: reportbug 3.8
Date: Tue, 24 May 2005 23:03:26 +0300
Message-Id: <E1Dafcd-0000GB-00@quimpy.research.nokia.com>
Sender: Debian User <bearing@mail333.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-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 

Package: gcc-3.3
Version: 1:3.3.5-12
Severity: minor

Hi folks,
I have a bulk of code which doesn't want to compile with new gcc 3.x.x

The problem is reduced to following example:

-----
$ cat test2.c 
struct _struct1 {
        int i;
        int j;
};
struct _struct2 {
        int a;
        int b;
};
union _union1 {
        struct _struct1 struct1;
        struct _struct2 struct2;
};
static union _union1 union_table[] = {
        (union _union1)
        (struct _struct1)
        {
                i: 1,
                j: 2,
        }
};
int main(void)
{
        return 0;
}
----
This is not my code, please don't blame me with it!
----

niko@quimpy:tmp$ gcc-2.95 test2.c 
niko@quimpy:tmp$ gcc-3.3 test2.c 
test2.c:20: error: initializer element is not constant
test2.c:20: error: (near initialization for `union_table[0]')

As you see it compiles without errors with gcc-2.95 but failes with
gcc-3.3

----

Regards,
Andrei

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.10
Locale: LANG=ru_RU.KOI8-R, LC_CTYPE=ru_RU.KOI8-R (charmap=KOI8-R)

Versions of packages gcc-3.3 depends on:
ii  binutils                    2.15-5       The GNU assembler, linker and bina
ii  cpp-3.3                     1:3.3.5-12   The GNU C preprocessor
ii  gcc-3.3-base                1:3.3.5-12   The GNU Compiler Collection (base 
ii  libc6                       2.3.2.ds1-21 GNU C Library: Shared libraries an
ii  libgcc1                     1:3.4.3-12   GCC support library

-- no debconf information

---------------------------------------
Received: (at 310624-done) by bugs.debian.org; 9 Jun 2005 18:09:05 +0000
>From falk@debian.org Thu Jun 09 11:09:05 2005
Return-path: <falk@debian.org>
Received: from smtp07.web.de [217.72.192.225] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1DgRSj-0007x7-00; Thu, 09 Jun 2005 11:09:05 -0700
Received: from [84.59.231.231] (helo=juist)
	by smtp07.web.de with asmtp (TLSv1:DES-CBC3-SHA:168)
	(WEB.DE 4.105 #291)
	id 1DgRSE-0008TV-00
	for 310624-done@bugs.debian.org; Thu, 09 Jun 2005 20:08:34 +0200
Received: from falk by juist with local (Exim 4.50)
	id 1DgRSB-0001jU-Nz
	for 310624-done@bugs.debian.org; Thu, 09 Jun 2005 20:08:31 +0200
To: 310624-done@bugs.debian.org
Subject: Re: Bug#310624: gcc-3.3: Old code is not compiled with gcc > 2.95
 (with error: initializer element is not constant)
References: <E1Dafcd-0000GB-00@quimpy.research.nokia.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: Thu, 09 Jun 2005 20:08:29 +0200
In-Reply-To: <E1Dafcd-0000GB-00@quimpy.research.nokia.com> (Debian User's
 message of "Tue, 24 May 2005 23:03:26 +0300")
Message-ID: <87aclzh082.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: 310624-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-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
X-Spam-Level: 

Debian User <bearing@mail333.com> writes:

> static union _union1 union_table[] = {
>         (union _union1)
>         (struct _struct1)
>         {
>                 i: 1,
>                 j: 2,
>         }
> };

This is not allowed by the C standard, nor is it a documented GNU CC
extension. So gcc 2.95 accepted it only by accident, and this was
fixed later.

-- 
	Falk



Reply to: