Keil Logo

BL51: Warning 16 (Uncalled Segment...) for Called Function


Information in this article applies to:

  • C51 Version 5.50 and Later

SYMPTOMS

I have written a function called foo and it is called from the same source file. Here is the function:

void foo(void) { };

here is the function call:

if (x & B0)
{
  foo();
}

When I build my project I get the following warning:

Warning L16: Uncalled Segment, Ignored for Overlay Process

for the function foo. Why?

CAUSE

This can occur if the function call is unreachable. For example, if either x or B0 is defined as zero (

#define B0 0

) then the compiler sees this and optimizes out the if statement, as the code inside is unreachable. If there are no other calls to the function, then Warning 16 is generated.

RESOLUTION

There isn't much point writing code that is unreachable. Remove or modify the if statement.

MORE INFORMATION

SEE ALSO


Last Reviewed: Thursday, February 25, 2021


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.