sdcc icon indicating copy to clipboard operation
sdcc copied to clipboard

Feature request: Make __interrupt n be able to define macro like __interrupt(x)

Open wxwok opened this issue 1 year ago • 1 comments

for

void isr(void) __interrupt 7 {
}

Some IDEs, like JetBrains Clion and Vscode, have code analyzers that are compatible with GCC. For editing code in these IDEs, we can define macros to avoid unresolved symbols, such as:

 #ifndef SDCC
	#define __sfr volatile unsigned char
	#define __sbit volatile unsigned char
	#define __at(x)
	#define __xdata
 #endif

But the __interrrupt n can't be defined as a macro, and IDEs will report an undefined symbol except to modify the source code to define a new macro like:

#ifdef SDCC
    #define INTERRUPT_HANDLER(x)  __interrupt 7
#else
    #define INTERRUPT_HANDLER(x)
#endif

void isr(void) INTERRUPT_HANDLER(7)
{
}

Can the __interrupt n be defined to __interrupt(n)?

wxwok avatar Dec 16 '24 11:12 wxwok

I just found that I'm using an ancient version:

SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ez80_z80/ds390/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15 4.0.0 #11528 (Linux)
published under GNU General Public License (GPL)

wxwok avatar Dec 17 '24 01:12 wxwok