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

Static function register optimization

Can someone tell me why all functions declared as "static" do not seem to have any register optimization done on them? At least this is implied since they are not listed in the map file where register usage is specified but become listed if the "static" declaration is removed.

Does this imply that I should remove the "static" declaration from any function to which I have set a global pointer in order to ensure optimization is done on that function?

Parents
  • Jon,

    I am not sure how much of this article applies to my situation since I am using the C166 toolset and it does not seem to have a linker OVERLAY definition (at least not in my manual) although the article is an interesting review of the issues of non-reentrantcy.

    Also, the C167 toolset defines REENTRANT by default, one would need to define STATIC for the issues brought up in this article to be valid, wouldn't it? I was referring to the C "static" function declaration modifier that I believe only restricts the scope of the function name.

    I was not aware of the limit of three parameters for function pointers though. After looking through my code I found I just got lucky in that I never needed more than three and they were always structures or USHORTs.

Reply
  • Jon,

    I am not sure how much of this article applies to my situation since I am using the C166 toolset and it does not seem to have a linker OVERLAY definition (at least not in my manual) although the article is an interesting review of the issues of non-reentrantcy.

    Also, the C167 toolset defines REENTRANT by default, one would need to define STATIC for the issues brought up in this article to be valid, wouldn't it? I was referring to the C "static" function declaration modifier that I believe only restricts the scope of the function name.

    I was not aware of the limit of three parameters for function pointers though. After looking through my code I found I just got lucky in that I never needed more than three and they were always structures or USHORTs.

Children