James wrote: > The contents of temporary local variables in some of my functions are > getting overwritten without reason. By changing them to static it fixes > the problem. > At no point does any of my code write to an address in RAM except via a > pointer to a variable, so I can't see how these variables are getting > overwritten. As you've been told already, since you are using pointers, nothing in the PIC's address space is safe anymore :) Local automatic (non-static) variables are only valid as long as you are executing the function that declares them or any function called by it. So it's likely that the problem is in one of these places. If for example a function called by the one of which the local variables get overwritten uses a pointer to its own local variables and the pointer goes out of bounds, it could easily overwrite the local variables of the calling function -- they may be right next to the function's own local variables. Of course, declaring those overwritten variables removes /that/ symptom of the problem, but doesn't really solve the problem :) > I could raise this on HiTech's forum but that gets little traffic. I'm > really looking for any experiences from people here that could backup or > otherwise what I think I'm seeing! Many thanks. I've found that it's worth it to use the forum. It may have less traffic overall than this list, but it's more targeted. Gerhard -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist