pavan01
Tester
 
Reged: Apr 11 2008
Posts: 15
Loc: India
|
|
when compile a simple c program with sprintf(). There is a warning msg main.c: main() 16: sprintf(g_byBuff,"%d",g_byTemp); ^ (359) illegal conversion between pointer types (warning)
And the program is
#include <stdio.h> xdata unsigned char g_byTemp; xdata unsigned char g_byBuff[20]; xdata unsigned char g_byBuffr[] = "Hello "; xdata unsigned char* _ptemp; xdata unsigned char g_byindex; void main(void) { g_byTemp = 0; _ptemp = 0; _ptemp = &g_byTemp; while (1) { g_byTemp++; sprintf(g_byBuff,"%d",g_byTemp); for (g_byindex = 0;g_byindex < 10;g_byindex++) { g_byBuff[g_byindex] = g_byBuffr[g_byindex]; } } } with command line
|
Dan Henry
Guru
  
Reged: Oct 16 2003
Posts: 3387
Loc: Boulder, Colorado U.S.A.
|
|
Please use Code tags to maintain formatting and improve code readability.
If you remove the 'xdata' qualifier from everything and let the PRO compiler figure out where to put things, then it works, doesn't it?
|