This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Compile char as an unsigned char

Hello,

Can anyone tell me how to instruct Keil to compile char's as unsigned char's by default?

I know that there are some help topics on this issue, but they seem to be giving a precompiler directive to tell the compiler to always compile char's as signed char's....

Thanks!
Eric

Parents
  • If you are importing code and want these warnings fixed quickly use:

    --diag_suppress 167

    in the misc controls under C/C++ of configure flash tools

    The compiler is not considering char (that is unsigned by default) the same as unsigned char. It is considering them 2 different types that just happen to be the same.

    U8 and/or u8 are defined in Keil, but guess what, they are not the same as char, they are the same as unsigned char (even though char is unsigned by default)

Reply
  • If you are importing code and want these warnings fixed quickly use:

    --diag_suppress 167

    in the misc controls under C/C++ of configure flash tools

    The compiler is not considering char (that is unsigned by default) the same as unsigned char. It is considering them 2 different types that just happen to be the same.

    U8 and/or u8 are defined in Keil, but guess what, they are not the same as char, they are the same as unsigned char (even though char is unsigned by default)

Children