C51: REMOVING AND DISABLING WARNING 13 (RECURSIVE CALL)

单片机相关 徐 自远 658℃

来源: C51: REMOVING AND DISABLING WARNING 13 (RECURSIVE CALL)

 

C51: REMOVING AND DISABLING WARNING 13 (RECURSIVE CALL)


Information in this article applies to:

  • C51 Version 5.50

QUESTION

When I link my project, I get over 100 warning 13s (recursive call to segment). I am certain that there is no possibility for recursion to occur in my project, so I used the linker DW(13) directive to disable the warning.

However, I still get Fatal Error 232, application contains too many recursions. How can I remove this?

ANSWER

The DW(13) disable warning directive simply stops the warnings from being displayed during linking. The problems are still there and the linker stops when there are too many warnings.

The solution is to use the RC(0) directive to specify that the linker should allow all the recursive call warnings. However, the DW(13) directive should still be used to stop the warnings being displayed.

In order to specify the directives in µVision:

  • Choose BL51 Code Banking Linker from the Options menu
  • Click on the Additional tab
  • Enter the directives into one of the boxes

The following are the relevent sections from the release notes describing these two directives:

– With the directive DISABLEWARNING (Abbr. DW) you can selectively disable Linker warnings. Example:

will disable the report of Warning Number 1 and 5.

– With the BL51 directive RECURSIONS (Abbr. RC) you can specify the number of RECURSIONS allowed, before the Linker reponds with the message:

Example for using the RECURSIONS directive:

It should be noted that the linker may run for a long time to detect all recursions and remove the references. You should, therefore, use the standard setting RECURSIONS (10) by default.

MORE INFORMATION

转载请注明:徐自远的乱七八糟小站 » C51: REMOVING AND DISABLING WARNING 13 (RECURSIVE CALL)

喜欢 (0)

苏ICP备18041234号-1 bei_an 苏公网安备 32021402001397号