-qkeyword

Category

Language element control

Pragma equivalent

None

Purpose

Controls whether the specified name is treated as a keyword or as an identifier whenever it appears in your program source.

Syntax

Read syntax diagramSkip visual syntax diagram
>>- -q--+-keyword---+--=--keyword_name-------------------------><
        '-nokeyword-'                    

Defaults

By default all the built-in keywords defined in the C and C++ language standards are reserved as keywords.

Usage

You cannot add keywords to the language with this option. However, you can use -qnokeyword=keyword_name to disable built-in keywords, and use -qkeyword=keyword_name to reinstate those keywords.

C++ only This option can be used with all C++ built-in keywords.

C only This option can also be used with the following C keywords:
  • asm
  • inline
  • restrict
  • typeof
Note: C only asm is not a keyword when the -qlanglvl option is set to stdc89 or stdc99.

Predefined macros

Examples

C++ only You can reinstate bool with the following invocation:
xlc++ -qkeyword=bool
C only You can reinstate typeof with the following invocation:
xlc -qkeyword=typeof

Related information