Hi All,
This may well be in the wrong section, but is has to do with using Codeblocks.
It is about right mouse button menu item Find declaration of.....
I have this code
#include <PIC/PIC16F874.H>
// test of #if
#define comtype 0
#if (comtype==0)
#define ControlPort PORTA
#endif
#if (comtype==1)
#define ControlPort PORTB
#endif
#if (comtype==2)
#define ControlPort PORTC
#endif
// CONFIG
static typedef unsigned int config;
config at 0x2007 __CONFIG = _PWRTE_OFF & _BODEN_OFF & _WDT_OFF & _LVP_ON & _CPD_OFF & _DEBUG_OFF & _HS_OSC & _CP_OFF;
// main body
void main(){
ControlPort = 0;
}
When you use the right mouse button menu Find the declaration of ...on ControlPort in the main function you are directed to the very last#define of ControlPort.
I conclude the find does not obey the #if-#endif.
Is this fixable?
Note: the PORTA etc is used here as I wanted the example as small as possible without SDCC optimizing out code.
Thanks.
Frans.