I got a demo sources from our chip vendor. It can be compiled successfully! However, after I comment out some functions, the compiler says that IData Space overflow. When I check the MAP file, I find that there is no ?STACK. Why? I donot add any new file to the project, nor drop any file from the project. I only comment out several function calls in a file. Why? Thanks a lot!
Overlay analysis? When you comment out calls to a function, those functions no longer have a place in the call tree from main(). So, they must become the root of a new call tree. This means their local variables, temporaries, etc., no longer overlay with the main call tree. Since the code remains in the program, it can increase the amount of memory needed. If the original program were close to its limits, commenting out a function can cause the program no longer to compile. You can fix the call tree manually with the OVERLAY directive in the linker. You also might try something like: if (0) MyFunction(); rather than //MyFunction(); to remove the call.
Hi, Davis, I got it. After using OVERLAY, now can work. Thanks! However, After I really delete the function implementations and also those OVERLAY directives, I got space overflow again! Since the implementations are deleted, and the variable are no longer exist, why I get this error again? Thanks!
the only safe way to drop functions without possible overlay problems is: #ifdef USE_FOO foo(); #endif and #ifdef USE_FOO foo() { ... } #endif Erik
Hi, Erik thanks! But can you tell me why this method can work? Suppose I donot define USE_FOO, then the call to function and the function implementation are not included, which is the same as that I delete the call to function and the function implementations.
View all questions in Keil forum