public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* structure initialization strangeness
@ 1999-12-18 16:44 Adam Powers
  1999-12-31 22:24 ` Adam Powers
  0 siblings, 1 reply; 2+ messages in thread
From: Adam Powers @ 1999-12-18 16:44 UTC (permalink / raw)
  To: help-gcc

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}
};


^ permalink raw reply	[flat|nested] 2+ messages in thread

* structure initialization strangeness
  1999-12-18 16:44 structure initialization strangeness Adam Powers
@ 1999-12-31 22:24 ` Adam Powers
  0 siblings, 0 replies; 2+ messages in thread
From: Adam Powers @ 1999-12-31 22:24 UTC (permalink / raw)
  To: help-gcc

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}
};


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-12-31 22:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-18 16:44 structure initialization strangeness Adam Powers
1999-12-31 22:24 ` Adam Powers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).