gnupic: SDCC Internal Error: 18f252


Previous by date: 14 Nov 2006 18:28:21 +0000 Re: [gnupic] adding led to gpsim mod_test, Scott Dattalo
Next by date: 14 Nov 2006 18:28:21 +0000 "pagesel $" dup error, David Barnett
Previous in thread:
Next in thread:

Subject: SDCC Internal Error: 18f252
From: "polly " ####@####.####
Date: 14 Nov 2006 18:28:21 +0000
Message-Id: <op.ti0qwlhus46xuf@self>

Hello,
   I'm having trouble setting up addresses in a linked list. I have  
attached a short
piece of code, it seems to compile ok with gcc but gives the following  
error when
I try to compile for the 18f252 with SDCC. The error occurs at the  
declaration
of the linked list; I've tried removing the ( llst *) typecasts, then a  
different
error occurs. TIA for any advice, regards, p

> sdcc -V -D CHIP18f252 -mpic16 -p18f252  
> -I/usr/local/share/sdcc/include/pic16 testCall.c -o testCall.asm
+ "/usr/local/bin/sdcpp" -nostdinc -Wall -std=c99 -DCHIP18f252  
-I"/usr/local/share/sdcc/include/pic16" -Dpic18f252 -D__18f252  
-DSTACK_MODEL_SMALL -obj-ext=.o -DSDCC_MODEL_SMALL -DSDCC=260 -DSDCC_pic16  
-D__pic16 -I"/usr/local/bin/../share/sdcc/include/pic16"  
-I"/usr/local/share/sdcc/include/pic16"  
-I"/usr/local/share/sdcc/include/pic16"  "testCall.c"
Internal error: validateLink failed in SPEC_SCLS(expr->left->etype) @  
glue.c:433: expected SPECIFIER, got null-link


// testCall.c
//
#include "stdio.h"

void fun0(void);
void fun1(void);
void fun2(void);

// generic list link
typedef struct llst {
   struct llst  *lbak;
   void         *pnow;
   struct llst  *lfwd;
   } llst;

//
typedef struct nameCall {
   char name [6];
   void (*pxeq)();
   } nameCall;

nameCall fun0Defn = { "fun0", fun0};
nameCall fun1Defn = { "fun1", fun1};
nameCall fun2Defn = { "fun2", fun2};

// Here's where the problem lies ........
llst callList [] = {
   { ( llst *) &callList[0], (void *)&fun0Defn, ( llst *) &callList[1]},
   { ( llst *) &callList[0], (void *)&fun1Defn, ( llst *) &callList[2]},
   { ( llst *) &callList[1], (void *)&fun2Defn, ( llst *) &callList[2]}
};

void fun0() {
   printf ("fun0 ntry\r\n");
}

void fun1() {
   printf ("fun1 ntry\r\n");
}

void fun2() {
   printf ("fun2 ntry\r\n");
}

void main() {
// app main loop
   while (1) {
     //
    printf ("main ntry\r\n");
   }
}




-- 
<=>

Previous by date: 14 Nov 2006 18:28:21 +0000 Re: [gnupic] adding led to gpsim mod_test, Scott Dattalo
Next by date: 14 Nov 2006 18:28:21 +0000 "pagesel $" dup error, David Barnett
Previous in thread:
Next in thread:


Powered by ezmlm-browse 0.20.