This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Structure initialization problem
- To: egcs-bugs at cygnus dot com
- Subject: Structure initialization problem
- From: Michael Meissner <meissner at cygnus dot com>
- Date: Mon, 21 Dec 1998 09:10:51 -0500
It looks like egcs 1.1.1, and the current egcs have a bug in structure
initializations where there is a :0 field. For the following code:
struct foo {
signed char a;
int : 0;
signed char b;
signed char c;
} bar = { -1, -1, 1 };
Gcc 2.7.2.3 and egcs 1.0.3 both compile this on the x86 as:
bar:
.byte -1
.zero 3
.byte -1
.byte 1
However, more recent versions of the compiler compile this as:
bar:
.byte -1
.zero 4
.byte 1
(ie, the first initialization after the :0 is ignored).
I'll be looking into it further, but I thought people would appreciate
knowing about it.
--
Michael Meissner, Cygnus Solutions (Massachusetts office)
4th floor, 955 Massachusetts Avenue, Cambridge, MA 02139, USA
meissner@cygnus.com, 617-354-5416 (office), 617-354-7161 (fax)