From: Gudjon I. G. <gu...@gu...> - 2008-04-26 19:53:12
|
Hi I made the following routine that worked perfectly in version 2.7.0 but now I have a problem with version 2.8.0. The code is the following. #define N 0x10 __xdata unsigned long totspect[N]; __xdata unsigned char * __data p; for (p=totspect;p<totspect+N;p++) serial_putchar(*p); The error message I get is the following: icel.c:60: error 47: indirections to different types assignment from type 'unsigned-long-int xdata-[16] ' to type 'unsigned-char data-xdata* ' I tried to change the for statement to for (p=totspect;p<totspect+(__xdata*)N;p++) But it is not allowed to add pointers. Can someone help me? Thanks Gudjon |
From: Philipp K. K. <pk...@sp...> - 2008-04-26 20:16:50
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Gudjon I. Gudjonsson schrieb: > Hi > I made the following routine that worked perfectly in version 2.7.0 but > now I have a problem with version 2.8.0. The code is the following. > > #define N 0x10 > __xdata unsigned long totspect[N]; > __xdata unsigned char * __data p; > > for (p=totspect;p<totspect+N;p++) > serial_putchar(*p); > > The error message I get is the following: > icel.c:60: error 47: indirections to different types assignment > from type 'unsigned-long-int xdata-[16] ' to type 'unsigned-char data-xdata* ' > > I tried to change the for statement to > for (p=totspect;p<totspect+(__xdata*)N;p++) > > But it is not allowed to add pointers. Can someone help me? I think sdcc is not complaing about p<totspect+N, it's complaining about p=totspect. Philipp -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIE42RbtUV+xsoLpoRAtCpAKDt5XWs80vYdZCDeZd12B4vEtLxbACfW8lJ EeTDHxhoNRwN/M+YOmpgdTU= =4uZi -----END PGP SIGNATURE----- |
From: Gudjon I. G. <gu...@gu...> - 2008-04-26 21:32:48
|
Thanks Philipp Sorry, my silly mistake. But it worked before :) > > > > I tried to change the for statement to > > for (p=totspect;p<totspect+(__xdata*)N;p++) > > > > But it is not allowed to add pointers. Can someone help me? The new code is p=(__xdata unsigned char *) totspect; for (i=0;i<64;i++) serial_putchar(*p++); and at least it compiles now. Thanks a lot Gudjon |