Thanks, Sergio. I now have this, and all is well...Since I have a lot of these constant structures in ROM, I needed to be able to assign any value in any order, so rearranging the union element order would not work. You assistance is much appreciated. Thank you. MES ********code struct menu_item { const unsigned char *p_msg; // points to this menu item's menu message const struct menu_item *p_next_menu_item; // points to next menu in this menu page unsigned int FlagMask; // if this record is for a boolean value, this is the // mask value for the flag invloved unsigned char DataType; // holds type of data pointed to in union union { void *p_val; // this dummy type needed to avoid // weird initialization errors with the compiler unsigned int *p_ival; // points to value to display for this menu item unsigned long *p_lval; // can be different types of pointers unsigned char *p_cval; } u_DataType; char DPPos; // location of decimal point. If 0, no DP }; ----- Original Message ----- From: "Sergio Masci" To: Sent: Friday, April 26, 2002 12:25 PM Subject: Re: [OT]:C syntax question > ----- Original Message ----- > From: Mark Skeels > To: > Sent: Friday, April 26, 2002 5:53 PM > Subject: [OT]:C syntax question > > > > > > > > OK. Here is the question... > > > > I get the following compiler error..... > > > > "(324) : Error[132]: Incompatible initializer" > > > > ...on the following line of the above structure... > > > > "&ActiveSetup.ChargeCycle1.TurboflexLevel," > > > > > > > > Can anyone shed any light on what the compiler is objecting to? I > > typecasting, but I suspect I didn't do it right....:-) > > > > Any guidance would be appreciated. > > Yep, initialising unions in C is a general problem. I havent done this in > years but I seem to recall that the default is to use the type of the first > member in the union. Try rearranging your union so that the member you are > trying to initialise is the first one and see if the problem goes away. You > might also try adding a new dummy 'void *ptr' as the first member, that may > give you a better solution. > > Regards > Sergio Masci > > http://www.xcprod.com/gaea/web_demo.html > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu