SDCC : pic16/pic14 2.5.5 #1226 (Mar 15 2006) (MSVC)
sdcc crashes when compiling an offset to a pointer.
Compiling the following code will cause the problem:
typedef struct _BDT
unsigned int ADDR;
} BDT; //Buffer Descriptor Table
BDT at 0x0400 ep0Bo;
static void SetFeature(char e)
char endpointNum = e;
inPtr = (char *)&ep0Bo + (endpointNum * 8);
Command line used to do the compile:
sdcc -mpic16 -c badptr1.c
Caught signal 11: SIGSEGV
Note that if you replace "ep0Bo" by "x" in the
function SetFeature(), sdcc will compile.
Eliminating the "at 0x0400" from the declaration of
ep0Bo will also result in compilation. Appears the
use of a fixed address in the variable declaration
leads to the problem.
This problem was not in build 1209 so it was
introduced somewhere between 1209 and 1226.