CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Warning 240

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
rafaluc2001



Joined: 20 Mar 2016
Posts: 10

View user's profile Send private message

Warning 240
PostPosted: Sun Mar 20, 2016 9:37 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Mar 20, 2016 10:07 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Mar 20, 2016 10:15 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Mar 20, 2016 11:06 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Mar 20, 2016 1:09 pm     Reply with quote

I do not know where to start, could you show a working example?
Ttelmah



Joined: 11 Mar 2010
Posts: 19551

View user's profile Send private message

PostPosted: Sun Mar 20, 2016 1:27 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Mar 20, 2016 2:27 pm     Reply with quote

It worked, no more warnings

Thank you for your help!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group