RE: [coldfire-gnu-discuss] Warning messages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [coldfire-gnu-discuss] Warning messages



Hi John,
 
Just to add to David's well made reply...
 
The warnings are appearing to let you know that the type for the
variable and the type in the function declaration don't match _exactly_.
You will get this warning or similar ones if the types differ in other
ways, ie volatile, const, etc., qualifiers don't match. As David says,
you probably need to be more precise about your typing. (Btw, I thought
that signed char and char were the same).
 
If you know that you won't have any bad side effects, you can also cast
the variable to match the the function declaration. Beware that you are
in effect telling the compiler that you know better than it how to deal
with your variable! It is unsafe coding and not good practice to cast
variables all over the place, but it is often convenient and can make
code easier to follow so just do it with care.
 
Cheers,
 
Paul.
 
(Emails with read receipt requests normally get killed by my junk mail
filter - this only gets through as I have white listed codesourcery.com,
but I agree with David's comments)