#pragma langlvl

Description

The #pragma langlvl directive selects the C language level for compilation.

Syntax

Read syntax diagramSkip visual syntax diagram>>-#--pragma--langlvl--(----language----)----------------------><

where values for language are described below.

C only For C programs, you can specify one of the following values for language:

classic Allows the compilation of non-stdc89 programs, and conforms closely to the K&R level preprocessor. This language level is not supported by the AIX v5.1 system header files, such as math.h. If you must use the AIX v5.1 system header files, consider compiling your program to the stdc89 or extended language levels.
extended Provides compatibility with the RT compiler and classic. This language level is based on C89.
saa Compilation conforms to the current SAA C CPI language definition. This is currently SAA C Level 2.
saal2 Compilation conforms to the SAA C Level 2 CPI language definition, with some exceptions.
stdc89 Compilation conforms to the ANSI C89 standard, also known as ISO C90.
stdc99 Compilation conforms to the ISO C99 standard.
Note:
Not all operating system releases support the header files and runtime library required by C99.
extc89 Compilation conforms to the ANSI C89 standard, and accepts implementation-specific language extensions.
extc99 Compilation conforms to the ISO C99 standard, and accepts implementation-specific language extensions.
Note:
Not all operating system releases support the header files and runtime library required by C99.

Default

The default language level varies according to the command you use to invoke the compiler:

Invocation
Default language level
xlc
extc89
cc
extended
c89
stdc89
c99
stdc99

Notes

This pragma can be specified only once in a source file, and it must appear before any noncommentary statements in a source file.

The compiler uses predefined macros in the header files to make declarations and definitions available that define the specified language level.

This directive can dynamically alter preprocessor behavior. As a result, compiling with the -E compiler option may produce results different from those produced when not compiling with the -E option.

Related information