|ARM Technical Support Knowledge Articles|
Applies to: RealView C Compiler
Information in this article applies to:
I am using in my software typedef's to allow easy migration between different platforms. However the typedef for the INT8 datatype causes warning messages when I am passing it to standard C functions that take a char* parameter. I am getting the message:
warning: #167-D: argument of type "INT8 *" is incompatible with parameter of type "char *"
The data type INT8 is defined as:
typedef signed char INT8;
What are the reasons for these warning messages?
Can I disable the warning messages?
There is a difference between a plain char and a signed char. By default a plain char represents an unsigned char value. Using the compiler directive --signed_chars changes the default behaviour of plain char to be a signed char. In µVision this is configured under Project - Options - C/C++ - Plain Char is Signed.
Since your typedef is not 100% compatible, you are getting these warning messages.
You have the following options to solve the problem:
typedef char INT8;When you use the compiler directive --signed_chars you define with INT8 effectively a signed char.
#pragma diag_suppress 167
Article last edited on: 2010-03-23 09:09:32
Did you find this article helpful? Yes No
How can we improve this article?