-qtrigraph

Description

Instructs the compiler to recognize trigraph key combinations used to represent characters not found on some keyboards.

Syntax

Read syntax diagramSkip visual syntax diagram        .-trigraph---.
>>- -q--+-notrigraph-+-----------------------------------------><

Notes

A trigraph is a combination of three-key character combinations that let you produce a character that is not available on all keyboards.

The trigraph key combinations are:

Key Combination Character Produced
??= #
??( [
??) ]
??/ \
??' ^
??< {
??> }
??! |
??- ~

C only The default -qtrigraph setting can be overridden by explicitly setting the -qnotrigraph option on the command line.

An explicit -qnotrigraph specification on the command line takes precedence over the -qtrigraph setting normally associated with a given -qlanglvl compiler option, regardless of where the -qnotrigraph specification appears on the command line.

C++ only The same is true for C++ programs with one exception. When -qlanglvl=suboption appears after -qnotrigraph on the command line, the compiler assumes a setting of -qtrigraph regardless of the explicit setting of the -qnotrigraph option on the command line.

Examples

To disable trigraph character sequences when compiling your C program, enter:

xlc myprogram.c -qnotrigraph
  1. To disable trigraph character sequences when compiling your C++ program, enter:
    xlc++ myprogram.C -qnotrigraph
  2. The following command line invocation results in trigraphs being enabled regardless of the explicit setting of the -qnotrigraph compiler option:
    xlc++ myprogram.C -qnotrigraph -qlanglvl=strict98 
  3. To disable trigraph character sequences, specify -qnotrigraph on the command line after specifying the language level. For example, enter:
    xlc++ myprogram.C -qlanglvl=strict98 -qnotrigraph

Related information