ARM Technical Support Knowledge Articles

PLAIN CHAR VS. SIGNED CHAR

Applies to: RealView C Compiler

Answer


Information in this article applies to:


QUESTION

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?

ANSWER

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:

SEE ALSO

Article last edited on: 2010-03-23 09:09:32

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential