Hi all, Sorry, my mistake.
I didn't realize the :"typedef struct serial_source *serial_source;" in serialsource.h And thanks for the "x = malloc(sizeof *x)" tip. Regards, -daniel -------- Original Message -------- > From: "David Gay" <[EMAIL PROTECTED]> > Sent: Thursday, October 25, 2007 12:32 AM > To: "Michael Schippling" <[EMAIL PROTECTED]> > Subject: Re: [Tinyos-help] Dangling pointer in SF (C version) > > On 10/23/07, Michael Schippling <[EMAIL PROTECTED]> wrote: > > If "serial_source" has been typedefed to be a pointer, > > which is what the subsequent usage tends to indicate, > > then this _should_ allocate and init a block of whatever > > rather than just a pointer. If that is the case then it > > seems to be a poor naming choice. You'll have to chase > > the dragon further up the tree to see what it really is... > > I'll point out that if you write "x = malloc(sizeof *x)", you're > guaranteed to get something of the size of whatever x is declared to > point to, irrespective of any changes anywhere else in the program > (ok, making x a non-pointer will cause a compile-time error). Seems: > a) pretty clear, b) pretty reliable. > > David Gay > > > > > > MS _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
