Forum : ST7/STM8
Original Post
Post Information | Post |
---|---|
March 26, 2010 - 2:43pm
|
I have a global variable u8 hours_dig_five; I have a function that increments the variable: 17 1 ++hours_dig_five; which then compiles to ; SOURCE LINE # 17 It looks to me like the global is being treated as an int, but I have it declared as a char. Is there a compiler or preprocessor setting that will prevent this from happening? Thanks for any help, Eric |
Hi Eric,
Definitely no, a char is always an 8-bit object. What you can change is whether it has a signed or an unsigned qualifier by default.
There must be some problem with your "u8" definition. Can you add the following as the first line of your C file:
#pragma preprint
This will generate a preprocessed source file, with extension ".i".
When you analyze this preprocessed file you should have a clearer view of what's happening, so the fix should be easier.
In case you are not able to find the problem, can you share your preprocessed ".i" file as well as your listing file ".lst" with us, so that we can help further?
Regards,
Bruno