-qchars
Category
Pragma equivalent
#pragma options chars, #pragma chars
None.
Purpose
Determines whether all variables of type char is treated as signed or unsigned.
Syntax
.-unsigned-. >>- -q--chars--=--+-signed---+---------------------------------><
Pragma syntax .-unsigned-. >>-#--pragma--chars--(--+-signed---+--)------------------------><
Defaults
-qchars=unsigned
Parameters
- unsigned
- Variables of type char are treated as unsigned char.
- signed
- Variables of type char are treated as signed char.
Usage
Regardless of the setting of this option or pragma, the type of char is still considered to be distinct from the types unsigned char and signed char for purposes of type-compatibility checking.
The pragma must appear before any source statements. If the pragma is specified more than once in the source file, the first one will take precedence. Once specified, the pragma applies to the entire file and cannot be disabled; if a source file contains any functions that you want to compile without #pragma chars, place these functions in a different file.
Predefined macros
- _CHAR_SIGNED and __CHAR_SIGNED__ are defined to 1 when signed is in effect; otherwise, it is undefined.
- _CHAR_UNSIGNED and __CHAR_UNSIGNED__ are defined to 1 when unsigned is in effect; otherwise, they are undefined.
Examples
To
treat all char types as signed when
compiling myprogram.c, enter:
xlc myprogram.c -qchars=signed