structure initialization strangeness
Adam Powers
apowers@telocity.net
Sat Dec 18 16:44:00 GMT 1999
the code below causes the structure "duiTest_dui_dev" to be initialized to
all 0s. is this a bug in gcc, or a misconception on my part of how partial
strucutre initialization works?
i'm using gcc version cygnus-2.7.2-960126.
thanks in advance,
-A
typedef struct dui_usr_struct {
char *desc;
unsigned int type;
unsigned int speed;
unsigned int bufSz;
} DUI_USR;
typedef struct dui_dev_struct {
END_OBJ end;
char *duiName;
unsigned int duiUnit;
char enetAddr[6];
END_OBJ * (*loadRtn) (char *, void *);
DUI_USR usr;
} DUI_DEV;
DUI_DEV duiTest_dui_dev = {
duiName:"duiTest2",
duiUnit:0,
loadRtn:duiTestLoad,
usr:{"DUI Test Device", 1, 1000000, 1514}
};
More information about the Gcc-help
mailing list