Some change in the last couple of weeks looks to have crippled at
least 8051 (although I expect it is more general than that) error reporting.
Compiles of the erroneous C code below (missing " on line 27) with
first todays sdcc Windows snapshot (noting the uninformative error message):
$ "c:/program files/sdcc"/bin/sdcc -v
SDCC : mcs51/gbz80/z80/ds390/pic16/pic14/TININative/ds400/hc08 2.9.7 #5816 (Apr
28 2010) (MINGW32)
$ make
"c:/program files/sdcc"/bin/sdcc -c main.c --debug
abnormal program termination
at 1: warning 190: ISO C forbids an empty source file
make: *** [main.rel] Error 1
and then sdcc built from source under Cygwin a couple of weeks ago
with better error reporting :-):
SDCC : mcs51/gbz80/z80/ds390/pic16/pic14/TININative/ds400/hc08 2.9.7 #5669 (Mar
13 2010) (CYGWIN)
$ make
/usr/local//bin/sdcc -c main.c --debug
main.c:27:20: warning: missing terminating " character
main.c:19: warning 197: keyword 'xdata' is deprecated, use '__xdata' instead
main.c:28: warning 150: newline in string constant
main.c:29: warning 150: newline in string constant
main.c:30: warning 150: newline in string constant
main.c:31: warning 150: newline in string constant
main.c:32: warning 150: newline in string constant
main.c:33: warning 150: newline in string constant
main.c:34: warning 150: newline in string constant
main.c:35: warning 150: newline in string constant
main.c:36: warning 150: newline in string constant
main.c:37: warning 150: newline in string constant
main.c:38: warning 150: newline in string constant
main.c:39: warning 150: newline in string constant
main.c:40: warning 150: newline in string constant
main.c:41: warning 150: newline in string constant
main.c:42: warning 150: newline in string constant
main.c:43: warning 150: newline in string constant
main.c:44: warning 150: newline in string constant
main.c:45: warning 150: newline in string constant
main.c:45: syntax error: token -> '' ; column 1
make: *** [main.rel] Error 1
and the C code that both were compiling (I'm having trouble with atoi not
working correctly and am using the simulator to see if its my fault or a
compiler bug :-)):
/* main.c */
#include <stdio.h>
#include <string.h>
/*****************************************************************************
* Private constants, types, data and functions
*/
int atoi(char * s);
/*****************************************************************************
* Public function bodies
*/
/*---------------------------------------------------------------------------*/
void main (void)
{
char xdata buffer[80], string[20];
int num;
while (1) {
strcpy (string,"123");
num = atoi(string);
sprintf(buffer,"%d\n",num);
sprintf(buffer,"%s\n,string);
P1 = num & 0xff;
}
}
int atoi(char *s)
{
int xdata rv=0;
while (*s && *s >= '0' && *s <= '9') {
rv = (rv * 10) + (*s - '0');
s++;
}
return (rv);
}
/*---------------------------------------------------------------------------*/
Peter Van Epp
------------------------------------------------------------------------------
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user