From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Adam Powers" To: help-gcc@gnu.org Subject: structure initialization strangeness Date: Sat, 18 Dec 1999 16:44:00 -0000 Message-id: X-SW-Source: 1999-12/msg00268.html 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} }; From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Adam Powers" To: help-gcc@gnu.org Subject: structure initialization strangeness Date: Fri, 31 Dec 1999 22:24:00 -0000 Message-ID: X-SW-Source: 1999-12n/msg00268.html Message-ID: <19991231222400.NGKEJpCE6HbFyym-gzke3Ar0qD9rfP-VE4q0zkr3Xps@z> 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} };