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

puzzling data space overflow

In an inherited design where DATA is used to the hilt, I wanted to insert a 'general catcher' for debugging purposes in the process of doing so I got a puzzling data space overflow

 void tryitcatch1(woid)
{
//UCHAR  TTYCtemp;
//TTYCtemp = 1;
//BSIE_EA = DISABLE;
//while (TTYCtemp);
}
......
......
  for (toutctr = 60000 ; toutctr != 0 ; toutctr--)
  {
    if (j1708_pkt_incoming == FALSE) break;
  }
  if (toutctr == 0)
  {
    j1708_pkt_incoming = FALSE ;
tryitcatch1(); // SEE BELOW
  }

with
//tryitcatch1();
I get uncalled segment ...

with
tryitcatch1();
I get data space overflow

I am puzzled

Erik

Parents
  • I know my suggestion doesn't answer the reason for the strange error message. I don't have the C51 compiler, so I don't know what it thinks about K&R declarations. If it has a compiler switch for it, I would recommend to use that switch to deactivate all K&R support.

    Without a function prototype, the compiler would not complain about the function call missing a parameter. Maybe unexpected K&R functions breaks up the internal compiler logic for handling all parameter passing, resulting in a changed allocation of global variables.

    The workarounds for supporting C on '51 chips induces too much special cases that can't be found documented in the ANSI language standard. The assembler listings can show _what_ a compiler has done, but the _why_ can sometimes be hard to deduce. Sometimes even with the compiler source code available...

Reply
  • I know my suggestion doesn't answer the reason for the strange error message. I don't have the C51 compiler, so I don't know what it thinks about K&R declarations. If it has a compiler switch for it, I would recommend to use that switch to deactivate all K&R support.

    Without a function prototype, the compiler would not complain about the function call missing a parameter. Maybe unexpected K&R functions breaks up the internal compiler logic for handling all parameter passing, resulting in a changed allocation of global variables.

    The workarounds for supporting C on '51 chips induces too much special cases that can't be found documented in the ANSI language standard. The assembler listings can show _what_ a compiler has done, but the _why_ can sometimes be hard to deduce. Sometimes even with the compiler source code available...

Children
No data