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

Avoiding warning L16

Hello,

Is there a way to avoid the following warning: Warning L16: uncalled segment, ignored for overlay process? I'm not talking about the Disable warning numbers you have in the options of a project...

I know what the overlay process does, but if the function is indeed not called (and there could be reasons not to call a function for a certain application), is there not a kind of 'dead code remover' who can check if a function is called or not?

If so, is this function not able to inform the compiler just to ignore this function and not to generate the warning?

Rgds,

Geert

Parents

  • "Each object in the library should contain exactly one function."

    This requirement is a bit restrictive in practice. Normal C code will contain many functions in a .c file, and thus the corresponding object. Building a library then won't help, since if you include _any_ function from a single object, you'll get the warnings for all the other functions you didn't want from that object. The only way to avoid it is to break every function into its own file, which is a bit nightmarish from an organizational point of view, particularly when several functions share data or helper routines that don't need to be externally visible.

    The toolchain should be smart enough to pull in only those functions you actually call from a library. It would also be good if the linker could eliminate unreferenced functions from an object, even if it's not a library. Every other compiler I've used supports this functionality.

Reply

  • "Each object in the library should contain exactly one function."

    This requirement is a bit restrictive in practice. Normal C code will contain many functions in a .c file, and thus the corresponding object. Building a library then won't help, since if you include _any_ function from a single object, you'll get the warnings for all the other functions you didn't want from that object. The only way to avoid it is to break every function into its own file, which is a bit nightmarish from an organizational point of view, particularly when several functions share data or helper routines that don't need to be externally visible.

    The toolchain should be smart enough to pull in only those functions you actually call from a library. It would also be good if the linker could eliminate unreferenced functions from an object, even if it's not a library. Every other compiler I've used supports this functionality.

Children