User Tools

Site Tools


option_pragmas_1.htm
Navigation:  Advanced Topics > Legacy Project System Reference >====== Option #pragmas ====== Previous pageReturn to chapter overviewNext page

#pragmas with the class name option control language-dependent options, such as SoftVelocity extensions. The following option #pragmas are available:

#pragma option(ansi ⇒ on | off)

#pragma option(bit_opr ⇒ on | off)

#pragma option(incl_cmt ⇒ on | off)

#pragma option(lang_ext ⇒ on | off)

#pragma option(min_line ⇒ on | off)

#pragma option(nest_cmt ⇒ on | off)

#pragma option(pre_proc ⇒ on | off)

#pragma option(uns_char ⇒ on | off)

NoteBox.jpg

A pragma can be used in the Project language, C++ code, Modula-2 code, or Clarion code. Some only work in certain places. A 'P' to the right of the pragma indicates it can be used in the Project language, a 'C' indicates it can be used in C++ code, a 'M' indicates it can be used in Modula-2 code, and a 'W' indicates that it can be used in Clarion code (CLW files).

#pragma option(ansi ⇒ on | off)    cp

This #pragma is available under C and C++ Only. If it is set to on, ANSI keywords only are allowed. The default setting is off.

#pragma option(lang_ext ⇒ on | off)    cp

This #pragma is available under C and C++ Only. The following constructs are not valid under ANSI C, but are included in SoftVelocity C and C++ when this #pragma is not set on:

· A type cast yields an lvalue if the operand is an lvalue.

· Procedures can be initialized with binary machine code.

· The relational operators (>,>=,<;=,<;) allow the operators to be a mixture of integer and pointer operands.

· Bitfields in C can have type char and unsigned char.

· Relative pointers.

The default setting is on.

#pragma option(nest_cmt ⇒ on | off)   cp

This #pragma is available under C and C++ Only. When on, you can nest comments without causing an error message. For example:

/* This is a test comment

/* This is a nested comment */

*/

When off, nested comments cause an error message. The default is off, allowing the compiler to trap unterminated comments more easily and make it conform with ANSI C.

#pragma option(uns_char ⇒ on | off)   cp

This #pragma is available under C and C++ Only. When on, types declared as char lie between 0 and 255. When off, values declared as char lie between -127 and 128. The default setting is off.

#pragma option(pre_proc ⇒ on | off)    cp

This #pragma is available under C and C++ Only. When on, the compiler produces preprocessor output in a file with the same name but with extension .i. This output file makes it easy to debug the result of macro expansions. The default setting is off.

#pragma option(incl_cmt ⇒ on | off)    cp

This #pragma is available under C and C++ Only. When on, comments are preserved in preprocessor output. The default setting is off.

This #pragma has no effect unless #pragma pre_proc is on.

#pragma option(min_line ⇒ on | off)    cp

This #pragma is available under C and C++ Only. When on, the preprocessor minimizes the number of blank lines in output. The default setting is on.

This #pragma has no effect unless #pragma pre_proc is on.

#pragma option(bit_opr ⇒ on | off)    pm

This #pragma is available under Modula-2 only. It allows bitwise operations on cardinals:

( a AND/OR b, NOT a ).

The default setting is off.

option_pragmas_1.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1