1.
typedef struct _NODE
{
const unsigned char type;
const unsigned char name[8];
const struct _NODE * const enter;
const struct _NODE * const down;
const struct _NODE * const up;
}NODE;
extern const NODE node1;
extern const NODE node2;
//sdcc loops allocating space for new symbols node1 and
//zzz until there is no more memory, then segfaults
//
//The reference to zzz inside the declaration of zzz
//triggers a loop allocating space for symbols node1
//and zzz
const NODE zzz = {4, {'x', 'p', 't','o',0},&node1 ,
&zzz, &node2};
void Config()
{
}
2.
I tried with differenet architectures and the result was
the same.
ex: sdcc -mpic16 -p18f452 -c lixo1.c
3.
$ sdcc --version
SDCC:mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08
2.5.6 #4195 (May 28 2006) (UNIX)
4.
sdcc -mpic16 -p18f452 -c lixo1.c
Segmentation fault
see coments in the code for the explanatio of the
segmentation fault.
The code is valid. It works with microchip and hi-tech
compilers.
Logged In: YES
user_id=888171
Fixed in SDCC 2.5.6 #4246.
Logged In: YES
user_id=1530099
This bug is not fixed for the pic architecture. sdcc still
gives a segmentation fault using sdcc -mpic16 -p18f452
Logged In: YES
user_id=888171
Sorry, I forgot the PIC ports have their own glue.c. Fixed
in SDCC 2.5.6 #4280.