-fsigned-char, -funsigned-char (-qchars)

Purpose

Determines whether all variables of type char are treated as signed or unsigned.

Syntax

Read syntax diagramSkip visual syntax diagram
        .-unsigned----.         
>>- -f--+-signed------+--char----------------------------------><
        +-no-unsigned-+         
        '-no-signed---'         

Read syntax diagramSkip visual syntax diagram
                  .-unsigned-.   
>>- -q--chars--=--+-signed---+---------------------------------><

Defaults

-funsigned-char or -qchars=unsigned

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 or C++ overloading.

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.


Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us