View previous topic :: View next topic |
Author |
Message |
rafaluc2001
Joined: 20 Mar 2016 Posts: 10
|
Warning 240 |
Posted: Sun Mar 20, 2016 9:37 am |
|
|
Good afternoon,
I wonder what's going to appear this warning?
I'm using PCWHD 5,056.
>>> Warning 240 "C: \ Program Files \ PICC \ Drivers \ can-18xxx8.c" Line 112 (22.23): Pointer types do not match
can_set_id (RX0FILTER0 0, CAN_USE_EXTENDED_ID); // SET FILTER 0 of 0 mask
Note:
The Cursor in the comma RX0FILTRO
Another thing, when you compile in PCWHD 4,141 not appear this warning.
Thank you all,
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19551
|
|
Posted: Sun Mar 20, 2016 10:07 am |
|
|
You have fiddled with the file.
The supplied file has a comma between
RX0FILTER0 and the following 0..... |
|
|
rafaluc2001
Joined: 20 Mar 2016 Posts: 10
|
|
Posted: Sun Mar 20, 2016 10:15 am |
|
|
Sorry, error copy of the translator.
the right is.
can_set_id (RX0FILTER0, 0, CAN_USE_EXTENDED_ID); // SET FILTER 0 of 0 mask |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19551
|
|
Posted: Sun Mar 20, 2016 11:06 am |
|
|
OK.
That is because a little while ago, CCS added checks on whether things like pointers were of the type declared, rather than allowing automatic casting to just silently happen.
It is only a warning. Doesn't stop things from working.
If you want to avoid it, you can either just turn off the warning, or cast the variable to the required type (if you have the IDE just hover over the function, and it'll display the types it expects to receive).
They have obviously not checked this file, since the change was made. |
|
|
rafaluc2001
Joined: 20 Mar 2016 Posts: 10
|
|
Posted: Sun Mar 20, 2016 1:09 pm |
|
|
I do not know where to start, could you show a working example? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19551
|
|
Posted: Sun Mar 20, 2016 1:27 pm |
|
|
Why?.
The warning _does not matter_.
However if you must, then change every use of can_set_id like:
can_set_id ((unsigned int *)RX0FILTER0, 0, CAN_USE_EXTENDED_ID); // SET FILTER 0 of 0 mask
Adding the cast shown. |
|
|
rafaluc2001
Joined: 20 Mar 2016 Posts: 10
|
|
Posted: Sun Mar 20, 2016 2:27 pm |
|
|
It worked, no more warnings
Thank you for your help! |
|
|
|