-+ (plus sign) (C++ only)

Category

Input control

Pragma equivalent

None.

Purpose

Compiles any file as a C++ language file.

This option is equivalent to the -x c++ option.

Syntax

Read syntax diagramSkip visual syntax diagram
>>- -+ --------------------------------------------------------><

Usage

You can use -+ to compile a file with any suffix other than .a, .o, .so, .S or .s. If you do not use the -+ option, files must have a suffix of .C (uppercase C), .cc, .cp, .cpp, .cxx, or .c++ to be compiled as a C++ file. If you compile files with suffix .c (lowercase c) without specifying -+, the files are compiled as a C language file.

You cannot use the -+ option with the -qsourcetype or -x option.

Predefined macros

None.

Examples

To compile the file myprogram.cplspls as a C++ source file, enter:

 xlc -+ myprogram.cplspls 

Related information



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