XC8 novice question

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Novice question using MPLABx + XC8




If i define my_variable using;

#define my_variable 0b10000000


And then I use it in a function that expects a 'char';

void my_function(char i);



I get a compiler warning;

warning: (752) conversion to shorter data type




By changing the function prototype to expect an 'int' the warning goes  
away so I think the defined my_variable is being assigned as an 'int'


So my question is how or can I structure my define so the defined  
my_variable is assigned as a 'char'..


I cannot see anything useful in the mplabx documentation.

Thanks.

(also posted to comp.arch.embedded)

closed
Thanks, I got a heap of help from the kind folk over at comp.arch.embedded

Quoted text here. Click to load it


Site Timeline