Does any one know how to create an unnamed variable for place holder in a struct? I know you can do it in bitfiled. Example:
struct S { int a; int b; int[5]; //reserved 5 ints but dont' need to name it. int c; int d; int bit0 : 1; int : 6; int bit7 : 1; } </pre?
Would this work? Not really --- keeping in mind that this method relies on the magic number 8 having its usual meaning of "number of bits in a byte", and that I don't think anonymous bitfields are supposed to have a width assigned to them --- they're supposed to be used to "flush" one machine word, so the next bitfield will start in a word of its own. Neither am I convinced they're guaranteed to start a new one if the next bit would have been in a fresh word already. To summarize: the problem is in what the OP is trying to do, not in Keil preventing him from doing it.
Thanks Jon, I like your method. Any suggestions for arrays? Anh
Take a look at http://www.keil.com/forum/docs/thread2150.asp and modify it for this situation. Jon
Thanks everyone for their help. I had a lots of reserved fields for backward compatiblity with existing software. Anh
"I had a lots of reserved fields for backward compatiblity with existing software." In that case, I'd say it's particularly important that you do give them specific names that clearly indicate what's going on!