Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1848 warning 139

closed-fixed
Maarten Brock
5
2013-05-25
2011-09-16
Andy Peters
No

sdcc issues the above warning when an ISR calls a function through a function pointer.

Assume:

#define INTREGBANK 1
typedef void (*phandler_t)(void); // add a __using(INTREGBANK) here does not matter
phandler_t phandlers[8];

void Int0_isr(void) __interrupt(0) __using(INTREGBANK)
{
unsigned char intsrc;
intsrc = GetInterruptSource;
phandlers[intsrc](); // warning refers to this line
} // Int0_isr

This results in a warning:
..main.c:150: warning 139: call via function pointer in ISR using non-zero register bank. Cannot determine which register bank to save.

Discussion

  • Maarten Brock
    Maarten Brock
    2011-09-18

    Fixed in SDCC 3.0.5 #6858.
    You now need to give the typedef a __using modifier as well as all function pointer assignments. Without __using SDCC assumes register bank 0.

     
  • Maarten Brock
    Maarten Brock
    2011-09-18

    • milestone: --> fixed
    • assigned_to: nobody --> maartenbrock
    • status: open --> closed-fixed