From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Sun, 7 Nov 2010 09:46:41 -0500 To: 9fans@9fans.net Message-ID: <9f6f706b0da2fc0b208ad49c097a823b@brasstown.quanstro.net> In-Reply-To: <4CD69C49.5090209@gmx.net> References: <4CD5F934.2080705@gmx.net> <4CD69C49.5090209@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] pcc limitation? Topicbox-Message-UUID: 78ccf3d8-ead6-11e9-9d60-3106f5b1d025 > writearr should point to a one-member const unsigned char array, and the > zeroth element of that array has the value JEDEC_WREN. = it's not clear to me that c99 allows one to declare an unnamed array and assign a pointer to it in this way except if the array is a char* or wchar_t*. i think the cleanest approach to solving your problem is to define writeattr as an array, not a uchar*. - erik ---- 8c -FVTw cdha.c 8l -o 8.cdha cdha.8 #include #include enum{ Jwren = 0x06, }; typedef struct Spicmd Spicmd; struct Spicmd{ uchar writearr[5]; }; void main(void) { Spicmd cmds[] = { { .writearr = {Jwren, }, }, }; print("writearr=%p\n", cmds[0].writearr); print("writearr[0]=%#.2hhx\n", cmds[0].writearr[0]); exits(""); }