![]() |
Compiler has troubles with structures?
I've been having the strangest problems - my code has random issues. Sometimes the printf() calls don't substitute variables at all (for example, if I
Quote:
Quote:
I'm not using interrupts, no pointer arithmetic, and I even disabled the timers. What I found was that by rearranging the order of my code (switching two lines, etc) I could affect exactly what got corrupted. A friend of mine a couple of years ago told me that the MCC compiler generates incorrect code when it uses structures (which I use for my PID control) and commenting out the structures seems to cause the problems to disappear. Does anyone know of some such issues, or any clue what might be wrong? I can post some code snippets a bit later today (when I get to my laptop) or just email you the entire thing, if you're interested... it's very strange, and I worked on it for probably nineteen hours straight, yesterday, without making much headway on this. Thanks for any pointers, Steven |
Re: Compiler has troubles with structures?
I have not seen this problem.. and all my code uses two large structures to control everything. What you may want to try is turning optimizations off (Project->Build Options-> MCC18 Compiler)
|
| All times are GMT -5. The time now is 03:18. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi