Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] PICC-18 Warning[359] illegal conversion between pointer types

Status
Not open for further replies.

mrcube_ns

Advanced Member level 1
Joined
Apr 10, 2002
Messages
452
Helped
48
Reputation
96
Reaction score
34
Trophy points
1,308
Location
Europe
Activity points
3,813
Hi all,

I doing some project on PIC18F4550, and using PICC-18 compiler.

I have problem!

In declaration part before main I have:
static char rxBuff[250];
static char *p_poc;



In main routine I have:
p_poc = strstr(rxBuff, "+CMGR: \"REC");


After compiling project I get:
Warning[359] illegal conversion between pointer types
for this line of code.

Any ideas?!?
What I do wrong??



Thanks in advance!!!


Mr.Cube
 

The compiler indicates a "Warning" due to the fact the library function:

char * strstr (const char * s1, const char * s2)

expects both parameters passed to it to be of type "const char *", which obviously:

static char rxBuff[250];

is not "const", however this should not prevent the program from being compiled successfully.

The latest version of the PICC18 Compiler appears to no longer issue the "Warning".

You could cast rxBuff:

p_poc = strstr((const char *)rxBuff, "+CMGR: \"REC");

or upgrade to the latest version of PICC18, I'm current using version 9.66 and no warning is issued.

Hope this info helps in your endeavors.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top