This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12999] New: Internal compiler error for syntax error with __attribute__ ((packed))
- From: "tron dot thomas at verizon dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Nov 2003 22:29:57 -0000
- Subject: [Bug c++/12999] New: Internal compiler error for syntax error with __attribute__ ((packed))
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Save the following code in a module name StructSize.c:
#include <stdio.h>
typedef unsigned char ILubyte;
typedef unsigned short ILushort;
typedef short ILshort;
int main()
{
#pragma pack(1)
typedef struct TARGAHEAD
{
ILubyte IDLen;
ILubyte ColMapPresent;
ILubyte ImageType;
ILshort FirstEntry;
ILshort ColMapLen;
ILubyte ColMapEntSize;
ILshort OriginX;
ILshort OriginY;
ILushort Width;
ILushort Height;
ILubyte Bpp;
ILubyte ImageDesc;
} TARGAHEAD; __attribute__ ((packed)) TARGAHEAD;
#pragma pack()
printf("The structure size is %d bytes.\n", sizeof(TARGAHEAD));
return 0;
}
Note the code has a synatax error after the typedef statement for TARGAHEAD.
Attempt to build the code using the command: g++ -o StructSize StructSize.c
On version 3.3.2 of the GNU compiler the following output occurs:
StructSize.c: In function `int main()':
StructSize.c:25: internal compiler error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Found a Macintosh G4 system running Mac OS X 10.2.8.
--
Summary: Internal compiler error for syntax error with
__attribute__ ((packed))
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tron dot thomas at verizon dot net
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12999