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 support@ccsinfo.com

warning> can_set_id( Pointer types do not match

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



Joined: 25 Nov 2016
Posts: 1

View user's profile Send private message

warning> can_set_id( Pointer types do not match
PostPosted: Fri Nov 25, 2016 2:59 am     Reply with quote

Where is the problem_


RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

PostPosted: Fri Nov 25, 2016 5:52 am     Reply with quote

The "pointer types do not match" warnings are warnings - they do not say something is wrong with the code, just that something is a bit odd and may have a problem. In this case there is NO problem, the code will work correctly as is.

The warning appeared only with fairly recent compilers as CCS implemented stronger type checking. The warning did not appear until well into version 5. Read the other recent thread on "pointer types do not match" for more details.

The warning is there because can_set_id() is declared as:
Code:
void can_set_id(unsigned int* addr, unsigned int32 id, int1 ext)

and the address parameter in the CCS code is from a macro definition that uses getenv. Getenv returns an address, which is what is wanted, but of an unknown type, and the evidence suggests its NOT unsigned int*. Really, what it should be is that can_set_id() was defined as:
Code:

void can_set_id(void* addr, unsigned int32 id, int1 ext)

but until very recently even that would have still generated the warnings! The latest compiler should not generate the warnings with void*.

You can ignore the warnings.

What I am more concerned about is the warning that interrupts are being disabled on can_set_id. That means you are calling it in both main code AND interrupt code. That is NOT a good idea. I can see little or no reason for calling it in interrupt code. The ID filters generally only need to be set once at start-up/initialisation and then left alone.
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