[Tinyos-help] Very strange problem!
aurelien.francillon at inrialpes.fr
Sun Feb 10 15:26:45 PST 2008
AIGroup a écrit :
> I'm using only one sample to prevent too much computational cost.
> I yet have the problem and today I have seen that most of these errors
> is caused by automatic cast. If the cast is forced, most of this events
> don't occur.
> I hope to find a solution very soon!
> Thanks for your time
>> long compute_index(long int *binfeature, long int range, long int
>> int i=0,ii=0;
>> /*THE PROBLEM IS HERE: IF I PUT A NUMBER (e.g. 2) INSTEAD OF
>> STATEMENT for WORKS WELL */
>> for(i=0;i<range;i++) /* <----T
hum to my opinon you should check here and in other places that you
don't overflow the array called "index" i.e. it depends on too much
magic to work reliably...
as a starter adding a manual check for "ii" to be in range of your array
Overflowing the array could very well lead to various kind of unreliable
and unexplicable behaviour as you may overwrite stack or other variables ...
More information about the Tinyos-help