Hi,
As far as I know PK51 will compile and link non-use functions though the comiler issues a warning. It seems that PK166 does not compile and link non-use functions, is that correct ?
Daniel
a) An unused static function will be not be linked. b) An unused non-static function will be linked if it is part of an object file. c) An unused non-static function will not be linked if it is part of a library.
Both unused static and non-static functions will always be compiled.
Thomas
"PK51 will compile and link non-use functions though the comiler (sic) issues a warning"
The compiler cannot tell whether a non-static function will be used or not - it is the Linker that gives the warning.
The LX51 Linker has the option to not link unused functions:
http://www.keil.com/support/man/docs/lx51/lx51_removeunused.htm
My question is
For PK51, if there is uncalled funtion, there is L16 warning coming up.
But for PK166, this does not happen, the setting is Project->options->L166 Misc->Warnings = level 2 why ? thanks
dn
"But for PK166, this does not happen"
(Apparently) Uncalled functions are a Big Deal for PK51 because of the memory Overlaying technique:
http://www.keil.com/support/man/docs/bl51/bl51_l16.htm
This Overlaying is necessitated by the limitations of the 8051 architecture.
I don't think that the C166 architecture has these limitations - therefore the uncalled functions are not a Big Deal?