XC8 novice question

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)

Reply to
rwood
Loading thread data ...

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

Reply to
rwood

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.