Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!leah!itsgw!steinmetz!uunet!sdrc!scjones From: scjones@sdrc.UUCP (Larry Jones) Newsgroups: comp.lang.c Subject: Re: malloced structure initilization Message-ID: <527@sdrc.UUCP> Date: 14 Feb 89 23:01:59 GMT References: <202@sabin.UUCP> <8894@alice.UUCP> <1874@dataio.Data-IO.COM> Organization: Structural Dynamics Research Corp., Cincinnati Lines: 20 In article <1874@dataio.Data-IO.COM>, bright@Data-IO.COM (Walter Bright) writes: > In article <8894@alice.UUCP< ark@alice.UUCP (Andrew Koenig) writes: > > Yah, and init_foo is guaranteed to be initialized to a 0 bit pattern, > just like if you called calloc instead of malloc. So where have you > gained anything here? I suggest that you declare init_foo something like: > static struct foo init_foo = { 0,0L,0.0,(char *)0 }; > or whatever is appropriate to the struct members. dpANS requires statics to be initialized to zeros of the appropriate type, not just zero bits. I believe this is existing practice. ---- Larry Jones UUCP: uunet!sdrc!scjones SDRC scjones@sdrc.UU.NET 2000 Eastman Dr. BIX: ltl Milford, OH 45150 AT&T: (513) 576-2070 "When all else fails, read the directions."