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

Warning 16: uncalled segment, I used search ...

I tried to build a little initialisation function for a robot I'm building. Then warning 16 occured, I've tried searching this site, and tried the sollutions I coulf find. It seems to me it is not a problem of the function not being called?

void initialise(void){
  short failed = FALSE;
  [...]

  // initialise motors
  failed |= initMotor();
  [...]
}

initMotors is declared in motor.h and implemented in motor.c

short initMotor(void);

short initMotor(void){
  short failed = FALSE;

  if (DEBUG) printf("Initialising Motors\n");

  return failed;
}

When I try to build my project, it says:
Warning 16: Uncalled segment, ignored for overlay process
Segment: ?CO?MOTOR

Any ideas on why the warning could be generated? It's only a warning ... but I don't even want those (preferebly).

Parents
  • This ?CO?MOTOR segment is probably the string constant in printf("Initialising Motors\n");

    So if DEBUG is false, compiler creates this string, but the printf() call disappears due to optimisation, so the string isn't referenced anywhere.
    Strange why the compiler leaves the orphan string constant... anyway you can ignore this warning (but lose some code space).

    Regards,
    --PA

Reply
  • This ?CO?MOTOR segment is probably the string constant in printf("Initialising Motors\n");

    So if DEBUG is false, compiler creates this string, but the printf() call disappears due to optimisation, so the string isn't referenced anywhere.
    Strange why the compiler leaves the orphan string constant... anyway you can ignore this warning (but lose some code space).

    Regards,
    --PA

Children
No data