In modern C compilers sticking a struct on the stack pushes all
the members, whereas sticking a pointer to a struct only pushes
one void* sized object. If there was a stack size limit and the
original struct was rather large you might blow the stack with
the former case.

However it seems -- and appearances can be deceiving -- that the
offending function works OK for a few iterations before blowing
cookies, so I suspect that there is something wrong with the
contents of the array being processed. Doing some LED flashing
(I assume this is in a real, rather than sim, env) might validate
the few-iterations assertion. Also making sure the array is fully
and correctly initialized, maybe with the same values, would be
a good start.

For array/pointer use see the wikibook I ref'ed. It's a hard row
to hoe, but when you're done you'll be able to plant anything.

MS

[email protected] wrote:
> Hello,
> 
> I guess Mr. Schippling was right, changing the printf to take a  
> pointer instead of the table-entry, i.e. struct worked. The error  
> message is gone.
> 
> However that didn't seem to be the problem in the first place. The  
> Warning apparently didn't hinder execution of the task. For some  
> reasen printf() seems to "freeze" or "stop printf-ing" for some  
> reason. I found another thread concerning this problem from June '08.
> 
> Did anyone find a solution / answer to that problem?
> 
> Thanks for the info,
> 
> Tobias
> 
> 
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to