Pete - 2007-12-17

Guys,  I want to make a pointer in code space (FLASH) to an array in data space.  I think this is correct, but I get the error below (after the code snippet).  Any ideas?  How do I debug this as I think it is correct, but the "pointer types incompatible" message is not enough for me to debug further.  Any help is appreciated.

PROCESSOR: PIC18F2455

  1 struct ATag {
  2     char one;
  3     char two;
  4 };
  5
  6 __data static struct ATag a;
  7 __data struct ATag * __code pa = &a;
  8
  9 void main(void){
10     char test = 0;
11
12     pa->one = 1;
13     pa->two = 2;
14     test = pa->one;
15 }

sdcc 2.7.4 gives

$ make
sdcc -mpic16 -p18F2455 -I. -I../../../../include -c -o test.o test.c
gen.c:12722 symbol iTemp1 = [ pa ] is in code space
test.c:7: error 129: pointer types incompatible
make: *** [test.o] Error 1