This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/50987] New: powerpc: size of unnamed array is negative when compiling wine
- From: "austinenglish at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 03 Nov 2011 20:26:49 +0000
- Subject: [Bug c/50987] New: powerpc: size of unnamed array is negative when compiling wine
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50987
Bug #: 50987
Summary: powerpc: size of unnamed array is negative when
compiling wine
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: austinenglish@gmail.com
Found while compiling wine on PowerPC. This did not occur on an older powerpc I
used on the gcc compiler farm, but I'm not sure what gcc/glibc/etc. versions
they had.
Bug is present in, at least:
gcc-4.0.0
gcc-4.1.0
gcc-4.2.0
gcc-4.6.1
trunk 4.7.0 20111103
reduced testcase:
[austin@gcc1-power7 tests]$ cat generated.i
typedef int BOOL, *PBOOL, *LPBOOL;
typedef int INT, *PINT, *LPINT;
typedef struct _CACHE_DESCRIPTOR { BYTE Level; BYTE Associativity;
WORD LineSize; DWORD Size; PROCESSOR_CACHE_TYPE Type; }
*HDC;
typedef BOOL ( *ABORTPROC)(HDC, INT);
static void test_pack_ABORTPROC(void) { extern void __C_ASSERT__(int
[(sizeof(ABORTPROC) == 4)?1:-1]); TEST_TYPE_ALIGN (ABORTPROC, 4) }
gcc generated.i
generated.i:3:18: error: unknown type name 'BYTE'
generated.i:3:18: error: unknown type name 'BYTE'
generated.i:3:18: error: unknown type name 'WORD'
generated.i:3:18: error: unknown type name 'DWORD'
generated.i:3:18: error: unknown type name 'PROCESSOR_CACHE_TYPE'
generated.i: In function 'test_pack_ABORTPROC':
generated.i:6:4: error: size of unnamed array is negative
generated.i:6:124: error: expected expression before 'ABORTPROC'
generated.i:6:138: error: expected ';' before '}' token
if you have wine available, try compiling dlls/gdi32/tests/generated.c
[austin@gcc1-power7 tests]$ uname -a
Linux gcc1-power7.osuosl.org 3.1.0-0.rc9.git0.2.fc16.kh.ppc64 #1 SMP Wed Oct 12
22:41:01 UTC 2011 ppc64 ppc64 ppc64 GNU/Linux
the same works on (at least) x86/x86_64.
See also http://bugs.winehq.org/show_bug.cgi?id=28981