From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4CD5F934.2080705@gmx.net> Date: Sun, 7 Nov 2010 01:56:20 +0100 From: Carl-Daniel Hailfinger User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.23) Gecko/20090410 SUSE/1.1.18-0.1 SeaMonkey/1.1.18 MIME-Version: 1.0 To: 9fans@9fans.net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: [9fans] pcc limitation? Topicbox-Message-UUID: 78b2d098-ead6-11e9-9d60-3106f5b1d025 Hi, any idea why the code below causes an error message from pcc? I'm trying to port flashrom to Plan 9, but I've been fighting the compiler for the last few hours. /usr/glenda/flashrom/test3.c:20[stdin:45] constructor must be a structure /usr/glenda/flashrom/test3.c:25[stdin:50] constructor must be a structure Regards, Carl-Daniel #include #define JEDEC_WREN 0x06 #define JEDEC_WREN_OUTSIZE 0x01 #define JEDEC_CE_C7 0xc7 #define JEDEC_CE_C7_OUTSIZE 0x01 struct spi_command { unsigned int writecnt; unsigned int readcnt; const unsigned char *writearr; unsigned char *readarr; }; void spi_chip_erase_c7(void) { struct spi_command cmds[] = { { .writecnt = JEDEC_WREN_OUTSIZE, .writearr = (const unsigned char[]){ JEDEC_WREN }, .readcnt = 0, .readarr = NULL, }, { .writecnt = JEDEC_CE_C7_OUTSIZE, .writearr = (const unsigned char[]){ JEDEC_CE_C7 }, .readcnt = 0, .readarr = NULL, }, { .writecnt = 0, .writearr = NULL, .readcnt = 0, .readarr = NULL, }}; }