uncalled functions

Hi,
I am using C51 version 1x (or 5x). I have some uncalled functions and it seems like they are included in the final binary. Does any one know how to make the linker not include the uncalled funtions?

Thanks for your help,

Michelle

Parents
  • "I have some uncalled functions and it seems like they are included in the final binary."

    This is standard behaviour for any 'C' compiler.
    The compiler's job is to turn the source you supply into a corresponding object - not to give a critique of your code!

    It is not always possible to determine whether a function is actually called or not; eg, there might be some obscure call via run-time pointers.

    You need to either make a Library, or use conditional compilation to remove the unwanted functions.

    Libraries are specifically designed to include only those functions actually used in the build.

Reply
  • "I have some uncalled functions and it seems like they are included in the final binary."

    This is standard behaviour for any 'C' compiler.
    The compiler's job is to turn the source you supply into a corresponding object - not to give a critique of your code!

    It is not always possible to determine whether a function is actually called or not; eg, there might be some obscure call via run-time pointers.

    You need to either make a Library, or use conditional compilation to remove the unwanted functions.

    Libraries are specifically designed to include only those functions actually used in the build.

Children
More questions in this forum