This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Link Problem

I build a library with m functions, I called
n (n<m) functions, How can I avoid the warning:"Uncall function"?

Parents
  • I'm starting to try and use libraries of files. The library contains multiple files of functions. They all compile fine. When I use them in a project, not all funtions are necessarily being used. The linker generates a L16 warning, while not great, it is pretty harmless. Is this an indication that I'm not using the library manager right, or is it normal? I'd like to get rid of the linker warnings if possible.

    Thanks in advance for any help
    Andy

Reply
  • I'm starting to try and use libraries of files. The library contains multiple files of functions. They all compile fine. When I use them in a project, not all funtions are necessarily being used. The linker generates a L16 warning, while not great, it is pretty harmless. Is this an indication that I'm not using the library manager right, or is it normal? I'd like to get rid of the linker warnings if possible.

    Thanks in advance for any help
    Andy

Children
  • This warning is bad news - you need to get rid of it or you'll soon run out of DATA space. You need to make sure that every function in the library resides alone in its own source file to prevent the linker linking in the uncalled functions. It's ok to put additional 'helper' functions in a source file provided that they are *all* called by the exported function and *none* of these 'helper' functions are called by any functions in other source files.

    Stefan

  • The linker generates a L16 warning, while not great, it is pretty harmless

    It's not at all harmless. It means your code needlessly generates a multi-root call tree, which will degrade performance of the linker a lot. It'll waste not only code space, but also DATA/IDATA/BDATA, which is considerably worse. In a nutshell, that means this warning is about as non-harmless as a warning can be, given the hard limits of the target platform.

    Is this an indication that I'm not using the library manager right, or is it normal?

    Neither. It's not normal, but the problem is not in how you use the library manager --- it's in how you wrote the code you're putting in that library. The rule to follow is: split it up into as many individual source files as you possibly can. Nor more than *one* function or *one* global variable per .c file, if possible.

  • Thanks for the insight, I'll trty to put the code together better.
    Andy