At 16:34 2002-06-21 -0400, CBFalconer wrote:
>Emma Wermstrom wrote:
>>
>> In the module, Module.h file, I have declared the following:
>>
>> typedef /*@abstract@*/ struct _Module_Cmd_T {
>>
>> Module_Type_T Type; /* enum */
>> Module_Info_T Info; /* struct */
>> union {
>>
>> /*@NULL@*/ void * const NoData;
>>
>> bits32 Constant;
>>
>> /*@NULL@*/ const Module_Field_T Field;
>> } AdditionalInfo;
>> } Module_Cmd_T;
>>
>> where Module_Field_T, Module_Info_T and Module_Type_T have previously been
>> declared in Module.h
>>
>> bits32 is an unsigned long
>>
>> In another module, Module2, I try to give a value to an instance of the
>> Module_Cmd_T, like this:
>>
>> #include "Module.h"
>> /*@access Module_Cmd_T@*/
>>
>> static const Module_Cmd_T pm Command_C[1] =
>> {
>> Module_Type_foo, /*Module_Type_T Type*/
>
> Doesn't the info field belong here ??
>
No, the info-field is specified in the next line: {0, 16, NULL}. It's a
struct.
>> {0, 16, NULL}, /*Module_Info_T Info*/
>> (bits32)4 /*union*/
>> };
>>
>> Splint complains:
>>
>> Module2.c:12:10: Initial value of Command_C[0].AdditionalInfo is type
>> bits32, expects union { void * NoData; bits32 Constant;
>> Module_Field_T Field; }: (bits32)4
>> Types are incompatible. (Use -type to inhibit warning)
>
>--
>Chuck F ([EMAIL PROTECTED]) ([EMAIL PROTECTED])
> Available for consulting/temporary embedded and systems.
> <http://cbfalconer.home.att.net> USE worldnet address!
>
>
---------------------------------------------------------------
Emma Wermström
Software Engineer
Saab Ericsson Space AB tel: 031-7354433
S-405 15 Goteborg mobil: 0708-375230
SWEDEN mail: [EMAIL PROTECTED]
--------------------------------------------------------------