From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <4CD6D235.3030704@gmx.net> References: <4CD5F934.2080705@gmx.net> <4CD69C49.5090209@gmx.net> <9f6f706b0da2fc0b208ad49c097a823b@brasstown.quanstro.net> <4CD6D235.3030704@gmx.net> Date: Sun, 7 Nov 2010 21:58:04 -0500 Message-ID: Subject: Re: [9fans] pcc limitation? From: Russ Cox To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Topicbox-Message-UUID: 78fc1122-ead6-11e9-9d60-3106f5b1d025 > That solution wastes variables and is generally pretty ugly. > I still hope we can find a better solution. You can't. C doesn't work that way. Your choices are to use a fixed-size array or to declare helper arrays as you have already done. You can use string literals as aliases for helper arrays, but that's probably even worse. #define JEDEC_WREN "\x06" #define JEDEC_SE "\x20" ... cmds[] = { { .writearr = (uchar*)(JEDEC_WREN) }, { .writearr = (uchar*)(JEDEC_SE "\x01\x23\x45") }, ... } If that's enough to turn your stomach, then your only remaining alternative is to write a program to generate the code for you using helper arrays. Russ