# HG changeset patch # User fturovic # Date 1279574004 18000 # Node ID 2b3996fc09a186130cc3a675e932efa6ca30af1a # Parent 4891d49809bbd336ebd5816b9cba23aa413e13a5 revised x86 compiler dates, graphics, CSS, and release notes diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/book.css --- a/core/com.nokia.carbide.cpp.compiler.doc.user/book.css Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/book.css Mon Jul 19 16:13:24 2010 -0500 @@ -1,34 +1,33 @@ /* - Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.eclipse.org/legal/epl-v10.html */ /* Add whitespace around entire display to avoid crowding edges of view */ -/* 20070523-Removed top margin size to close gap between location breadcrumbs and page title */ html { margin: 2px 10px 10px 10px; } -/* Set default font to serif style, 12-pt and plain */ -body, p, table { - font-family: Verdana, Helvetica, sans-serif; - font-size: 13px; +/* 20091007 added verdana and ariel to list to match SFO website fonts choices */ +body, p, table, li { + font-family: Verdana, Ariel, Helvetica, sans-serif; + font-size: 1.0em; font-weight: normal; } -/* Use sans-serif fonts for all title styles */ h1, h2, h3, h4, h5, h6, strong, em { - font-family: Verdana, Helvetica, sans-serif; + font-family: Verdana, Ariel, Helvetica, sans-serif; color: #000000; } -h1 { font-size:20px } -h2 { font-size:18px } -h3 { font-size:16px } -h4 { font-size:14px } -h5 { font-size:13px } -h6 { font-size:12px } +/* 20091007 - changed sizes to use em versus px */ +h1 { font-size: 1.3em } +h2 { font-size: 1.2em } +h3 { font-size: 1.1em } +h4 { font-size: 1.0em } +h5 { font-size: 0.9em } +h6 { font-size: 0.8em } /* For headlines at the top of a view, add space */ /* 20090224-changed green fade to gold header image */ @@ -38,6 +37,10 @@ padding:10px 0px 10px 12px; } +/* 20091007 SFO styling added */ +h1.NavTitle { font-size: 1.2em } +h3 .NavListTitle { font-size: 1.1em } + li { margin-bottom:8px; margin-top:8px; @@ -48,27 +51,28 @@ padding-top:10px; margin-top:20px; border-top:1px solid #999; - font-family: Verdana, Helvetica, sans-serif; - font-size: 11px; - color:#333; + font-family: Verdana, Ariel, Helvetica, sans-serif; + font-size: 0.8em; + color: #333333; } .listing { + background-color: #FFFFCC; font-family: "Courier New", Courier, mono; + font-size: 1.1em; color: #000000; - background-color: #FFFFCC; margin: 5px 0px; } .code, pre { font-family: "Courier New", Courier, mono; - font-size: 13px; + font-size: 1.1em; color: #000000; } .step { /* background-color: #EEE; */ - /* margin: 10px 0px; */ + /* margin: 10px 0px; */ /* color: #111; */ /* border-bottom:2px solid #EEE; */ } @@ -88,7 +92,6 @@ table { border: solid #999 1px; table-layout: auto; - font-size: 13px; } td, th { @@ -97,11 +100,8 @@ vertical-align:top; } -/* 20070522-replaced gray with green background to match gradiant color for title */ th { - background-color:#FFC550; /* background-color:#acd79b; - background-color:#999; - color:#FFF; */ + background-color: #CCDC00; } div.ol.p { @@ -118,11 +118,9 @@ font-weight:normal; } -/* Make all H4 and H5 items appear in bold gray against a light green background */ div h5, div h4 { padding:5px 0px 5px 12px; - background-color:#FDCB2F; - /* background-color: #EEE; */ + background-color: #D3DAD4; font-weight:bold; color: #000000; } @@ -130,8 +128,6 @@ /* Notes stand out using a light top & bottom borders with dark gray text */ p.note { - /* color: #03C; */ - /* background-color: #FFFF99; */ color: #333; padding: 5px; margin-left: 1em; @@ -143,11 +139,12 @@ /* Figure/Listing/Table titles are centered and gray */ p.figure { - color: #333; + color: #026690; text-align: center; font-weight: bold; } + /* highly visible red background and white text for things that need fixing before release */ /* SHOULD NOT BE PRESENT IN RELEASED PRODUCTS */ .fix { @@ -163,14 +160,14 @@ } .titleSmall { - font-family: Helvetica, sans-serif; - font-size: 11px; + font-family: Verdana, Ariel, Helvetica, sans-serif; + font-size: 0.8em; } .plain { - font-family: Helvetica, sans-serif; - font-size: 12px; + font-family: Verdana, Ariel, Helvetica, sans-serif; + font-size: 0.9em; font-style: normal; line-height: normal; font-weight: normal; @@ -179,6 +176,6 @@ text-decoration: none; } -a:link { color: #0033CC } +a:link { color: #026690 } a:visited { color: #555555 } -a:hover { color: #0033CC } +a:hover { color: #FFD62C } diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_be_arguments.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_be_arguments.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_be_arguments.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,16 +1,16 @@ - - - - - -Arguments to main() - - - -

Arguments to main()

-

The main() function can accept two or more arguments (ISO C, §5.1.2.2.1) of the form:

-

int main(int argc, char *argv[]) { /*...*/ }

-

The values stored in the argc and argv arguments depend on Carbide C’s target platform.

- - - + + + + + +Arguments to main() + + + +

Arguments to main()

+

The main() function can accept two or more arguments (ISO C, §5.1.2.2.1) of the form:

+

int main(int argc, char *argv[]) { /*...*/ }

+

The values stored in the argc and argv arguments depend on Carbide C’s target platform.

+ + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_be_char_sets.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_be_char_sets.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_be_char_sets.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,16 +1,16 @@ - - - - - -Character Sets - - - -

Character Sets

-

Carbide generally supports the 8-bit character set of the host OS.

- - - - - + + + + + +Character Sets + + + +

Character Sets

+

Carbide generally supports the 8-bit character set of the host OS.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_be_devices.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_be_devices.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_be_devices.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,17 +1,17 @@ - - - - - -Arguments to main() - - - -

Interactive Device

-

An interactive device is that part of a computer that accepts input from and provides output to a human operator (ISO C, §5.1.2.3). Traditionally, the conventional interactive devices are consoles, keyboards, and character display terminals.

-

For embedded systems that do not have a keyboard or display, Carbide provides console interaction through a serial or Ethernet connection between the target and host computers.

- - - - - + + + + + +Arguments to main() + + + +

Interactive Device

+

An interactive device is that part of a computer that accepts input from and provides output to a human operator (ISO C, §5.1.2.3). Traditionally, the conventional interactive devices are consoles, keyboards, and character display terminals.

+

For embedded systems that do not have a keyboard or display, Carbide provides console interaction through a serial or Ethernet connection between the target and host computers.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_be_diag_msgs.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_be_diag_msgs.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_be_diag_msgs.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,18 +1,18 @@ - - - - - -How to Identify Diagnostic Messages - - - -

How to Identify Diagnostic Messages

-

Diagnostics are error and warning messages the C compiler issues when it encounters improper program syntax (ISO C, §5.1.1.3).

-

Within the Carbide IDE, the Carbide C compiler issues diagnostic messages in the Console view.

-

From the command line, Carbide C issues diagnostic messages to the standard error file.

- - - - - + + + + + +How to Identify Diagnostic Messages + + + +

How to Identify Diagnostic Messages

+

Diagnostics are error and warning messages the C compiler issues when it encounters improper program syntax (ISO C, §5.1.1.3).

+

Within the Carbide IDE, the Carbide C compiler issues diagnostic messages in the Console view.

+

From the command line, Carbide C issues diagnostic messages to the standard error file.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_be_enums.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_be_enums.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_be_enums.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,16 +1,16 @@ - - - - - -Enumerations - - - -

Enumerations

-

See Enumerated Types.

- - - - - + + + + + +Enumerations + + + +

Enumerations

+

See Enumerated Types.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_be_identifiers.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_be_identifiers.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_be_identifiers.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,16 +1,16 @@ - - - - - -Character Sets - - - -

Identifiers

-

(ISO C, §6.2.4.1) Carbide C recognizes the first 255 characters of identifiers, whether or not the identifiers have external linkage. In identifiers with external linkage, uppercase and lowercase characters are distinct.

- - - - - + + + + + +Character Sets + + + +

Identifiers

+

(ISO C, §6.2.4.1) Carbide C recognizes the first 255 characters of identifiers, whether or not the identifiers have external linkage. In identifiers with external linkage, uppercase and lowercase characters are distinct.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_be_implementation.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_be_implementation.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_be_implementation.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,174 +1,174 @@ - - - - - -Implementation Quantities - - - -

Implementation Quantities

-

The C/C++ compiler has the implementation quantities listed in Table 1, based on the ISO C++ Standard. Although the values in the right-side column are the recommended minimums for each quantity, they do not determine the compliance of the quantity.

-

NOTE The right-side column value “unlimited” means unlimited only up to and including memory and time limitations.

-
Table 1. Implementation Quantities for the C/C++ Compiler
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QuantityMinimum
Nesting levels of compound statements, iteration control structures, and selection control structures [256]Unlimited
Nesting levels of conditional inclusion [256]32
Pointer, array, and function declarators (in any combination) modifying an arithmetic, structure, union, or incomplete type in a declaration [256]Unlimited
Nesting levels of parenthesized expressions within a full expression [256]Unlimited
Number of initial characters in an internal identifier or macro name [1024]Unlimited
- (255 significant in identifiers)
Number of initial characters in an external identifier [1024]Unlimited
- (255 significant in identifiers)
External identifiers in one translation unit [65536]Unlimited
Identifiers with block scope declared in one block [1024]Unlimited
Macro identifiers simultaneously defined in one translation unit [65536]Unlimited
Parameters in one function definition [256]Unlimited
Arguments in one function call [256]Unlimited
Parameters in one macro definition [256]128
Arguments in one macro invocation [256]128
Characters in one logical source line [65536] Unlimited
Characters in a character string literal or wide string literal (after concatenation) [65536]Unlimited
Size of an object [262144]2 GB
Nesting levels for #include files [256]32
Case labels for a switch statement (excluding those for any nested switch statements) [16384]Unlimited
Data members in a single class, structure, or union [16384]Unlimited
Enumeration constants in a single enumeration [4096]Unlimited
Levels of nested class, structure, or union definitions in a single struct-declaration-list [256]Unlimited
Functions registered by atexit()[32]64
Direct and indirect base classes [16384]Unlimited
Direct base classes for a single class [1024]Unlimited
Members declared in a single class [4096]Unlimited
Final overriding virtual functions in a class, accessible or not [16384]Unlimited
Direct and indirect virtual bases of a class [1024]Unlimited
Static members of a class [1024]Unlimited
Friend declarations in a class [4096]Unlimited
Access control declarations in a class [4096]Unlimited
Member initializers in a constructor definition [6144] Unlimited
Scope qualifications of one identifier [256]Unlimited
Nested external specifications [1024]Unlimited
Template arguments in a template declaration [1024] Unlimited
Recursively nested template instantiations [17]Unlimited
Handlers per try block [256]Unlimited
Throw specifications on a single function declaration [256]Unlimited
- - - - - + + + + + +Implementation Quantities + + + +

Implementation Quantities

+

The C/C++ compiler has the implementation quantities listed in Table 1, based on the ISO C++ Standard. Although the values in the right-side column are the recommended minimums for each quantity, they do not determine the compliance of the quantity.

+

NOTE The right-side column value “unlimited” means unlimited only up to and including memory and time limitations.

+
Table 1. Implementation Quantities for the C/C++ Compiler
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QuantityMinimum
Nesting levels of compound statements, iteration control structures, and selection control structures [256]Unlimited
Nesting levels of conditional inclusion [256]32
Pointer, array, and function declarators (in any combination) modifying an arithmetic, structure, union, or incomplete type in a declaration [256]Unlimited
Nesting levels of parenthesized expressions within a full expression [256]Unlimited
Number of initial characters in an internal identifier or macro name [1024]Unlimited
+ (255 significant in identifiers)
Number of initial characters in an external identifier [1024]Unlimited
+ (255 significant in identifiers)
External identifiers in one translation unit [65536]Unlimited
Identifiers with block scope declared in one block [1024]Unlimited
Macro identifiers simultaneously defined in one translation unit [65536]Unlimited
Parameters in one function definition [256]Unlimited
Arguments in one function call [256]Unlimited
Parameters in one macro definition [256]128
Arguments in one macro invocation [256]128
Characters in one logical source line [65536] Unlimited
Characters in a character string literal or wide string literal (after concatenation) [65536]Unlimited
Size of an object [262144]2 GB
Nesting levels for #include files [256]32
Case labels for a switch statement (excluding those for any nested switch statements) [16384]Unlimited
Data members in a single class, structure, or union [16384]Unlimited
Enumeration constants in a single enumeration [4096]Unlimited
Levels of nested class, structure, or union definitions in a single struct-declaration-list [256]Unlimited
Functions registered by atexit()[32]64
Direct and indirect base classes [16384]Unlimited
Direct base classes for a single class [1024]Unlimited
Members declared in a single class [4096]Unlimited
Final overriding virtual functions in a class, accessible or not [16384]Unlimited
Direct and indirect virtual bases of a class [1024]Unlimited
Static members of a class [1024]Unlimited
Friend declarations in a class [4096]Unlimited
Access control declarations in a class [4096]Unlimited
Member initializers in a constructor definition [6144] Unlimited
Scope qualifications of one identifier [256]Unlimited
Nested external specifications [1024]Unlimited
Template arguments in a template declaration [1024] Unlimited
Recursively nested template instantiations [17]Unlimited
Handlers per try block [256]Unlimited
Throw specifications on a single function declaration [256]Unlimited
+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_be_libraries.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_be_libraries.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_be_libraries.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,16 +1,16 @@ - - - - - -Library Behaviors - - - -

Library Behaviors

-

This reference does not cover implementation-defined behaviors in the Metrowerks Standard Library for C (MSL C).

- - - - - + + + + + +Library Behaviors + + + +

Library Behaviors

+

This reference does not cover implementation-defined behaviors in the Metrowerks Standard Library for C (MSL C).

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_behavior.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_behavior.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_behavior/c_behavior.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,28 +1,28 @@ - - - - - -C Implementation-Defined Behavior - - - -

C Implementation-Defined Behavior

-

The ISO standard for C leaves many details about the form and translation of C programs up to the implementation of the C compiler. Section J.3 of the ISO C Standard lists the unique implementation-defined behaviors. Numbers in parentheses that begin with “§” indicate the ISO C standard section to which an implementation-defined behavior refers.

-

This section refers to implementation-defined behaviors of the compiler itself. Topics include:

- -

For information on implementation-defined behaviors of the Standard C Library, consult the MSL C Library Reference.

- - - - - + + + + + +C Implementation-Defined Behavior + + + +

C Implementation-Defined Behavior

+

The ISO standard for C leaves many details about the form and translation of C programs up to the implementation of the C compiler. Section J.3 of the ISO C Standard lists the unique implementation-defined behaviors. Numbers in parentheses that begin with “§” indicate the ISO C standard section to which an implementation-defined behavior refers.

+

This section refers to implementation-defined behaviors of the compiler itself. Topics include:

+ +

For information on implementation-defined behaviors of the Standard C Library, consult the MSL C Library Reference.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_ansi_keywords.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_ansi_keywords.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_ansi_keywords.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,25 +1,25 @@ - - - - - -ANSI Keywords Only - - - -

ANSI Keywords Only

-

(ISO C, §6.4.1) The Carbide compiler can recognize several additional reserved keywords. If you enable this setting, the compiler generates an error if it encounters any of the additional keywords that it recognizes. If you must write source code that strictly adheres to the ISO standard, enable the ANSI Strict setting.

-

If you disable this setting, the compiler recognizes the following non-standard keywords:

- -

The ANSI Keywords Only setting corresponds to the pragma only_std_keywords. To check this setting, use __option (only_std_keywords). By default, this setting is disabled.

-

See also “only_std_keywords” and Checking Settings.
-

- - - - - + + + + + +ANSI Keywords Only + + + +

ANSI Keywords Only

+

(ISO C, §6.4.1) The Carbide compiler can recognize several additional reserved keywords. If you enable this setting, the compiler generates an error if it encounters any of the additional keywords that it recognizes. If you must write source code that strictly adheres to the ISO standard, enable the ANSI Strict setting.

+

If you disable this setting, the compiler recognizes the following non-standard keywords:

+ +

The ANSI Keywords Only setting corresponds to the pragma only_std_keywords. To check this setting, use __option (only_std_keywords). By default, this setting is disabled.

+

See also “only_std_keywords” and Checking Settings.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_bit_rotation.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_bit_rotation.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_bit_rotation.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,24 +1,24 @@ - - - - - -Intrinsic Functions for Bit Rotation - - - -

Intrinsic Functions for Bit Rotation

-

The Carbide C language has functions

-

__rol(op, n)
- __ror(op, n)

-

that do left- or right-bit rotation, respectively.

-

The op argument represents the item with the rotated bits. The n argument represents the number of times to rotate the op bits.

-

The op argument is not promoted to a larger data type and can be of type char, short, int, long, or long long.

-

These functions are intrinsic (“built-in”). That is, you do not have to provide function prototypes or link with special libraries to use these functions.

-

NOTE Currently, these functions are limited to the Motorola 68K and Intel x86 versions of the Carbide C/C++ compiler. -

- - - - - + + + + + +Intrinsic Functions for Bit Rotation + + + +

Intrinsic Functions for Bit Rotation

+

The Carbide C language has functions

+

__rol(op, n)
+ __ror(op, n)

+

that do left- or right-bit rotation, respectively.

+

The op argument represents the item with the rotated bits. The n argument represents the number of times to rotate the op bits.

+

The op argument is not promoted to a larger data type and can be of type char, short, int, long, or long long.

+

These functions are intrinsic (“built-in”). That is, you do not have to provide function prototypes or link with special libraries to use these functions.

+

NOTE Currently, these functions are limited to the Motorola 68K and Intel x86 versions of the Carbide C/C++ compiler. +

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_char_const_as_int.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_char_const_as_int.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_char_const_as_int.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,46 +1,46 @@ - - - - - -Character Constants as Integer Values - - - -

Character Constants as Integer Values

-

(ISO C, §6.4.4.4) The C compiler lets you use string literals containing 2 to 8 characters to denote 32-bit or 64-bit integer values. Table 2.2 shows examples.

-

Table 2.2 Integer Values as Character String Constants

- - - - - - - - - - - - - - - - - - - - - - - - - -
Character constantEquivalent hexadecimal integer value
'ABCDEFGH'0x4142434445464748 (64-bit value)
'ABCDE'0x0000000041424344 (64-bit value)
'ABCD'0x41424344 (32-bit value)
'ABC'0x00414243 (32-bit value)
'AB'0x00004142 (32-bit value)
-

You cannot disable this extension, and it has no corresponding pragma or setting in any panel.

-

NOTE This feature differs from using multibyte character sets, where a single character requires a data type larger than 1 byte. See Multibyte and Unicode Support for information on using character sets with more than 256 characters (such as Kanji).
-

- - - - - + + + + + +Character Constants as Integer Values + + + +

Character Constants as Integer Values

+

(ISO C, §6.4.4.4) The C compiler lets you use string literals containing 2 to 8 characters to denote 32-bit or 64-bit integer values. Table 2.2 shows examples.

+

Table 2.2 Integer Values as Character String Constants

+ + + + + + + + + + + + + + + + + + + + + + + + + +
Character constantEquivalent hexadecimal integer value
'ABCDEFGH'0x4142434445464748 (64-bit value)
'ABCDE'0x0000000041424344 (64-bit value)
'ABCD'0x41424344 (32-bit value)
'ABC'0x00414243 (32-bit value)
'AB'0x00004142 (32-bit value)
+

You cannot disable this extension, and it has no corresponding pragma or setting in any panel.

+

NOTE This feature differs from using multibyte character sets, where a single character requires a data type larger than 1 byte. See Multibyte and Unicode Support for information on using character sets with more than 256 characters (such as Kanji).
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_compiler.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_compiler.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_compiler.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,23 +1,23 @@ - - - - - -C Compiler - - - -

C Compiler

-

This section covers the following topics:

- -

The information in this section applies to all target platforms for which the Carbide C compiler generates object code.

-

This section does not cover C++ features. For more information on the Carbide.c++ language, see C++ Compiler.
-

- - - - - + + + + + +C Compiler + + + +

C Compiler

+

This section covers the following topics:

+ +

The information in this section applies to all target platforms for which the Carbide C compiler generates object code.

+

This section does not cover C++ features. For more information on the Carbide.c++ language, see C++ Compiler.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_convert_ptrs.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_convert_ptrs.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_convert_ptrs.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,22 +1,22 @@ - - - - - -Converting Pointers to Types of the Same Size - - - -

Converting Pointers to Types of the Same Size

-

The C compiler allows the conversion of pointer types to integral data types of the same size in global initializations. Since this type of conversion does not conform to the ANSI C standard, it is only available if the ANSI Strict setting is disabled.

-
-
Converting a Pointer to a Same-sized Integral Type
-

char c;
- long arr = (long)&c; // accepted (not ISO C)

-
-

See Checking for Standard C and Standard C++ Conformity for more information on this setting.

- - - - - + + + + + +Converting Pointers to Types of the Same Size + + + +

Converting Pointers to Types of the Same Size

+

The C compiler allows the conversion of pointer types to integral data types of the same size in global initializations. Since this type of conversion does not conform to the ANSI C standard, it is only available if the ANSI Strict setting is disabled.

+
+
Converting a Pointer to a Same-sized Integral Type
+

char c;
+ long arr = (long)&c; // accepted (not ISO C)

+
+

See Checking for Standard C and Standard C++ Conformity for more information on this setting.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_cpp_comments.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_cpp_comments.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_cpp_comments.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,20 +1,20 @@ - - - - - -C++ Comments - - - -

C++ Comments

-

(ISO C, §6.4.9) The C compiler can accept C++ comments (//) in source code. C++ comments consist of anything that follows // on a line.

-

a = b; // This is a C++ comment

-

To use this feature, disable the ANSI Strict setting.

-

See also Checking for Standard C and Standard C++ Conformity. -

- - - - - + + + + + +C++ Comments + + + +

C++ Comments

+

(ISO C, §6.4.9) The C compiler can accept C++ comments (//) in source code. C++ comments consist of anything that follows // on a line.

+

a = b; // This is a C++ comment

+

To use this feature, disable the ANSI Strict setting.

+

See also Checking for Standard C and Standard C++ Conformity. +

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_d_constant_suffix.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_d_constant_suffix.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_d_constant_suffix.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,19 +1,19 @@ - - - - - -The “D” Constant Suffix - - - -

The “D” Constant Suffix

-

When the compiler finds a “D” immediately after a floating point constant value, it treats that value as data of type double.

-

When the pragma float_constants is enabled, floating point constants should end with a “D” so that the compiler does not treat them as values of type float.

-

For related information, see “float_constants”. -

- - - - - + + + + + +The “D” Constant Suffix + + + +

The “D” Constant Suffix

+

When the compiler finds a “D” immediately after a floating point constant value, it treats that value as data of type double.

+

When the pragma float_constants is enabled, floating point constants should end with a “D” so that the compiler does not treat them as values of type float.

+

For related information, see “float_constants”. +

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_declare_var_addr.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_declare_var_addr.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_declare_var_addr.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,19 +1,19 @@ - - - - - -Declaring Variables by Address - - - -

Declaring Variables by Address

-

(ISO C, §6.7.8) The C compiler lets you explicitly specify the address that contains the value of a variable. For example, this definition states that the variable MemErr contains the contents of the address 0x220:

-

short MemErr:0x220;

-

You cannot disable this extension, and it has no corresponding pragma or setting in a panel.
-

- - - - - + + + + + +Declaring Variables by Address + + + +

Declaring Variables by Address

+

(ISO C, §6.7.8) The C compiler lets you explicitly specify the address that contains the value of a variable. For example, this definition states that the variable MemErr contains the contents of the address 0x220:

+

short MemErr:0x220;

+

You cannot disable this extension, and it has no corresponding pragma or setting in a panel.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_decspec_decl.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_decspec_decl.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_decspec_decl.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,25 +1,25 @@ - - - - - -The __declspec Declarator - - - -

The __declspec Declarator

-

The __declspec(arg) declarator is a convention adopted from Win32 compilers to extend the type system. All Carbide compilers recognize this declarator.

-

The __declspec declarator must appear before the name of the object as shown below:

-

__declspec(arg) int foo();
- class __declspec(arg) bar { ... };

-

The list of valid arguments are grouped by targets:

- - - - - - + + + + + +The __declspec Declarator + + + +

The __declspec Declarator

+

The __declspec(arg) declarator is a convention adopted from Win32 compilers to extend the type system. All Carbide compilers recognize this declarator.

+

The __declspec declarator must appear before the name of the object as shown below:

+

__declspec(arg) int foo();
+ class __declspec(arg) bar { ... };

+

The list of valid arguments are grouped by targets:

+ + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_endif_identifier.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_endif_identifier.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_endif_identifier.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,34 +1,34 @@ - - - - - -Using an Identifier After #endif - - - -

Using an Identifier After #endif

-

(ISO C, §6.10.1) The C compiler can accept identifier tokens after #endif and #else. This extension helps you match an #endif statement with its corresponding #if, #ifdef, or #ifndef statement, as shown here:

-

#ifdef __MWERKS__
- # ifndef __cplusplus
- /*
- * . . .
- */
- # endif __cplusplus
-#endif __MWERKS__

-

To use this feature, disable the ANSI Strict setting.

-

TIP If you enable the ANSI Strict setting (thereby disabling this extension), you can still match your #ifdef and #endif directives. Simply put the identifiers into comments, as sown in following example:
-
- #ifdef __MWERKS__
- # ifndef __cplusplus
- /*
- * . . .
- */
- # endif /* __cplusplus */
-#endif /* __MWERKS__ */

-

See also Checking for Standard C and Standard C++ Conformity.

- - - - - + + + + + +Using an Identifier After #endif + + + +

Using an Identifier After #endif

+

(ISO C, §6.10.1) The C compiler can accept identifier tokens after #endif and #else. This extension helps you match an #endif statement with its corresponding #if, #ifdef, or #ifndef statement, as shown here:

+

#ifdef __MWERKS__
+ # ifndef __cplusplus
+ /*
+ * . . .
+ */
+ # endif __cplusplus
+#endif __MWERKS__

+

To use this feature, disable the ANSI Strict setting.

+

TIP If you enable the ANSI Strict setting (thereby disabling this extension), you can still match your #ifdef and #endif directives. Simply put the identifiers into comments, as sown in following example:
+
+ #ifdef __MWERKS__
+ # ifndef __cplusplus
+ /*
+ * . . .
+ */
+ # endif /* __cplusplus */
+#endif /* __MWERKS__ */

+

See also Checking for Standard C and Standard C++ Conformity.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_enum_types.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_enum_types.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_enum_types.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,63 +1,63 @@ - - - - - -Enumerated Types - - - -

Enumerated Types

-

(ISO C, §6.2.5) The Carbide C compiler uses the Enums Always Int and ANSI Strict settings to choose which underlying integer type to use for an enumerated type.

-

If you enable the Enums Always Int setting, the underlying type for enumerated data types is set to signed int. Enumerators cannot be larger than a signed int. If an enumerated constant is larger than an int, the compiler generates an error.

-

If you disable the ANSI Strict setting, enumerators that can be represented as an unsigned int are implicitly converted to signed int.

-
-
Listing 2.2 Example of Enumerations as Signed Integers
-

#pragma enumsalwaysint on
- #pragma ANSI_strict on
- enum foo { a=0xFFFFFFFF }; // ERROR. a is 4,294,967,295:
- // too big for a signed int
- #pragma ANSI_strict off
- enum bar { b=0xFFFFFFFF }; // OK: b can be represented as an
- // unsigned int, but is implicitly
- // converted to a signed int (-1).

-
-

If you disable the Enums Always Int setting, the compiler chooses the integral data type that supports the largest enumerated constant. The type can be as small as a char or as large as a long int. It can even be a 64-bit long long value.

-

If all enumerators are positive, the compiler chooses the smallest unsigned integral base type that is large enough to represent all enumerators. If at least one enumerator is negative, the compiler chooses the smallest signed integral base type large enough to represent all enumerators.

-
-
Listing 2.3 Example of Enumeration Base Types
-

#pragma enumsalwaysint off
- enum { a=0,b=1 }; // base type: unsigned char
- enum { c=0,d=-1 }; // base type: signed char
- enum { e=0,f=128,g=-1 }; // base type: signed short

-
-

The compiler uses long long data types only if you disable Enums Always Int and enable the longlong_enums pragma. (None of the settings corresponds to the longlong_enums pragma.)

-
-
Listing 2.4 Example of Enumerations with Type long long
-

#pragma enumsalwaysint off
- #pragma longlong_enums off
- enum { a=0x7FFFFFFFFFFFFFFF }; // ERROR: a is too large
- #pragma longlong_enums on
- enum { b=0x7FFFFFFFFFFFFFFF }; // OK: base type: signed long long
- enum { c=0x8000000000000000 }; // OK: base type: unsigned long long
- enum {þd=-1,e=0x80000000 }; // OK: base type: signed long long

-
-

When you disable the longlong_enums pragma and enable ANSI Strict, you cannot mix unsigned 32-bit enumerators greater than 0x7FFFFFFF and negative enumerators. If you disable both the longlong_enums pragma and the ANSI Strict setting, large unsigned 32-bit enumerators are implicitly converted to signed 32-bit types.

-
-
Listing 2.5 Example of Enumerations with Type long
-

#pragma enumsalwaysint off
- #pragma longlong_enums off
- #pragma ANSI_strict on
- enum { a=-1,b=0xFFFFFFFF }; // error
- #pragma ANSI_strict off
- enum { c=-1,d=0xFFFFFFFF }; // base type: signed int (b==-1)

-
-

The Enums Always Int setting corresponds to the pragma enumsalwaysint. To check this setting, use __option (enumsalwaysint).

-

By default, this setting is disabled.

-

See also “enumsalwaysint”, “longlong_enums”, and Checking Settings.
-

- - - - - + + + + + +Enumerated Types + + + +

Enumerated Types

+

(ISO C, §6.2.5) The Carbide C compiler uses the Enums Always Int and ANSI Strict settings to choose which underlying integer type to use for an enumerated type.

+

If you enable the Enums Always Int setting, the underlying type for enumerated data types is set to signed int. Enumerators cannot be larger than a signed int. If an enumerated constant is larger than an int, the compiler generates an error.

+

If you disable the ANSI Strict setting, enumerators that can be represented as an unsigned int are implicitly converted to signed int.

+
+
Listing 2.2 Example of Enumerations as Signed Integers
+

#pragma enumsalwaysint on
+ #pragma ANSI_strict on
+ enum foo { a=0xFFFFFFFF }; // ERROR. a is 4,294,967,295:
+ // too big for a signed int
+ #pragma ANSI_strict off
+ enum bar { b=0xFFFFFFFF }; // OK: b can be represented as an
+ // unsigned int, but is implicitly
+ // converted to a signed int (-1).

+
+

If you disable the Enums Always Int setting, the compiler chooses the integral data type that supports the largest enumerated constant. The type can be as small as a char or as large as a long int. It can even be a 64-bit long long value.

+

If all enumerators are positive, the compiler chooses the smallest unsigned integral base type that is large enough to represent all enumerators. If at least one enumerator is negative, the compiler chooses the smallest signed integral base type large enough to represent all enumerators.

+
+
Listing 2.3 Example of Enumeration Base Types
+

#pragma enumsalwaysint off
+ enum { a=0,b=1 }; // base type: unsigned char
+ enum { c=0,d=-1 }; // base type: signed char
+ enum { e=0,f=128,g=-1 }; // base type: signed short

+
+

The compiler uses long long data types only if you disable Enums Always Int and enable the longlong_enums pragma. (None of the settings corresponds to the longlong_enums pragma.)

+
+
Listing 2.4 Example of Enumerations with Type long long
+

#pragma enumsalwaysint off
+ #pragma longlong_enums off
+ enum { a=0x7FFFFFFFFFFFFFFF }; // ERROR: a is too large
+ #pragma longlong_enums on
+ enum { b=0x7FFFFFFFFFFFFFFF }; // OK: base type: signed long long
+ enum { c=0x8000000000000000 }; // OK: base type: unsigned long long
+ enum {þd=-1,e=0x80000000 }; // OK: base type: signed long long

+
+

When you disable the longlong_enums pragma and enable ANSI Strict, you cannot mix unsigned 32-bit enumerators greater than 0x7FFFFFFF and negative enumerators. If you disable both the longlong_enums pragma and the ANSI Strict setting, large unsigned 32-bit enumerators are implicitly converted to signed 32-bit types.

+
+
Listing 2.5 Example of Enumerations with Type long
+

#pragma enumsalwaysint off
+ #pragma longlong_enums off
+ #pragma ANSI_strict on
+ enum { a=-1,b=0xFFFFFFFF }; // error
+ #pragma ANSI_strict off
+ enum { c=-1,d=0xFFFFFFFF }; // base type: signed int (b==-1)

+
+

The Enums Always Int setting corresponds to the pragma enumsalwaysint. To check this setting, use __option (enumsalwaysint).

+

By default, this setting is disabled.

+

See also “enumsalwaysint”, “longlong_enums”, and Checking Settings.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_expand_trigraphs.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_expand_trigraphs.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_expand_trigraphs.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,22 +1,22 @@ - - - - - -Expand Trigraphs - - - -

Expand Trigraphs

-

(ISO C, §5.2.1.1) The C compiler normally ignores trigraph characters. Many common character constants look like trigraph sequences, and this extension lets you use them without including escape characters.

-

If you must write source code that strictly adheres to the ISO standard, enable the Expand Trigraphs setting. When you enable this setting, be careful when initializing strings or multi-character constants that contain question marks.

-

char c = '????'; // ERROR: Trigraph sequence expands to '??^
- char d = '\?\?\?\?'; // OK

-

The Expand Trigraphs setting corresponds to the pragma trigraphs, To check this setting, use __option (trigraphs). By default, this setting is disabled.

-

See also “trigraphs” and Checking Settings. -

- - - - - + + + + + +Expand Trigraphs + + + +

Expand Trigraphs

+

(ISO C, §5.2.1.1) The C compiler normally ignores trigraph characters. Many common character constants look like trigraph sequences, and this extension lets you use them without including escape characters.

+

If you must write source code that strictly adheres to the ISO standard, enable the Expand Trigraphs setting. When you enable this setting, be careful when initializing strings or multi-character constants that contain question marks.

+

char c = '????'; // ERROR: Trigraph sequence expands to '??^
+ char d = '\?\?\?\?'; // OK

+

The Expand Trigraphs setting corresponds to the pragma trigraphs, To check this setting, use __option (trigraphs). By default, this setting is disabled.

+

See also “trigraphs” and Checking Settings. +

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_function_identifier.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_function_identifier.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_function_identifier.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,17 +1,17 @@ - - - - - -The __FUNCTION__ Predefined Identifier - - - -

The __FUNCTION__ Predefined Identifier

-

The __FUNCTION__ predefined identifier contains the name of the function currently being compiled. For related information, see “Predefined Symbols”. -

- - - - - + + + + + +The __FUNCTION__ Predefined Identifier + + + +

The __FUNCTION__ Predefined Identifier

+

The __FUNCTION__ predefined identifier contains the name of the function currently being compiled. For related information, see “Predefined Symbols”. +

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_gcc_ext_support.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_gcc_ext_support.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_gcc_ext_support.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,137 +1,137 @@ - - - - - -GCC Extension Support - - - -

GCC Extension Support

-

Use the GCC Extensions setting to enable the compiler to accept some GCC syntax and conventions. This option is the same as the previously-supported #pragma gcc_extensions.

-

The following GCC compatibility enhancements have been added:

- -
-

({int a; a=myfunc(); a; })

-
- -
-

int count_leading_zero(int value)
- {
- asm ( "cntlzw %0, %1" : "=r" (bits) : "r" (value) );
- return bits;
- }

-
- -
-

#define DEBUG(fmt,args...) printf(fmt, ## args)
- DEBUG("test");
- DEBUG("saw %d copies\n", n_copies);
-• The abbreviated “?:” operator is allowed
- x = y ?: z; // --> x = y ? y : z;

-
- -
-

struct Incomplete arr[10];

-
- -
-

class MyClass {
- ...
- int MyClass::getval();
- ...
- };

-
- -
-

struct empty { } x;

-
- -
-

struct empty { } x = {};

-
- -
-

typedef struct { int x, y, z; float q; } mystruct;
- void foo(mystruct s);
- foo( (mystruct) { 1,2,3,6e3 } );

-
- -
-

void *p;
- p = &data + 10; // point 10 bytes into "p"
- void foo();
- p = foo + 10; // point 10 bytes into "foo"
- At this time, the increment and decrement operators “++” don’t work with void/function pointers.

-
- -
-

switch(x) {
- label:
- }

-
- -
-

#define MAC 3
- #define MAC (3)

-
- -
-

int a[10], b[10];
- a = b;

-
- -
-

enum { A, B, C, };

-
- -
-

typedef struct {
- int type;
- char data[];
- } Node;

-
- -
-

struct { int x, y, z; float q; } x = { q: 3.0,
- y:1, z:-4, x:-6 };

-
-

For related information, see the #pragma gcc_extensions.

- - - - - + + + + + +GCC Extension Support + + + +

GCC Extension Support

+

Use the GCC Extensions setting to enable the compiler to accept some GCC syntax and conventions. This option is the same as the previously-supported #pragma gcc_extensions.

+

The following GCC compatibility enhancements have been added:

+ +
+

({int a; a=myfunc(); a; })

+
+ +
+

int count_leading_zero(int value)
+ {
+ asm ( "cntlzw %0, %1" : "=r" (bits) : "r" (value) );
+ return bits;
+ }

+
+ +
+

#define DEBUG(fmt,args...) printf(fmt, ## args)
+ DEBUG("test");
+ DEBUG("saw %d copies\n", n_copies);
+• The abbreviated “?:” operator is allowed
+ x = y ?: z; // --> x = y ? y : z;

+
+ +
+

struct Incomplete arr[10];

+
+ +
+

class MyClass {
+ ...
+ int MyClass::getval();
+ ...
+ };

+
+ +
+

struct empty { } x;

+
+ +
+

struct empty { } x = {};

+
+ +
+

typedef struct { int x, y, z; float q; } mystruct;
+ void foo(mystruct s);
+ foo( (mystruct) { 1,2,3,6e3 } );

+
+ +
+

void *p;
+ p = &data + 10; // point 10 bytes into "p"
+ void foo();
+ p = foo + 10; // point 10 bytes into "foo"
+ At this time, the increment and decrement operators “++” don’t work with void/function pointers.

+
+ +
+

switch(x) {
+ label:
+ }

+
+ +
+

#define MAC 3
+ #define MAC (3)

+
+ +
+

int a[10], b[10];
+ a = b;

+
+ +
+

enum { A, B, C, };

+
+ +
+

typedef struct {
+ int type;
+ char data[];
+ } Node;

+
+ +
+

struct { int x, y, z; float q; } x = { q: 3.0,
+ y:1, z:-4, x:-6 };

+
+

For related information, see the #pragma gcc_extensions.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_get_alignment_info.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_get_alignment_info.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_get_alignment_info.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,21 +1,21 @@ - - - - - -Getting Alignment and Type Information at Compile Time - - - -

Getting Alignment and Type Information at Compile Time

-

The C compiler has two built-in functions that return information about a data type’s byte alignment and its data type.

- - - - - - + + + + + +Getting Alignment and Type Information at Compile Time + + + +

Getting Alignment and Type Information at Compile Time

+

The C compiler has two built-in functions that return information about a data type’s byte alignment and its data type.

+ + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_header_files.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_header_files.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_header_files.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,36 +1,36 @@ - - - - - -Precompiled Header Files - - - -

Header Files

-

(ISO C, §6.10.2) The Carbide C preprocessor lets you nest up to 256 levels of #include directives.

-

You can use full path names in #include directives:

- - - - - - - - - - - - - - -
SystemDirective
Windows#include "c:\HD\Tools\my headers\macros.h"
UNIX#include "/HD/Tools/my headers/macros.h"
-

The Carbide IDE lets you specify where the compiler looks for #include files through the Access Paths and Source Tree settings panels.

-

See also Prefix Files.

-

TIP If you are running the Carbide C compiler from the command line, you can specify where to find #include files with a command-line setting. For more information, see “Command-Line Tools”.
-

- - - - - + + + + + +Precompiled Header Files + + + +

Header Files

+

(ISO C, §6.10.2) The Carbide C preprocessor lets you nest up to 256 levels of #include directives.

+

You can use full path names in #include directives:

+ + + + + + + + + + + + + + +
SystemDirective
Windows#include "c:\HD\Tools\my headers\macros.h"
UNIX#include "/HD/Tools/my headers/macros.h"
+

The Carbide IDE lets you specify where the compiler looks for #include files through the Access Paths and Source Tree settings panels.

+

See also Prefix Files.

+

TIP If you are running the Carbide C compiler from the command line, you can specify where to find #include files with a command-line setting. For more information, see “Command-Line Tools”.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_implementation.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_implementation.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_implementation.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,25 +1,25 @@ - - - - - -C Compiler - - - -

The Carbide Implementation of C

-

This section describes how the Carbide C compiler implements the C programming language:

- - - - - - + + + + + +C Compiler + + + +

The Carbide Implementation of C

+

This section describes how the Carbide C compiler implements the C programming language:

+ + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_indentifiers.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_indentifiers.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_indentifiers.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,16 +1,16 @@ - - - - - -Identifiers - - - -

Identifiers

-

(ISO C, §6.4.2) The Carbide C language allows identifiers to have unlimited length. However, only the first 255 characters are significant for internal and external linkage.

- - - - - + + + + + +Identifiers + + + +

Identifiers

+

(ISO C, §6.4.2) The Carbide C language allows identifiers to have unlimited length. However, only the first 255 characters are significant for internal and external linkage.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_init_local_arrays.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_init_local_arrays.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_init_local_arrays.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,25 +1,25 @@ - - - - - -Initialization of Local Arrays and Structures - - - -

Initialization of Local Arrays and Structures

-

If you enable the pragma gcc_extensions, the compiler allows the initialization of local arrays and structs with non-constant values.
-

-
-
GNU C Extension for Initializing Arrays and Structures
-

void myFunc( int i, double x )
- {
- int arr[2] = { i, i + 1 };
- struct myStruct = { i, x };
- }

-
- - - - - + + + + + +Initialization of Local Arrays and Structures + + + +

Initialization of Local Arrays and Structures

+

If you enable the pragma gcc_extensions, the compiler allows the initialization of local arrays and structs with non-constant values.
+

+
+
GNU C Extension for Initializing Arrays and Structures
+

void myFunc( int i, double x )
+ {
+ int arr[2] = { i, i + 1 };
+ struct myStruct = { i, x };
+ }

+
+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_inlining.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_inlining.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_inlining.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,62 +1,62 @@ - - - - - -Inlining - - - -

Inlining

-

Carbide supports inlining C/C++ functions that you define with the inline, __inline__, or __inline specifier keywords.

-

The following functions are never inlined:

- -

The compiler determines whether to inline a function based on the ANSI Strict, Inline Depth, Auto-inline, and Deferred Inlining settings.

-

TIP When you call an inlined function, the compiler inserts the actual instructions of that function rather than a call to that function. Inlining functions makes your programs faster because you execute the function code immediately without the overhead of a function call and return. However, it can also make your program larger because the compiler may have to repeat the function code multiple times throughout your program.

-

If you disable the ANSI Keywords Only setting, you can declare C functions to be inline.

-
Table 1: Settings for the Inline Depth
- - - - - - - - - - - - - - - - - -
This settingDoes this…
Don’t InlineInlines no functions, not even C or C++ functions declared inline.
SmartInlines small functions to a depth of 2 to 4 inline functions deep.
1 to 8Inlines to the depth specified by the numerical selection.
-

The Smart and 1 to 8 items in the Inline Depth dropdown menu correspond to the pragma inline_depth (inline_depth). To check this setting, use __option(inline_depth), described at Checking Settings.

-

The Don’t Inline item corresponds to the pragma dont_inline. To check this setting, use __option (dont_inline). By default, this setting is disabled.

-

The Auto-Inline setting lets the compiler choose which functions to inline. Also inlines C++ functions declared inline and member functions defined within a class declaration. This setting corresponds to the pragma auto_inline. To check this setting, use __option (auto_inline). By default, this setting is disabled.

-

The Deferred Inlining setting tells the compiler to inline functions that are not yet defined. This setting corresponds to the pragma defer_codegen. To check this setting, use __option (defer_codegen).

-

The Bottom-up Inlining settings tells the compiler to inline functions starting at the last function to the first function in a chain of function calls. This setting corresponds to the pragma inline_bottom_up. To check this setting, use __option (inline_bottom_up).

-

You can also disable automatic inlining of specific functions within a source file using the __attribute__((never_inline)).

-
-
Example __attribute__(never_inline)
-

inline int f() __attribute__((never_inline))
- {
- return 10;
- }

-

int main()
- {
- return f(); // f() is never inlined
- }

-
-

NOTE For Intel x86 targets, the __decspec(noinline) is a compatible synonym.

- - - - - + + + + + +Inlining + + + +

Inlining

+

Carbide supports inlining C/C++ functions that you define with the inline, __inline__, or __inline specifier keywords.

+

The following functions are never inlined:

+ +

The compiler determines whether to inline a function based on the ANSI Strict, Inline Depth, Auto-inline, and Deferred Inlining settings.

+

TIP When you call an inlined function, the compiler inserts the actual instructions of that function rather than a call to that function. Inlining functions makes your programs faster because you execute the function code immediately without the overhead of a function call and return. However, it can also make your program larger because the compiler may have to repeat the function code multiple times throughout your program.

+

If you disable the ANSI Keywords Only setting, you can declare C functions to be inline.

+
Table 1: Settings for the Inline Depth
+ + + + + + + + + + + + + + + + + +
This settingDoes this…
Don’t InlineInlines no functions, not even C or C++ functions declared inline.
SmartInlines small functions to a depth of 2 to 4 inline functions deep.
1 to 8Inlines to the depth specified by the numerical selection.
+

The Smart and 1 to 8 items in the Inline Depth dropdown menu correspond to the pragma inline_depth (inline_depth). To check this setting, use __option(inline_depth), described at Checking Settings.

+

The Don’t Inline item corresponds to the pragma dont_inline. To check this setting, use __option (dont_inline). By default, this setting is disabled.

+

The Auto-Inline setting lets the compiler choose which functions to inline. Also inlines C++ functions declared inline and member functions defined within a class declaration. This setting corresponds to the pragma auto_inline. To check this setting, use __option (auto_inline). By default, this setting is disabled.

+

The Deferred Inlining setting tells the compiler to inline functions that are not yet defined. This setting corresponds to the pragma defer_codegen. To check this setting, use __option (defer_codegen).

+

The Bottom-up Inlining settings tells the compiler to inline functions starting at the last function to the first function in a chain of function calls. This setting corresponds to the pragma inline_bottom_up. To check this setting, use __option (inline_bottom_up).

+

You can also disable automatic inlining of specific functions within a source file using the __attribute__((never_inline)).

+
+
Example __attribute__(never_inline)
+

inline int f() __attribute__((never_inline))
+ {
+ return 10;
+ }

+

int main()
+ {
+ return f(); // f() is never inlined
+ }

+
+

NOTE For Intel x86 targets, the __decspec(noinline) is a compatible synonym.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_iso_extensions.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_iso_extensions.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_iso_extensions.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,49 +1,49 @@ - - - - - -Extensions to ISO C - - - -

Extensions to ISO C

-

The Carbide C language optionally extends ISO C. In most cases, you can control these extensions using specific pragmas.

- -

For information on target-specific extensions, refer to the Targeting manual for your particular target.

- - - - - + + + + + +Extensions to ISO C + + + +

Extensions to ISO C

+

The Carbide C language optionally extends ISO C. In most cases, you can control these extensions using specific pragmas.

+ +

For information on target-specific extensions, refer to the Targeting manual for your particular target.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_macro_args.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_macro_args.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_macro_args.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,25 +1,25 @@ - - - - - -A # Not Followed by a Macro Argument - - - -

A # Not Followed by a Macro Argument

-

(ISO C, §6.10.3) The C compiler can accept # tokens that do not appear before arguments in macro definitions.

-
-
Listing 1. Preprocessor Macros Using # Without an Argument
-

#define add1(x) #x #1 // OK, but probably not what you wanted:
- // add1(abc) creates "abc"#1
- #define add2(x) #x "2" // OK: add2(abc) creates "abc2"

-
-

To use this feature, disable the ANSI Strict setting.

-

See also “Checking for Standard C and Standard C++ Conformity”.
-

- - - - - + + + + + +A # Not Followed by a Macro Argument + + + +

A # Not Followed by a Macro Argument

+

(ISO C, §6.10.3) The C compiler can accept # tokens that do not appear before arguments in macro definitions.

+
+
Listing 1. Preprocessor Macros Using # Without an Argument
+

#define add1(x) #x #1 // OK, but probably not what you wanted:
+ // add1(abc) creates "abc"#1
+ #define add2(x) #x "2" // OK: add2(abc) creates "abc2"

+
+

To use this feature, disable the ANSI Strict setting.

+

See also “Checking for Standard C and Standard C++ Conformity”.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_map_newlines.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_map_newlines.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_map_newlines.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,23 +1,23 @@ - - - - - -Map Newlines to CR - - - -

Map Newlines to CR

-

Use the #pragma mpwc_newline to set how the C compiler interprets the newline ('\n') and return ('\r') characters.

-

Most compilers, including the Carbide C/C++ compilers, translate '\r' to 0x0D, the standard value for carriage return, and '\n' to 0x0A, the standard value for linefeed.

-

However, a few C compilers translate '\r' to 0x0A and '\n' to 0x0D—the opposite of the typical behavior.

-

If you enable this setting, the compiler uses these non-standard conventions for the '\n' and '\r' characters. Otherwise, the compiler uses the Carbide C/C++ language’s conventions for these characters.

-

Also if you enable this setting, use ISO C/C++ libraries that were compiled when this setting was enabled. Otherwise, you cannot read and write '\n' and '\r' properly. For example, printing '\n' takes you to the beginning of the current line instead of inserting a new line.

-

This setting corresponds to the pragma mpwc_newline. To check this setting, use __option (mpwc_newline). By default, this setting is disabled.

-

See also “mpwc_newline”, and Checking Settings.
-

- - - - - + + + + + +Map Newlines to CR + + + +

Map Newlines to CR

+

Use the #pragma mpwc_newline to set how the C compiler interprets the newline ('\n') and return ('\r') characters.

+

Most compilers, including the Carbide C/C++ compilers, translate '\r' to 0x0D, the standard value for carriage return, and '\n' to 0x0A, the standard value for linefeed.

+

However, a few C compilers translate '\r' to 0x0A and '\n' to 0x0D—the opposite of the typical behavior.

+

If you enable this setting, the compiler uses these non-standard conventions for the '\n' and '\r' characters. Otherwise, the compiler uses the Carbide C/C++ language’s conventions for these characters.

+

Also if you enable this setting, use ISO C/C++ libraries that were compiled when this setting was enabled. Otherwise, you cannot read and write '\n' and '\r' properly. For example, printing '\n' takes you to the beginning of the current line instead of inserting a new line.

+

This setting corresponds to the pragma mpwc_newline. To check this setting, use __option (mpwc_newline). By default, this setting is disabled.

+

See also “mpwc_newline”, and Checking Settings.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_multibyte_support.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_multibyte_support.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_multibyte_support.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,73 +1,73 @@ - - - - - -Multibyte and Unicode Support - - - -

Multibyte and Unicode Support

-

The Carbide preprocessor fully supports the use of multibyte and Unicode-formatted source files.

-

Source and header files may be encoded in any text encoding the operating system recognizes. (Unicode text decoding support is implemented using native OS services in Win32 and conv() on UNIX systems.)

-

As per ISO C++98 and C99, universal characters may be used in any string or character literal, identifiers (macros, variables, functions, methods, etc.), and comments. These characters are derived either from multibyte sequences in the source text, by virtue of the source file being encoded in UCS-2 or UCS-4, or by use of the \uXXXX or \UXXXXXXXX escape sequences.

-

Wide String Literals

-

Wide string literals in the form L"xxx" and wide characters in the form L’xxx’ are interpreted in the context of the source text encoding.

-

const wchar_t *str = L"Meine Katze ißt Mäuse nachts.";

-

Multibyte character sequences that appear in strings are internally converted to their Unicode equivalents until the C/C++ token for the string is generated. At that time, if the string literal is a narrow string (i.e. using char), the original multibyte character sequence are emitted. If the string is a wide string (using wchar_t), the Unicode characters translated from the multibyte sequence are emitted. If wchar_t is 16 bits and a character is truncated to 16 bits, a warning is reported. (See ISO C99, §6.4.5.5 for the specification of this behavior.)

-

In the event that you want translated – and usually truncated – Unicode characters in narrow string literals, enable #pragma multibyteaware_preserve_ literals off.

-

Source Encoding

-

The compiler uses the Source encoding option in to control how it detects the source file encoding. The compiler recognizes the following source encoding options:

- -

NOTE Currently, the compiler ignores the mapping in some Japanese character sets of 0x5c (ASCII ‘\’) to Yen (\u00A5) because the C++98 and C99 standards say that the ASCII character set must be mapped one-to-one with any multibyte encoding. 0x5C is always interpreted as ‘\’ (except inside multibyte character sequences).

-

NOTE The ISO-2022-JP and EUC-JP encoding currently only recognize characters defined by JIS X 0208-1990 (i.e., the escapes ESC $ @, ESC $ B for ISO-2022-JP and two-byte sequences in EUC-JP). The additional characters in JIS X 0212-1990 are not yet recognized.

-

No matter what the Source encoding setting, the compiler always detects UTF-16{BE,LE} or UCS-4{BE,LE} source through a statistical character scan for NULs.

-

NOTE Currently, only the command-line tools, not the IDE, can properly handle sources in Unicode format (UTF-16, UCS-2, UCS-4).

-

Alternately, individual source files can identify which source text encoding is present using #pragma text_encoding. The format is:
- #pragma text_encoding("name" | unknown | reset [, global])

-

Where name is an IANA or MIME encoding name or an OS-specific string.

-

The compiler recognizes these names and maps them to its internal decoders:

-

system US-ASCII ASCII ANSI_X3.4-1968 ANSI_X3.4-1968
- ANSI_X3.4 UTF-8 UTF8 ISO-2022-JP CSISO2022JP ISO2022JP
- CSSHIFTJIS SHIFT-JIS SJIS EUC-JP EUCJP
- UCS-2 UCS-2BE UCS-2LE UCS2 UCS2BE UCS2LE UTF-16 U
- TF-16BE UTF-16LE UTF16 UTF16BE UTF16LE UCS-4 UCS-4BE
- UCS-4LE UCS4 UCS4BE UCS4LE 10646-1:1993 ISO-10646-1
- ISO-10646 unicode

-

NOTE UCS-2 is always interpreted as UTF-16; i.e. surrogate character pairs are used to select characters through plane 16.

-

This #pragma may be used several times in one file (probably unlikely usage). The compiler expects the pragma to be encoded in the “current” text encoding, through the end of line.

-

By default, #pragma text_encoding is only effective through the end of file. To affect the default text encoding assumed for the current and all subsequent files, supply the “global” modifier.
-

-

Other Support

-

In addition, note the following:

- -
-

wchar_t florette = L’\u273f’;
- int \u30AD\u30B3\u30DE\u30A6 = soy_sauce();

-
- -
-

extern string *Wörter[];
- -->
- extern string *W\u00F6rter[];

-
- -

Also see “Character Constants as Integer Values” for information on creating a character constant consisting of more than one character (not to be confused with this topic).

-

For more information on Unicode, see www.unicode.org.

- - - - - + + + + + +Multibyte and Unicode Support + + + +

Multibyte and Unicode Support

+

The Carbide preprocessor fully supports the use of multibyte and Unicode-formatted source files.

+

Source and header files may be encoded in any text encoding the operating system recognizes. (Unicode text decoding support is implemented using native OS services in Win32 and conv() on UNIX systems.)

+

As per ISO C++98 and C99, universal characters may be used in any string or character literal, identifiers (macros, variables, functions, methods, etc.), and comments. These characters are derived either from multibyte sequences in the source text, by virtue of the source file being encoded in UCS-2 or UCS-4, or by use of the \uXXXX or \UXXXXXXXX escape sequences.

+

Wide String Literals

+

Wide string literals in the form L"xxx" and wide characters in the form L’xxx’ are interpreted in the context of the source text encoding.

+

const wchar_t *str = L"Meine Katze ißt Mäuse nachts.";

+

Multibyte character sequences that appear in strings are internally converted to their Unicode equivalents until the C/C++ token for the string is generated. At that time, if the string literal is a narrow string (i.e. using char), the original multibyte character sequence are emitted. If the string is a wide string (using wchar_t), the Unicode characters translated from the multibyte sequence are emitted. If wchar_t is 16 bits and a character is truncated to 16 bits, a warning is reported. (See ISO C99, §6.4.5.5 for the specification of this behavior.)

+

In the event that you want translated – and usually truncated – Unicode characters in narrow string literals, enable #pragma multibyteaware_preserve_ literals off.

+

Source Encoding

+

The compiler uses the Source encoding option in to control how it detects the source file encoding. The compiler recognizes the following source encoding options:

+ +

NOTE Currently, the compiler ignores the mapping in some Japanese character sets of 0x5c (ASCII ‘\’) to Yen (\u00A5) because the C++98 and C99 standards say that the ASCII character set must be mapped one-to-one with any multibyte encoding. 0x5C is always interpreted as ‘\’ (except inside multibyte character sequences).

+

NOTE The ISO-2022-JP and EUC-JP encoding currently only recognize characters defined by JIS X 0208-1990 (i.e., the escapes ESC $ @, ESC $ B for ISO-2022-JP and two-byte sequences in EUC-JP). The additional characters in JIS X 0212-1990 are not yet recognized.

+

No matter what the Source encoding setting, the compiler always detects UTF-16{BE,LE} or UCS-4{BE,LE} source through a statistical character scan for NULs.

+

NOTE Currently, only the command-line tools, not the IDE, can properly handle sources in Unicode format (UTF-16, UCS-2, UCS-4).

+

Alternately, individual source files can identify which source text encoding is present using #pragma text_encoding. The format is:
+ #pragma text_encoding("name" | unknown | reset [, global])

+

Where name is an IANA or MIME encoding name or an OS-specific string.

+

The compiler recognizes these names and maps them to its internal decoders:

+

system US-ASCII ASCII ANSI_X3.4-1968 ANSI_X3.4-1968
+ ANSI_X3.4 UTF-8 UTF8 ISO-2022-JP CSISO2022JP ISO2022JP
+ CSSHIFTJIS SHIFT-JIS SJIS EUC-JP EUCJP
+ UCS-2 UCS-2BE UCS-2LE UCS2 UCS2BE UCS2LE UTF-16 U
+ TF-16BE UTF-16LE UTF16 UTF16BE UTF16LE UCS-4 UCS-4BE
+ UCS-4LE UCS4 UCS4BE UCS4LE 10646-1:1993 ISO-10646-1
+ ISO-10646 unicode

+

NOTE UCS-2 is always interpreted as UTF-16; i.e. surrogate character pairs are used to select characters through plane 16.

+

This #pragma may be used several times in one file (probably unlikely usage). The compiler expects the pragma to be encoded in the “current” text encoding, through the end of line.

+

By default, #pragma text_encoding is only effective through the end of file. To affect the default text encoding assumed for the current and all subsequent files, supply the “global” modifier.
+

+

Other Support

+

In addition, note the following:

+ +
+

wchar_t florette = L’\u273f’;
+ int \u30AD\u30B3\u30DE\u30A6 = soy_sauce();

+
+ +
+

extern string *Wörter[];
+ -->
+ extern string *W\u00F6rter[];

+
+ +

Also see “Character Constants as Integer Values” for information on creating a character constant consisting of more than one character (not to be confused with this topic).

+

For more information on Unicode, see www.unicode.org.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_pool_strings.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_pool_strings.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_pool_strings.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - -Pool Strings - - - -

Pool Strings

-

The Pool Strings setting controls how the compiler stores string constants.

-

NOTE In principle, this setting works for all targets. However, it is useful only for a Table of Contents based linking mechanism such as that used for MacOS Classic on the PowerPC processor.

-

If you enable this setting, the compiler collects all string constants into a single data object so that your program needs only one TOC entry for all of them. While this decreases the number of TOC entries in your program, it also increases your program size because it uses a less efficient method to store the address of the string.

-

If you disable this setting, the compiler creates a unique data object and TOC entry for each string constant.

-

TIP You can change the size of the TOC with the Store Static Data in TOC setting in the PPC Processor panel.

-

NOTE This option can be overridden in PPC targets by using the Linker Pool Strings or Linker Merges String Constants options.

-

Enable this setting if your program is large and has many string constants.

-

NOTE If you enable the Pool Strings setting, the compiler ignores the PC-Relative Strings setting. This is a 68K-only feature.

-

The Pool Strings setting corresponds to the pragma pool_strings. To check this setting, use __option (pool_strings). By default, this setting is disabled.

-

See also “pool_strings” and Checking Settings.
-

- - - - - + + + + + +Pool Strings + + + +

Pool Strings

+

The Pool Strings setting controls how the compiler stores string constants.

+

NOTE In principle, this setting works for all targets. However, it is useful only for a Table of Contents based linking mechanism such as that used for MacOS Classic on the PowerPC processor.

+

If you enable this setting, the compiler collects all string constants into a single data object so that your program needs only one TOC entry for all of them. While this decreases the number of TOC entries in your program, it also increases your program size because it uses a less efficient method to store the address of the string.

+

If you disable this setting, the compiler creates a unique data object and TOC entry for each string constant.

+

TIP You can change the size of the TOC with the Store Static Data in TOC setting in the PPC Processor panel.

+

NOTE This option can be overridden in PPC targets by using the Linker Pool Strings or Linker Merges String Constants options.

+

Enable this setting if your program is large and has many string constants.

+

NOTE If you enable the Pool Strings setting, the compiler ignores the PC-Relative Strings setting. This is a 68K-only feature.

+

The Pool Strings setting corresponds to the pragma pool_strings. To check this setting, use __option (pool_strings). By default, this setting is disabled.

+

See also “pool_strings” and Checking Settings.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_pre_header_files.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_pre_header_files.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_pre_header_files.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,25 +1,25 @@ - - - - - -Precompiled Header Files - - - -

Precompiled Header Files

-

A precompiled header is an image of the compiler’s symbol table. Create a precompiled header file for commonly included files. You can also use a precompiled header file to temporarily change header files that do not normally change otherwise (for example, OS ABI headers or standard ANSI library header files). Then replace the original header files with the precompiled header file to significantly improve compile time.

-

A precompiled header cannot do any of the following:

- -

You must include precompiled headers before defining or declaring other objects. You can only use one precompiled header file in a translation unit.

-

See also “precompile_target”.

- - - - - + + + + + +Precompiled Header Files + + + +

Precompiled Header Files

+

A precompiled header is an image of the compiler’s symbol table. Create a precompiled header file for commonly included files. You can also use a precompiled header file to temporarily change header files that do not normally change otherwise (for example, OS ABI headers or standard ANSI library header files). Then replace the original header files with the precompiled header file to significantly improve compile time.

+

A precompiled header cannot do any of the following:

+ +

You must include precompiled headers before defining or declaring other objects. You can only use one precompiled header file in a translation unit.

+

See also “precompile_target”.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_prefix_files.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_prefix_files.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_prefix_files.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,28 +1,28 @@ - - - - - -Prefix Files - - - -

Prefix Files

-

In previous Carbide compilers, the prefix file was a distinct setting that told the compiler to include a source code file at the beginning of each source code file in a project’s build target, or include a precompiled header file into the project.

-

With this compiler release, the concept of prefixing files, #defines, and #pragmas has been extended.

-

To specify a prefix file, add an #include directive to this field, for example:

-

#include "Win32Headers.h"

-

To specify #defines or #pragmas, enter them here as you would in source code:

-

#define DEBUG_BUILD 1
- #pragma warn_illtokenpasting off

-

When building precompiled headers, note the Include prefix text in precompiled headers setting. When enabled, the contents of the Prefix Text are used to generate the precompiled header. If your project generates a precompiled header in the same target that uses it, follow the form:

-

#if !__option(precompile)
- #include "MyHeaders.mch"
- #endif

-

to exclude the *.mch file when generating it.

-

NOTE #pragmas may affect aspects of parsing and type declaration while building a precompiled header, but these settings are not retained in the body of the precompiled header. Thus the prefix text is used for every file in the target.

- - - - - + + + + + +Prefix Files + + + +

Prefix Files

+

In previous Carbide compilers, the prefix file was a distinct setting that told the compiler to include a source code file at the beginning of each source code file in a project’s build target, or include a precompiled header file into the project.

+

With this compiler release, the concept of prefixing files, #defines, and #pragmas has been extended.

+

To specify a prefix file, add an #include directive to this field, for example:

+

#include "Win32Headers.h"

+

To specify #defines or #pragmas, enter them here as you would in source code:

+

#define DEBUG_BUILD 1
+ #pragma warn_illtokenpasting off

+

When building precompiled headers, note the Include prefix text in precompiled headers setting. When enabled, the contents of the Prefix Text are used to generate the precompiled header. If your project generates a precompiled header in the same target that uses it, follow the form:

+

#if !__option(precompile)
+ #include "MyHeaders.mch"
+ #endif

+

to exclude the *.mch file when generating it.

+

NOTE #pragmas may affect aspects of parsing and type declaration while building a precompiled header, but these settings are not retained in the body of the precompiled header. Thus the prefix text is used for every file in the target.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_ranged_cases.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_ranged_cases.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_ranged_cases.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,35 +1,35 @@ - - - - - -Ranges in case statements - - - -

Ranges in case statements

-

If you disable the ANSI Strict setting, the compiler allows ranges of values in a switch statement by using a special form of case statement. A case statement that uses a range is a shorter way of specifying consecutive case statements that span a range of values.

-

The range form of a case statement is

-

case low ... high : // note spaces around ellipsis character

-

where low is a valid case expression that is less than high, which is also a valid case expression. A case statement that uses a range is applied when the expression of a switch statement is both greater than or equal to the low expression and less than or equal to the high expression.

-

NOTE Make sure to separate the ellipsis (...) from the low and high expressions with spaces.

-
-
Listing 1. Ranges in case Statements
-

switch (i)
- {
- case 0 ... 2: /* Equivalent to case 0: case 1: case 2: */
- j = i * 2;
- break;
- case 3:
- j = i;
- break;
- default:
- j = 0;
- break;
- }

-
- - - - - + + + + + +Ranges in case statements + + + +

Ranges in case statements

+

If you disable the ANSI Strict setting, the compiler allows ranges of values in a switch statement by using a special form of case statement. A case statement that uses a range is a shorter way of specifying consecutive case statements that span a range of values.

+

The range form of a case statement is

+

case low ... high : // note spaces around ellipsis character

+

where low is a valid case expression that is less than high, which is also a valid case expression. A case statement that uses a range is applied when the expression of a switch statement is both greater than or equal to the low expression and less than or equal to the high expression.

+

NOTE Make sure to separate the ellipsis (...) from the low and high expressions with spaces.

+
+
Listing 1. Ranges in case Statements
+

switch (i)
+ {
+ case 0 ... 2: /* Equivalent to case 0: case 1: case 2: */
+ j = i * 2;
+ break;
+ case 3:
+ j = i;
+ break;
+ default:
+ j = 0;
+ break;
+ }

+
+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_relaxed_ptrs.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_relaxed_ptrs.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_relaxed_ptrs.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,20 +1,20 @@ - - - - - -Relaxed Pointer Type Rules - - - -

Relaxed Pointer Type Rules

-

Use the #pragma mpwc_relax to tell the compiler to treat all pointer types as the same type. While the compiler verifies the parameters of function prototypes for compatible pointer types, it allows direct pointer assignments.

-

Use this setting if you are using code written before the ISO C standard. Old source code frequently uses these types interchangeably.

-

This setting has no effect on C++. When compiling C++ source code, the compiler differentiates char* and unsigned char* data types even if the relaxed pointer setting is enabled.

-

See also “mpwc_relax”, and Checking Settings.
-

- - - - - + + + + + +Relaxed Pointer Type Rules + + + +

Relaxed Pointer Type Rules

+

Use the #pragma mpwc_relax to tell the compiler to treat all pointer types as the same type. While the compiler verifies the parameters of function prototypes for compatible pointer types, it allows direct pointer assignments.

+

Use this setting if you are using code written before the ISO C standard. Old source code frequently uses these types interchangeably.

+

This setting has no effect on C++. When compiling C++ source code, the compiler differentiates char* and unsigned char* data types even if the relaxed pointer setting is enabled.

+

See also “mpwc_relax”, and Checking Settings.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_require_prototypes.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_require_prototypes.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_require_prototypes.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,54 +1,54 @@ - - - - - -Require Function Prototypes - - - -

Require Function Prototypes

-

(ISO C, §6.7.5.3, §6.9.1) The C compiler lets you choose how to enforce function prototypes. The Require Function Prototypes setting controls this behavior.

-

If you enable the Require Function Prototypes setting, the compiler generates an error if you define a previously referenced function that does not have a prototype. If you define the function before it is referenced but do not give it a prototype, then enabling the Require Function Prototypes setting causes the compiler to issue a warning.

-

This setting helps you prevent errors that happen when you call a function before you declare or define it. For example, without a function prototype, you might pass data of the wrong type. As a result, your code might not work as you expect even though it compiles without error.

-

In Listing 1, PrintNum() is called with an integer argument but later defined to take a floating-point argument.

-
-
Listing 1. Unnoticed Type-mismatch
-

#include <stdio.h>
- void main(void)
- {
- PrintNum(1); // PrintNum() tries to interpret the
- integer as a float. Prints 0.000000.
- }

-

void PrintNum(float x)
- {
- printf("%f\n", x);
- }

-
-

When you run this program, you could get this result:

-

0.000000

-

Although the compiler does not complain about the type mismatch, the function does not work as you want. Since PrintNum() does not have a prototype, the compiler does not know to convert the integer to a floating-point number before calling the function. Instead, the function interprets the bits it received as a floating-point number and prints nonsense.

-

If you prototype PrintNum() first, as in Listing 2, the compiler converts its argument to a floating-point number, and the function prints what you wanted.

-
-
Listing 2. Using a Prototype to Avoid Type-mismatch
-

#include <stdio.h>
- void PrintNum(float x); // Function prototype.

-

void main(void)
- {
- PrintNum(1); // Compiler converts int to float.
- } // Prints 1.000000.

-

void PrintNum(float x)
- {
- printf("%f\n", x);
- }

-
-

In the above example, the compiler automatically typecasts the passed value. In other situations where automatic typecasting is not available, the compiler generates an error if an argument does not match the data type required by a function prototype. Such a mismatched data type error is easy to locate at compile time. If you do not use prototypes, you do not get a compiler error.

-

However, at runtime the code might produce an unexpected result whose cause can be extremely difficult to find.

-

The Require Function Prototypes setting corresponds to the pragma require_prototypes. To check this setting, use __option (require_prototypes). By default, this setting is enabled.

-

See also “require_prototypes”, and Checking Settings.
-

- - - - - + + + + + +Require Function Prototypes + + + +

Require Function Prototypes

+

(ISO C, §6.7.5.3, §6.9.1) The C compiler lets you choose how to enforce function prototypes. The Require Function Prototypes setting controls this behavior.

+

If you enable the Require Function Prototypes setting, the compiler generates an error if you define a previously referenced function that does not have a prototype. If you define the function before it is referenced but do not give it a prototype, then enabling the Require Function Prototypes setting causes the compiler to issue a warning.

+

This setting helps you prevent errors that happen when you call a function before you declare or define it. For example, without a function prototype, you might pass data of the wrong type. As a result, your code might not work as you expect even though it compiles without error.

+

In Listing 1, PrintNum() is called with an integer argument but later defined to take a floating-point argument.

+
+
Listing 1. Unnoticed Type-mismatch
+

#include <stdio.h>
+ void main(void)
+ {
+ PrintNum(1); // PrintNum() tries to interpret the
+ integer as a float. Prints 0.000000.
+ }

+

void PrintNum(float x)
+ {
+ printf("%f\n", x);
+ }

+
+

When you run this program, you could get this result:

+

0.000000

+

Although the compiler does not complain about the type mismatch, the function does not work as you want. Since PrintNum() does not have a prototype, the compiler does not know to convert the integer to a floating-point number before calling the function. Instead, the function interprets the bits it received as a floating-point number and prints nonsense.

+

If you prototype PrintNum() first, as in Listing 2, the compiler converts its argument to a floating-point number, and the function prints what you wanted.

+
+
Listing 2. Using a Prototype to Avoid Type-mismatch
+

#include <stdio.h>
+ void PrintNum(float x); // Function prototype.

+

void main(void)
+ {
+ PrintNum(1); // Compiler converts int to float.
+ } // Prints 1.000000.

+

void PrintNum(float x)
+ {
+ printf("%f\n", x);
+ }

+
+

In the above example, the compiler automatically typecasts the passed value. In other situations where automatic typecasting is not available, the compiler generates an error if an argument does not match the data type required by a function prototype. Such a mismatched data type error is easy to locate at compile time. If you do not use prototypes, you do not get a compiler error.

+

However, at runtime the code might produce an unexpected result whose cause can be extremely difficult to find.

+

The Require Function Prototypes setting corresponds to the pragma require_prototypes. To check this setting, use __option (require_prototypes). By default, this setting is enabled.

+

See also “require_prototypes”, and Checking Settings.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_reuse_strings.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_reuse_strings.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_reuse_strings.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - -Reusing Strings - - - -

Reusing Strings

-

The Reuse Strings setting controls how the compiler stores string literals.

-

If you enable this setting, the compiler stores each string literal separately. Otherwise, the compiler stores only one copy of identical string literals. This means if you change one of the strings, you change them all. For example, take this code snippet:

-

char *str1="Hello";
- char *str2="Hello"; // two identical strings
- *str2 = 'Y';

-

This setting helps you save memory if your program contains identical string literals which you do not modify.

-

If you enable the Reuse Strings setting, the strings are stored separately. After changing the first character, str1 is still "Hello", but str2 is "Yello".

-

If you disable the Reuse Strings setting, the two strings are stored in one memory location because they are identical. After changing the first character, both str1 and str2 are "Yello", which is counterintuitive and can create bugs that are difficult to locate.

-

The Reuse Strings setting corresponds to the pragma dont_reuse_strings. To check this setting, use __option (dont_reuse_strings). By default, this setting is enabled, so strings are not reused.

-

See also dont_reuse_strings. and Checking Settings.
-

- - - - - + + + + + +Reusing Strings + + + +

Reusing Strings

+

The Reuse Strings setting controls how the compiler stores string literals.

+

If you enable this setting, the compiler stores each string literal separately. Otherwise, the compiler stores only one copy of identical string literals. This means if you change one of the strings, you change them all. For example, take this code snippet:

+

char *str1="Hello";
+ char *str2="Hello"; // two identical strings
+ *str2 = 'Y';

+

This setting helps you save memory if your program contains identical string literals which you do not modify.

+

If you enable the Reuse Strings setting, the strings are stored separately. After changing the first character, str1 is still "Hello", but str2 is "Yello".

+

If you disable the Reuse Strings setting, the two strings are stored in one memory location because they are identical. After changing the first character, both str1 and str2 are "Yello", which is counterintuitive and can create bugs that are difficult to locate.

+

The Reuse Strings setting corresponds to the pragma dont_reuse_strings. To check this setting, use __option (dont_reuse_strings). By default, this setting is enabled, so strings are not reused.

+

See also dont_reuse_strings. and Checking Settings.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_short_dbl_type.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_short_dbl_type.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_short_dbl_type.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,17 +1,17 @@ - - - - - -The short double Data Type - - - -

The short double Data Type

-

The short double data type is no longer supported for most targets. -

- - - - - + + + + + +The short double Data Type + + + +

The short double Data Type

+

The short double data type is no longer supported for most targets. +

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_sizeof_type.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_sizeof_type.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_sizeof_type.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,19 +1,19 @@ - - - - - -Sizeof() Operator Data Type - - - -

Sizeof() Operator Data Type

-

The sizeof() operator returns the size of a variable or type in bytes. The data type of this size is size_t, which the compiler declares in the file stddef.h. If your source code assumes that sizeof() returns a number of type int, it might not work correctly.

-

NOTE The compiler evaluates the value returned by sizeof() only at compile time, not runtime.

-

NOTE The sizeof() operator is not intended to work in preprocessor #if/#elif directives.
-

- - - - - + + + + + +Sizeof() Operator Data Type + + + +

Sizeof() Operator Data Type

+

The sizeof() operator returns the size of a variable or type in bytes. The data type of this size is size_t, which the compiler declares in the file stddef.h. If your source code assumes that sizeof() returns a number of type int, it might not work correctly.

+

NOTE The compiler evaluates the value returned by sizeof() only at compile time, not runtime.

+

NOTE The sizeof() operator is not intended to work in preprocessor #if/#elif directives.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_std_conformity.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_std_conformity.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_std_conformity.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,30 +1,30 @@ - - - - - -Checking for Standard C and Standard C++ Conformity - - - -

Checking for Standard C and Standard C++ Conformity

-

The ANSI Strict setting affects several C language extensions made by the Carbide C compiler:

- -

If you enable the ANSI Strict setting, the compiler disables all of the above ANSI C language extensions. You cannot enable individual extensions that are controlled by the ANSI Strict setting.

-

This setting might affect how the compiler handles enumerated constants. See Enumerated Types for more information. It might also affect the declaration of the main() function for C++ programs. See “Implicit Return Statement for main()”.

-

The ANSI Strict setting corresponds to the pragma ANSI_strict. To check this setting, use __option (ANSI_strict). See also “ANSI_strict” and Checking Settings. -

- - - - - + + + + + +Checking for Standard C and Standard C++ Conformity + + + +

Checking for Standard C and Standard C++ Conformity

+

The ANSI Strict setting affects several C language extensions made by the Carbide C compiler:

+ +

If you enable the ANSI Strict setting, the compiler disables all of the above ANSI C language extensions. You cannot enable individual extensions that are controlled by the ANSI Strict setting.

+

This setting might affect how the compiler handles enumerated constants. See Enumerated Types for more information. It might also affect the declaration of the main() function for C++ programs. See “Implicit Return Statement for main()”.

+

The ANSI Strict setting corresponds to the pragma ANSI_strict. To check this setting, use __option (ANSI_strict). See also “ANSI_strict” and Checking Settings. +

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_typecast_ptrs.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_typecast_ptrs.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_typecast_ptrs.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,23 +1,23 @@ - - - - - -Using Typecasted Pointers as lvalues - - - -

Using Typecasted Pointers as lvalues

-

The C compiler can accept pointers that are typecasted to other pointer types as lvalues.

-
-

Listing 1. Example of a Typecasted Pointer as an lvalue

-

char *cp;
- ((long *) cp)++; /* OK if ANSI Strict is disabled. */

-
-

See also “Checking for Standard C and Standard C++ Conformity”.
-

- - - - - + + + + + +Using Typecasted Pointers as lvalues + + + +

Using Typecasted Pointers as lvalues

+

The C compiler can accept pointers that are typecasted to other pointer types as lvalues.

+
+

Listing 1. Example of a Typecasted Pointer as an lvalue

+

char *cp;
+ ((long *) cp)++; /* OK if ANSI Strict is disabled. */

+
+

See also “Checking for Standard C and Standard C++ Conformity”.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_typeof_operator.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_typeof_operator.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_typeof_operator.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,31 +1,31 @@ - - - - - -The __typeof__() and typeof() operators - - - -

The __typeof__() and typeof() operators

-

With the __typeof__() operator, the compiler lets you specify the data type of an expression. Listing 1 shows an example.

-

__typeof__(expression)

-

where expression is any valid C expression or data type. Because the compiler translates a __typeof__() expression into a data type, you can use this expression wherever a normal type would be specified.

-

Like the sizeof() operator, __typeof__() is only evaluated at compile time, not at runtime. For related information, see “Sizeof() Operator Data Type”.

-

If you enable the gcc_extensions pragma, the typeof() operator is equivalent to the __typeof__() operator.

-
-

Listing 1. Example of __typeof__() and typeof() Operators

-

char *cp;
- int *ip;
- long *lp;

-

__typeof__(*ip) i; /* equivalent to "int i;" */
- __typeof__(*lp) l; /* equivalent to "long l;" */

-

#pragma gcc_extensions on
- typeof(*cp) c; /* equivalent to "char c;" */
-

-
- - - - - + + + + + +The __typeof__() and typeof() operators + + + +

The __typeof__() and typeof() operators

+

With the __typeof__() operator, the compiler lets you specify the data type of an expression. Listing 1 shows an example.

+

__typeof__(expression)

+

where expression is any valid C expression or data type. Because the compiler translates a __typeof__() expression into a data type, you can use this expression wherever a normal type would be specified.

+

Like the sizeof() operator, __typeof__() is only evaluated at compile time, not at runtime. For related information, see “Sizeof() Operator Data Type”.

+

If you enable the gcc_extensions pragma, the typeof() operator is equivalent to the __typeof__() operator.

+
+

Listing 1. Example of __typeof__() and typeof() Operators

+

char *cp;
+ int *ip;
+ long *lp;

+

__typeof__(*ip) i; /* equivalent to "int i;" */
+ __typeof__(*lp) l; /* equivalent to "long l;" */

+

#pragma gcc_extensions on
+ typeof(*cp) c; /* equivalent to "char c;" */
+

+
+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_unnamed_args.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_unnamed_args.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_unnamed_args.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,23 +1,23 @@ - - - - - -Unnamed Arguments in Function Definitions - - - -

Unnamed Arguments in Function Definitions

-

(ISO C, §6.9.1) The C compiler can accept unnamed arguments in a function definition.

-
-

Listing 1. Unnamed Function Arguments

-

void f(int ) {} /* OK if ANSI Strict is disabled */
- void f(int i) {} /* ALWAYS OK */

-
-

See also: Checking for Standard C and Standard C++ Conformity.
-

- - - - - + + + + + +Unnamed Arguments in Function Definitions + + + +

Unnamed Arguments in Function Definitions

+

(ISO C, §6.9.1) The C compiler can accept unnamed arguments in a function definition.

+
+

Listing 1. Unnamed Function Arguments

+

void f(int ) {} /* OK if ANSI Strict is disabled */
+ void f(int i) {} /* ALWAYS OK */

+
+

See also: Checking for Standard C and Standard C++ Conformity.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_unsigned_chars.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_unsigned_chars.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_unsigned_chars.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,19 +1,19 @@ - - - - - -Use Unsigned Chars - - - -

Use Unsigned Chars

-

The C compiler treats a char declaration as an unsigned char declaration.

-

The Use Unsigned Chars setting corresponds to the pragma unsigned_char. To check this setting, use __option (unsigned_char). By default, this setting is disabled.

-

See also “unsigned_char” and Checking Settings. -

- - - - - + + + + + +Use Unsigned Chars + + + +

Use Unsigned Chars

+

The C compiler treats a char declaration as an unsigned char declaration.

+

The Use Unsigned Chars setting corresponds to the pragma unsigned_char. To check this setting, use __option (unsigned_char). By default, this setting is disabled.

+

See also “unsigned_char” and Checking Settings. +

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_use_longlong.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_use_longlong.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_use_longlong.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,22 +1,22 @@ - - - - - -Using long long Integers - - - -

Using long long Integers

-

The C compiler allows the type specifier long long. The longlong pragma controls this behavior and has no corresponding item .

-

If this setting is off, using long long causes a syntax error.

-

In an enumerated type, you can use an enumerator large enough for a long long. For more information, see Enumerated Types.

-

However, long long bitfields are not supported.

-

You control the long long type with #pragma longlong. To check this setting, use __option (longlong). By default, this pragma is on.

-

See also longlong and Checking Settings.
-

- - - - - + + + + + +Using long long Integers + + + +

Using long long Integers

+

The C compiler allows the type specifier long long. The longlong pragma controls this behavior and has no corresponding item .

+

If this setting is off, using long long causes a syntax error.

+

In an enumerated type, you can use an enumerator large enough for a long long. For more information, see Enumerated Types.

+

However, long long bitfields are not supported.

+

You control the long long type with #pragma longlong. To check this setting, use __option (longlong). By default, this pragma is on.

+

See also longlong and Checking Settings.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_volatile_var.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_volatile_var.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_volatile_var.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,35 +1,35 @@ - - - - - -Volatile Variables - - - -

Volatile Variables

-

(ISO C, §6.7.3) When you declare a volatile variable, the Carbide C compiler takes the following precautions to respect the value of the variable:

- -

Listing 1 shows an example of volatile variables.

-
-
Listing 1. Volatile Variables
-

void main(void)
- {
- int i[100];
- volatile int a, b; /* a and b are not cached in registers. */

-

a = 5;
- b = 20;

-

i[a + b] = 15; /* compiler calculates a + b */
- i[a + b] = 30; /* compiler recalculates a + b */
- }

-
-

The compiler does not place the value of a, b, or a+b in registers. But it does recalculate a+b in both assignment statements.
-

- - - - - + + + + + +Volatile Variables + + + +

Volatile Variables

+

(ISO C, §6.7.3) When you declare a volatile variable, the Carbide C compiler takes the following precautions to respect the value of the variable:

+ +

Listing 1 shows an example of volatile variables.

+
+
Listing 1. Volatile Variables
+

void main(void)
+ {
+ int i[100];
+ volatile int a, b; /* a and b are not cached in registers. */

+

a = 5;
+ b = 20;

+

i[a + b] = 15; /* compiler calculates a + b */
+ i[a + b] = 30; /* compiler recalculates a + b */
+ }

+
+

The compiler does not place the value of a, b, or a+b in registers. But it does recalculate a+b in both assignment statements.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_zero_length_arrays.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_zero_length_arrays.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/c_compiler/c_zero_length_arrays.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,24 +1,24 @@ - - - - - -Arrays of Zero Length in Structures - - - -

Arrays of Zero Length in Structures

-

If you disable the ANSI Strict setting , the compiler lets you specify an array of no length as the last item in a structure. Listing 1 shows an example. You can define arrays with zero as the index value or with no index value.

-
-
Listing 1. Using Zero-length Arrays
-

struct listOfLongs {
- long listCount;
- long list[0]; // OK if ANSI Strict is disabled, [] is OK, too.
- }
-

-
- - - - - + + + + + +Arrays of Zero Length in Structures + + + +

Arrays of Zero Length in Structures

+

If you disable the ANSI Strict setting , the compiler lets you specify an array of no length as the last item in a structure. Listing 1 shows an example. You can define arrays with zero as the index value or with no index value.

+
+
Listing 1. Using Zero-length Arrays
+

struct listOfLongs {
+ long listCount;
+ long list[0]; // OK if ANSI Strict is disabled, [] is OK, too.
+ }
+

+
+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cmd_line/cmd_admin_options.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cmd_line/cmd_admin_options.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cmd_line/cmd_admin_options.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - -Help and Administrative Options - - - -

Help and Administrative Options

-

This section provides examples of how to retrieve general and help information from the command-line tools.

-

For example, to obtain help information from a tool that has some compatibility options with Visual C++, type the following command:

-

mwccsym2 -?

-

To get more specific information from the same tool, type the following command:

-

mwccsym2 -help [argument,...]

-

where argument is a valid keyword such as usage, all, or this. For example, with the Windows® x86 C/C++ compiler, typing:

-

mwccsym2 -help usage

-

or

-

mwccsym2 -help opt=help

-

provides information about the help options available with the mwccsym2 x86 tool.
-

- - - - - + + + + + +Help and Administrative Options + + + +

Help and Administrative Options

+

This section provides examples of how to retrieve general and help information from the command-line tools.

+

For example, to obtain help information from a tool that has some compatibility options with Visual C++, type the following command:

+

mwccsym2 -?

+

To get more specific information from the same tool, type the following command:

+

mwccsym2 -help [argument,...]

+

where argument is a valid keyword such as usage, all, or this. For example, with the Windows® x86 C/C++ compiler, typing:

+

mwccsym2 -help usage

+

or

+

mwccsym2 -help opt=help

+

provides information about the help options available with the mwccsym2 x86 tool.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cmd_line/cmd_conventions.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cmd_line/cmd_conventions.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cmd_line/cmd_conventions.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - -Command-Line Settings Conventions - - - -

Command-Line Settings Conventions

-

In all cases, text in brackets ([]) is optional, although the brackets themselves never appear in the actual command. For example, the command -str[ings] pool can mean either:

-

-strings pool

-

or

-

-str pool

-

Where an option has several possible permutations, the possibilities are separated by the pipe (|) character. For example:

-

-sym on|off|full|fullpath

-

means the -sym command can be followed by one or more of the following options: on, off, full, or fullpath. If you have more than one option, separate each option with a comma. So you might have -sym on, -sym off, -sym full, or -sym on, fullpath.

-

The plus sign (+) means that the parameter to an option must not be separated from the option name by a space. For example,

-

-D+name[=value]

-

means that you can have -DVAR or -DVAR=3, but not -D VAR.

-

In cases where you provide a variable parameter such as a file name, that item is in italic text. For example, -precompile filename means you must provide a file name. The help text that corresponds to the compiler option explains what you must provide.

- - - - - + + + + + +Command-Line Settings Conventions + + + +

Command-Line Settings Conventions

+

In all cases, text in brackets ([]) is optional, although the brackets themselves never appear in the actual command. For example, the command -str[ings] pool can mean either:

+

-strings pool

+

or

+

-str pool

+

Where an option has several possible permutations, the possibilities are separated by the pipe (|) character. For example:

+

-sym on|off|full|fullpath

+

means the -sym command can be followed by one or more of the following options: on, off, full, or fullpath. If you have more than one option, separate each option with a comma. So you might have -sym on, -sym off, -sym full, or -sym on, fullpath.

+

The plus sign (+) means that the parameter to an option must not be separated from the option name by a space. For example,

+

-D+name[=value]

+

means that you can have -DVAR or -DVAR=3, but not -D VAR.

+

In cases where you provide a variable parameter such as a file name, that item is in italic text. For example, -precompile filename means you must provide a file name. The help text that corresponds to the compiler option explains what you must provide.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cmd_line/cmd_env_vars.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cmd_line/cmd_env_vars.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cmd_line/cmd_env_vars.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,38 +1,38 @@ - - - - - -Working with Environment Variables - - - -

Working with Environment Variables

-

To use the command-line tools, you must change several environment variables. If you are using Carbide command-line tools with Microsoft® Windows®, you can assign environment variables through the Environment tab under the System control panel in Windows XP/2000/NT.

-

CWFolder Environment Variable

-

Use the following syntax when defining variables in batch files or on the command line:

-

set CWFolder=C:\Program Files\Carbide

-

In this example, CWFolder refers to the path where you installed Carbide. It is not necessary to include quotation marks when defining environment variables that include spaces. Because Windows does not strip out the quotes, this leads to unknown directory warnings.

-

Setting the PATH Environment Variable

-

The PATH variable should include the paths for the tools, as shown below. For other tools, the paths can vary. An example of setting PATH:

-

%CWFolder%\Carbide
- %CWFolder%\Carbide\Carbide.c++

-

The first path contains the FlexLM license manager DLL, and the second path contains the tools. To run FlexLM, copy the following file into the directory containing the command-line tools:

-

..\Carbide\license.dat

-

Or, you can define the variable LM_LICENSE_FILE as:

-

%CWFolder%\license.dat

-

which points to the license information. It might point to alternate versions of this file, as needed.

-

Getting Environmental Variables

-

Use the predefined macro __env_var() to return host-specific environmental variables. An example of getting an environmental variable:

-

// returns "username" environmental variable
- // (host-specific)
- char* username = __env_var(username);

-

Search Path Environment Variables

-

Several environment variables are used at runtime to search for system include paths and libraries that can shorten command lines for many tasks. All of the variables mentioned here are lists that are separated by semicolons (;) in Windows and colons (:) in Solaris.

-

For the linker, unless you specify -nodefaults or -disassemble, the linker searches the environment for a list of system access paths and library files to be added to the end of the search and link orders. For example, with Embedded PowerPC, the linkers searches for files, libraries, and command files, using the system library paths found within the variables MWEABIPPCLibraries and MWLibraries. Associated with these lists are MWEABIPPCLibraryFiles and MWLibraryFiles, which contain lists of libraries (or object files or command files) to add to the end of the link order. These files can be located in any of the cumulative access paths at runtime.

-

If you are only building for one target, you can use MWCIncludes, MWAsmIncludes, MWLibraries, and MWLibraryFiles. Because the target-specific versions of these variables override the generic variables, they are useful when working with multiple targets. If the target-specific variable exists, then the generic variable is not used because you cannot combine the contents of the two variables.

- - - - - + + + + + +Working with Environment Variables + + + +

Working with Environment Variables

+

To use the command-line tools, you must change several environment variables. If you are using Carbide command-line tools with Microsoft® Windows®, you can assign environment variables through the Environment tab under the System control panel in Windows XP/2000/NT.

+

CWFolder Environment Variable

+

Use the following syntax when defining variables in batch files or on the command line:

+

set CWFolder=C:\Program Files\Carbide

+

In this example, CWFolder refers to the path where you installed Carbide. It is not necessary to include quotation marks when defining environment variables that include spaces. Because Windows does not strip out the quotes, this leads to unknown directory warnings.

+

Setting the PATH Environment Variable

+

The PATH variable should include the paths for the tools, as shown below. For other tools, the paths can vary. An example of setting PATH:

+

%CWFolder%\Carbide
+ %CWFolder%\Carbide\Carbide.c++

+

The first path contains the FlexLM license manager DLL, and the second path contains the tools. To run FlexLM, copy the following file into the directory containing the command-line tools:

+

..\Carbide\license.dat

+

Or, you can define the variable LM_LICENSE_FILE as:

+

%CWFolder%\license.dat

+

which points to the license information. It might point to alternate versions of this file, as needed.

+

Getting Environmental Variables

+

Use the predefined macro __env_var() to return host-specific environmental variables. An example of getting an environmental variable:

+

// returns "username" environmental variable
+ // (host-specific)
+ char* username = __env_var(username);

+

Search Path Environment Variables

+

Several environment variables are used at runtime to search for system include paths and libraries that can shorten command lines for many tasks. All of the variables mentioned here are lists that are separated by semicolons (;) in Windows and colons (:) in Solaris.

+

For the linker, unless you specify -nodefaults or -disassemble, the linker searches the environment for a list of system access paths and library files to be added to the end of the search and link orders. For example, with Embedded PowerPC, the linkers searches for files, libraries, and command files, using the system library paths found within the variables MWEABIPPCLibraries and MWLibraries. Associated with these lists are MWEABIPPCLibraryFiles and MWLibraryFiles, which contain lists of libraries (or object files or command files) to add to the end of the link order. These files can be located in any of the cumulative access paths at runtime.

+

If you are only building for one target, you can use MWCIncludes, MWAsmIncludes, MWLibraries, and MWLibraryFiles. Because the target-specific versions of these variables override the generic variables, they are useful when working with multiple targets. If the target-specific variable exists, then the generic variable is not used because you cannot combine the contents of the two variables.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cmd_line/cmd_extensions.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cmd_line/cmd_extensions.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cmd_line/cmd_extensions.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,17 +1,17 @@ - - - - - -Invoking Command-Line Tools - - - -

File Extensions

-

Files specified on the command line are identified by contents and file extension, as in the Carbide IDE.

-

Although the command-line version of the Carbide C/C++ compiler accepts non-standard file extensions as source, it also emit a warning when this happens. By default, the compiler assumes that a file with any extensions other than .c, .h, or .pch is a C++ source file. The linker must be able to identify all files as object code, libraries, or command files. It ignores all other files.

- - - - - + + + + + +Invoking Command-Line Tools + + + +

File Extensions

+

Files specified on the command line are identified by contents and file extension, as in the Carbide IDE.

+

Although the command-line version of the Carbide C/C++ compiler accepts non-standard file extensions as source, it also emit a warning when this happens. By default, the compiler assumes that a file with any extensions other than .c, .h, or .pch is a C++ source file. The linker must be able to identify all files as object code, libraries, or command files. It ignores all other files.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cmd_line/cmd_invoking.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cmd_line/cmd_invoking.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cmd_line/cmd_invoking.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,30 +1,30 @@ - - - - - -Tool Naming Conventions - - - -

Invoking Command-Line Tools

-

To compile, assemble, link, or perform some other programming task with the Carbide command-line tools, type a command at the command-line prompt. This command specifies what tool to run, what options to use while the tool runs, and on what files the tool should operate.

-

The tool performs the operation on the files you specify. If the tool successfully finishes its operation, a new prompt appears on the command line. Otherwise, it reports any problems as text messages on the command line before a new prompt appears. The tools include:

- -

All of them can be found in \Nokia\Carbide.c++ <version>\x86Build\Symbian_Tools\Command_Line_Tools.

-

You can also write scripts that automate the process to build your software. Scripts contain a list of command-line tools to invoke, one after another. For example, the make tool, a common software development tool, uses scripts to manage dependencies among source code files and invoke command-line compilers, assemblers, and linkers as needed, much like the Carbider IDE’s project manager.

-

Commands follow this convention:

-
-

tool [options] [files]

-
-

where tool is the name of the Carbide command-line tool to invoke, options is a list of zero or more options that tell the tool what operation it should perform and how to perform it, and files is a list of zero or more files on which the tool should operate. Which options and files you use depends on what operation you want the tool to perform.
-

- - - - - + + + + + +Tool Naming Conventions + + + +

Invoking Command-Line Tools

+

To compile, assemble, link, or perform some other programming task with the Carbide command-line tools, type a command at the command-line prompt. This command specifies what tool to run, what options to use while the tool runs, and on what files the tool should operate.

+

The tool performs the operation on the files you specify. If the tool successfully finishes its operation, a new prompt appears on the command line. Otherwise, it reports any problems as text messages on the command line before a new prompt appears. The tools include:

+ +

All of them can be found in \Nokia\Carbide.c++ <version>\x86Build\Symbian_Tools\Command_Line_Tools.

+

You can also write scripts that automate the process to build your software. Scripts contain a list of command-line tools to invoke, one after another. For example, the make tool, a common software development tool, uses scripts to manage dependencies among source code files and invoke command-line compilers, assemblers, and linkers as needed, much like the Carbider IDE’s project manager.

+

Commands follow this convention:

+
+

tool [options] [files]

+
+

where tool is the name of the Carbide command-line tool to invoke, options is a list of zero or more options that tell the tool what operation it should perform and how to perform it, and files is a list of zero or more files on which the tool should operate. Which options and files you use depends on what operation you want the tool to perform.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cmd_line/cmd_line.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cmd_line/cmd_line.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cmd_line/cmd_line.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,29 +1,29 @@ - - - - - -Command-Line Tools - - - -

Command-Line Tools

-

The Carbide IDE uses compilers and linkers to generate object code for x86 platforms. The IDE also provides command-line versions of these tools that also generate and combine object code files to produce executable files such as applications, dynamic link libraries (DLLs), code resources, or static libraries.

-

NOTE The Carbide.c++ compiler is stored in \Nokia\Carbide.c++ <version>\x86Build\Symbian_Tools\Command_Line_Tools.

-

You configure each command-line tool by specifying various options when you invoke the tool.

-

This topic contains the following sections:

- -

TIP A command-line user interface interacts with you through a text-based console instead of GUI items such as windows, menus, and buttons.
-

- - - - - + + + + + +Command-Line Tools + + + +

Command-Line Tools

+

The Carbide IDE uses compilers and linkers to generate object code for x86 platforms. The IDE also provides command-line versions of these tools that also generate and combine object code files to produce executable files such as applications, dynamic link libraries (DLLs), code resources, or static libraries.

+

NOTE The Carbide.c++ compiler is stored in \Nokia\Carbide.c++ <version>\x86Build\Symbian_Tools\Command_Line_Tools.

+

You configure each command-line tool by specifying various options when you invoke the tool.

+

This topic contains the following sections:

+ +

TIP A command-line user interface interacts with you through a text-based console instead of GUI items such as windows, menus, and buttons.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cmd_line/cmd_naming.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cmd_line/cmd_naming.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cmd_line/cmd_naming.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,29 +1,29 @@ - - - - - -Tool Naming Conventions - - - -

Tool Naming Conventions

-

The names of the Carbide command-line tools follow this convention:

-

mw<tool><type>

-

where:

- -

Tools include:

- -

NOTE The prefix "mw" is an artifact of the pre-Carbide days when Metrowerks owned the x86 compiler technology used by Carbide.c++.

- - - - - + + + + + +Tool Naming Conventions + + + +

Tool Naming Conventions

+

The names of the Carbide command-line tools follow this convention:

+

mw<tool><type>

+

where:

+ +

Tools include:

+ +

NOTE The prefix "mw" is an artifact of the pre-Carbide days when Metrowerks owned the x86 compiler technology used by Carbide.c++.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/compiler.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/compiler.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/compiler.htm Mon Jul 19 16:13:24 2010 -0500 @@ -7,6 +7,9 @@ @@ -18,14 +21,13 @@

 

 

-

 

-

Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+

Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
License: http://www.eclipse.org/legal/epl-v10.html

-

x86 C/C++ Compiler Reference

-

x86 Compiler 3.2.5 (Build 480); July, 2009

+
x86 C/C++ Compiler Reference
+

x86 Compiler 3.2.5 (Build 489); Feb, 2010

 

diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_behavior/cpp_be_chars.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_behavior/cpp_be_chars.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_behavior/cpp_be_chars.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,18 +1,18 @@ - - - - - -Character Literals - - - -

Character Literals

-

(ISO C++, §2.13.2) The standard specifies that a multicharacter literal, two or more characters surrounded by single quotes, has an implementation-defined value. See Character Constants as Integer Values for information on how Carbide.c++ translates such values.

-

A character literal that begins with the letter “L” (without the quotes) is a wide-character literal. Each target translates wide-character literals in its own way; most targets use either two or four-byte wide characters. An escape sequence that uses an octal or hexadecimal value outside the range of char or wchar_t results in an error.

-

See your target documentation for more information on how your target handles wide-character literals.

- - - - - + + + + + +Character Literals + + + +

Character Literals

+

(ISO C++, §2.13.2) The standard specifies that a multicharacter literal, two or more characters surrounded by single quotes, has an implementation-defined value. See Character Constants as Integer Values for information on how Carbide.c++ translates such values.

+

A character literal that begins with the letter “L” (without the quotes) is a wide-character literal. Each target translates wide-character literals in its own way; most targets use either two or four-byte wide characters. An escape sequence that uses an octal or hexadecimal value outside the range of char or wchar_t results in an error.

+

See your target documentation for more information on how your target handles wide-character literals.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_behavior/cpp_be_devices.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_behavior/cpp_be_devices.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_behavior/cpp_be_devices.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,17 +1,17 @@ - - - - - -Interactive Devices - - - -

Interactive Devices

-

(ISO C++, §1.9) The standard specifies that an interactive device, the part of a computer that accepts input from and provides output to a human operator, is implementation-defined. The most common instance of an interactive device is a console; a keyboard and character display terminal.

-

Some versions of Carbide.c++, typically for desktop platforms, provide libraries to emulate a character display device in a graphical window. For example, on Microsoft Windows Carbide.c++ uses the Command Prompt window. For embedded systems that do not have a keyboard or display, Carbide provides console interaction through a serial or Ethernet connection between the target and host computers.

- - - - - + + + + + +Interactive Devices + + + +

Interactive Devices

+

(ISO C++, §1.9) The standard specifies that an interactive device, the part of a computer that accepts input from and provides output to a human operator, is implementation-defined. The most common instance of an interactive device is a console; a keyboard and character display terminal.

+

Some versions of Carbide.c++, typically for desktop platforms, provide libraries to emulate a character display device in a graphical window. For example, on Microsoft Windows Carbide.c++ uses the Command Prompt window. For embedded systems that do not have a keyboard or display, Carbide provides console interaction through a serial or Ethernet connection between the target and host computers.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_behavior/cpp_be_hdr_access.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_behavior/cpp_be_hdr_access.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_behavior/cpp_be_hdr_access.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,18 +1,18 @@ - - - - - -Header File Access - - - -

Header File Access

-

(ISO C++, §2.8) The standard requires implementations to specify how header names are mapped to actual files.

-

The Carbide IDE manages the correspondence of header names to header files.

-

If you use Carbide.c++ on the command line, see Command-Line Tools for information on specifying how Carbide.c++ should search for header files.

- - - - - + + + + + +Header File Access + + + +

Header File Access

+

(ISO C++, §2.8) The standard requires implementations to specify how header names are mapped to actual files.

+

The Carbide IDE manages the correspondence of header names to header files.

+

If you use Carbide.c++ on the command line, see Command-Line Tools for information on specifying how Carbide.c++ should search for header files.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_behavior/cpp_be_size_of_bytes.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_behavior/cpp_be_size_of_bytes.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_behavior/cpp_be_size_of_bytes.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,16 +1,16 @@ - - - - - -Size of BytesBehavior - - - -

Size of Bytes

-

(ISO C++, §1.7) The standard specifies that the size of a byte is implementation-defined.

- - - - - + + + + + +Size of BytesBehavior + + + +

Size of Bytes

+

(ISO C++, §1.7) The standard specifies that the size of a byte is implementation-defined.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_behavior/cpp_be_src_handling.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_behavior/cpp_be_src_handling.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_behavior/cpp_be_src_handling.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,19 +1,19 @@ - - - - - -Source File Handling - - - -

Source File Handling

-

(ISO C++, §2.1) The standard specifies how source files are prepared for translation.

-

If trigraph expansion is turned on, Carbide.c++ converts trigraph sequences with their single-character representations. Trigraph expansion is controlled by the #pragma trigraphs.

-

At preprocessing-time, a sequence of two or more white-space characters, except new-line characters, is converted to a single space.
- New-line characters are left untouched, unless preceded by a backslash (“\”), in which case the proceeding line is appended.

- - - - - + + + + + +Source File Handling + + + +

Source File Handling

+

(ISO C++, §2.1) The standard specifies how source files are prepared for translation.

+

If trigraph expansion is turned on, Carbide.c++ converts trigraph sequences with their single-character representations. Trigraph expansion is controlled by the #pragma trigraphs.

+

At preprocessing-time, a sequence of two or more white-space characters, except new-line characters, is converted to a single space.
+ New-line characters are left untouched, unless preceded by a backslash (“\”), in which case the proceeding line is appended.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_behavior/cpp_behavior.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_behavior/cpp_behavior.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_behavior/cpp_behavior.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,25 +1,25 @@ - - - - - -C++ Implementation-Defined Behavior - - - -

C++ Implementation-Defined Behavior

-

The ISO standard for C++ leaves many details about the form and translation of C++ programs up to the implementation of the C++ compiler. This section lists the parts of the of the C++ standard that are left to the implementation to define and how Carbide.c++ behaves in these situations. Numbers in parentheses that begin with “§” denote the section of the ISO C++ standard that an implementation-defined behavior refers to.

-

This section refers to implementation-defined behaviors of the compiler itself. Topics include:

- -

For information of implementation-defined behaviors of the Standard C++ Library, consult the MSL C++ Library Reference.

- - - - - + + + + + +C++ Implementation-Defined Behavior + + + +

C++ Implementation-Defined Behavior

+

The ISO standard for C++ leaves many details about the form and translation of C++ programs up to the implementation of the C++ compiler. This section lists the parts of the of the C++ standard that are left to the implementation to define and how Carbide.c++ behaves in these situations. Numbers in parentheses that begin with “§” denote the section of the ISO C++ standard that an implementation-defined behavior refers to.

+

This section refers to implementation-defined behaviors of the compiler itself. Topics include:

+ +

For information of implementation-defined behaviors of the Standard C++ Library, consult the MSL C++ Library Reference.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_compiler.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_compiler.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_compiler.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,29 +1,29 @@ - - - - - -C++ Compiler - - - -

C++ Compiler

-

This section discusses the Carbide.c++ compiler as it applies to all Carbide targets. Most information in this chapter applies to any operating system or processor.

-

Other sections in this manual discuss other compiler features that apply to specific operating systems and processors. For a complete picture, you need to consider all the information relating to your particular target.

-

The C compiler is also an integral part of the Carbide.c++ compiler. As a result, everything about the C compiler applies equally to C++. This discussion of the C++ compiler does not repeat information on the C compiler. See C Compiler for information on the C compiler.

-

This section contains the following topics:

- -

For information on using Embedded C++ (EC++) and for strategies on developing smaller C++ programs, see Overview. -

- - - - - + + + + + +C++ Compiler + + + +

C++ Compiler

+

This section discusses the Carbide.c++ compiler as it applies to all Carbide targets. Most information in this chapter applies to any operating system or processor.

+

Other sections in this manual discuss other compiler features that apply to specific operating systems and processors. For a complete picture, you need to consider all the information relating to your particular target.

+

The C compiler is also an integral part of the Carbide.c++ compiler. As a result, everything about the C compiler applies equally to C++. This discussion of the C++ compiler does not repeat information on the C compiler. See C Compiler for information on the C compiler.

+

This section contains the following topics:

+ +

For information on using Embedded C++ (EC++) and for strategies on developing smaller C++ programs, see Overview. +

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_controlling.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_controlling.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_controlling.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - -Controlling the C++ Compiler - - - -

Controlling the C++ Compiler

-

This section describes how to control compiler behavior by selecting settings .

-

This section contains the following topics:

- - - - - - + + + + + +Controlling the C++ Compiler + + + +

Controlling the C++ Compiler

+

This section describes how to control compiler behavior by selecting settings .

+

This section contains the following topics:

+ + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_ctrl_always.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_ctrl_always.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_ctrl_always.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,18 +1,18 @@ - - - - - -Using the C++ Compiler Always - - - -

Using the C++ Compiler Always

-

If you enable the Force C++ Compilation setting, the compiler translates all C source files in your project as C++ code. Otherwise, the Carbide IDE uses the suffix of the file name to determine whether to use the C or C++ compiler. The entries in the Carbide IDE’s File Mappings panel describes the suffixes that the compiler seeks.

-

This setting corresponds to the pragma cplusplus. To check this setting, use __option (cplusplus). By default, this setting is disabled.

-

See Checking Option Settings for information on how to use this directive.

- - - - - + + + + + +Using the C++ Compiler Always + + + +

Using the C++ Compiler Always

+

If you enable the Force C++ Compilation setting, the compiler translates all C source files in your project as C++ code. Otherwise, the Carbide IDE uses the suffix of the file name to determine whether to use the C or C++ compiler. The entries in the Carbide IDE’s File Mappings panel describes the suffixes that the compiler seeks.

+

This setting corresponds to the pragma cplusplus. To check this setting, use __option (cplusplus). By default, this setting is disabled.

+

See Checking Option Settings for information on how to use this directive.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_ctrl_bool_type.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_ctrl_bool_type.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_ctrl_bool_type.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,21 +1,21 @@ - - - - - -Using the bool Type - - - -

Using the bool Type

-

Enable the Enable bool Support setting to use the standard C++ bool type to represent true and false. Disable this setting if recognizing bool, true, or false as keywords causes problems in your program.

-

Enabling the bool data type and its true and false values is not equivalent to defining them using typedef and #define. The C++ bool type is a distinct type defined by the ISO C++ Standard. Source code that does not treat it as a distinct type might not compile properly.

-

For example, some compilers equate the bool type with the unsigned char data type. If you disable the Enable bool Support setting, the Carbide.c++ compiler equates the bool type with the unsigned char data type. Otherwise, using the Carbide C/C++ compiler on source code that involves this behavior might result in errors.

-

This setting corresponds to the pragma bool. To check this setting, use __option (bool). By default, this setting is disabled.

-

See Checking Option Settings for information on how to use this directive.
-

- - - - - + + + + + +Using the bool Type + + + +

Using the bool Type

+

Enable the Enable bool Support setting to use the standard C++ bool type to represent true and false. Disable this setting if recognizing bool, true, or false as keywords causes problems in your program.

+

Enabling the bool data type and its true and false values is not equivalent to defining them using typedef and #define. The C++ bool type is a distinct type defined by the ISO C++ Standard. Source code that does not treat it as a distinct type might not compile properly.

+

For example, some compilers equate the bool type with the unsigned char data type. If you disable the Enable bool Support setting, the Carbide.c++ compiler equates the bool type with the unsigned char data type. Otherwise, using the Carbide C/C++ compiler on source code that involves this behavior might result in errors.

+

This setting corresponds to the pragma bool. To check this setting, use __option (bool). By default, this setting is disabled.

+

See Checking Option Settings for information on how to use this directive.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_ctrl_exceptions.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_ctrl_exceptions.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_ctrl_exceptions.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,20 +1,20 @@ - - - - - -Controlling Exception Handling - - - -

Controlling Exception Handling

-

Enable the Enable C++ Exceptions setting if you use the ISO-standard try and catch statements. Otherwise, disable this setting to generate smaller and faster code.

-

For more information on how Carbide implements the ISO C++ exception handling mechanism, see Working with C++ Exceptions.

-

This setting corresponds to the pragma exceptions. To check this setting, use __option (exceptions). By default, this setting is disabled.

-

See Checking Option Settings for information on how to use this directive.
-

- - - - - + + + + + +Controlling Exception Handling + + + +

Controlling Exception Handling

+

Enable the Enable C++ Exceptions setting if you use the ISO-standard try and catch statements. Otherwise, disable this setting to generate smaller and faster code.

+

For more information on how Carbide implements the ISO C++ exception handling mechanism, see Working with C++ Exceptions.

+

This setting corresponds to the pragma exceptions. To check this setting, use __option (exceptions). By default, this setting is disabled.

+

See Checking Option Settings for information on how to use this directive.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_ctrl_extensions.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_ctrl_extensions.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_ctrl_extensions.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,57 +1,57 @@ - - - - - -Controlling C++ Extensions - - - -

Controlling C++ Extensions

-

The C++ compiler has additional extensions that you can activate using the pragma cpp_extensions.

-

If you enable this pragma, the compiler lets you use the following extensions to the ISO C++ standard:

- -
-

#pragma cpp_extensions on
- void foo()
- {
- union {
- long hilo;
- struct { short hi, lo; };
- // anonymous struct
- };
- hi=0x1234;
- lo=0x5678;
- // hilo==0x12345678
- }

-
- -
-

#pragma cpp_extensions on
- struct Foo { void f(); }
- void Foo::f()
- {
- void (Foo::*ptmf1)() = &Foo::f;
- // ALWAYS OK
-
- void (Foo::*ptmf2)() = f;
- // OK if you enabled cpp_extensions.
- }

-
-

To check this setting, use the __option (cpp_extensions). By default, this setting is off.

-

See Checking Option Settings for information on how to use this directive.
-

- - - -


-

- - - - - + + + + + +Controlling C++ Extensions + + + +

Controlling C++ Extensions

+

The C++ compiler has additional extensions that you can activate using the pragma cpp_extensions.

+

If you enable this pragma, the compiler lets you use the following extensions to the ISO C++ standard:

+ +
+

#pragma cpp_extensions on
+ void foo()
+ {
+ union {
+ long hilo;
+ struct { short hi, lo; };
+ // anonymous struct
+ };
+ hi=0x1234;
+ lo=0x5678;
+ // hilo==0x12345678
+ }

+
+ +
+

#pragma cpp_extensions on
+ struct Foo { void f(); }
+ void Foo::f()
+ {
+ void (Foo::*ptmf1)() = &Foo::f;
+ // ALWAYS OK
+
+ void (Foo::*ptmf2)() = f;
+ // OK if you enabled cpp_extensions.
+ }

+
+

To check this setting, use the __option (cpp_extensions). By default, this setting is off.

+

See Checking Option Settings for information on how to use this directive.
+

+ + + +


+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_ctrl_rtti.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_ctrl_rtti.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_ctrl_rtti.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,17 +1,17 @@ - - - - - -Controlling RTTI - - - -

Controlling RTTI

-

The Carbide.c++ language supports runtime type information (RTTI), including the dynamic_cast and typeid operators. To use these operators, enable the Enable RTTI setting .

-

For more information on how to use these two operators, see Working with RTTI.

- - - - - + + + + + +Controlling RTTI + + + +

Controlling RTTI

+

The Carbide.c++ language supports runtime type information (RTTI), including the dynamic_cast and typeid operators. To use these operators, enable the Enable RTTI setting .

+

For more information on how to use these two operators, see Working with RTTI.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_ctrl_var_scope.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_ctrl_var_scope.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_ctrl_var_scope.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,25 +1,25 @@ - - - - - -Controlling Variable Scope in for Statements - - - -

Controlling Variable Scope in for Statements

-

If you enable the Legacy for-scoping setting , the compiler generates an error when it encounters a variable scope issue that the ISO C++ standard disallows, but is allowed in the C++ language specified in The Annotated C++ Reference Manual.

-

With this option off, the compiler allows variables defined in a for statement to have scope outside the for statement.

-
-

Listing 1. Example of a Local Variable Outside a for Statement

-

for(int i=1; i<1000; i++) { /* ... */ }
- return i; // OK in ARM, Error in Carbide.c++

-
-

This setting corresponds to the pragma ARM_conform. To check this setting, use __option (ARM_conform). By default, this setting is off.

-

See Checking Option Settings for information on how to use this directive.
-

- - - - - + + + + + +Controlling Variable Scope in for Statements + + + +

Controlling Variable Scope in for Statements

+

If you enable the Legacy for-scoping setting , the compiler generates an error when it encounters a variable scope issue that the ISO C++ standard disallows, but is allowed in the C++ language specified in The Annotated C++ Reference Manual.

+

With this option off, the compiler allows variables defined in a for statement to have scope outside the for statement.

+
+

Listing 1. Example of a Local Variable Outside a for Statement

+

for(int i=1; i<1000; i++) { /* ... */ }
+ return i; // OK in ARM, Error in Carbide.c++

+
+

This setting corresponds to the pragma ARM_conform. To check this setting, use __option (ARM_conform). By default, this setting is off.

+

See Checking Option Settings for information on how to use this directive.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_exceptions_working.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_exceptions_working.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_exceptions_working.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,23 +1,23 @@ - - - - - -Working with C++ Exceptions - - - -

Working with C++ Exceptions

-

If you enable the Enable C++ Exceptions setting , you can use the try and catch statements to perform exception handling. For more information on activating support for C++ exception handling, see “Controlling Exception Handling”.

-

Enabling exceptions lets you throw them across any code compiled by the Carbide C/C++ compiler. However, you cannot throw exceptions across the following:

- -

If you throw an exception across one of these, the code calls terminate() and exits.

-

If you throw an exception while allocating a class object or an array of class objects, the code automatically destructs the partially constructed objects and de-allocates the memory for them.

- - - - - + + + + + +Working with C++ Exceptions + + + +

Working with C++ Exceptions

+

If you enable the Enable C++ Exceptions setting , you can use the try and catch statements to perform exception handling. For more information on activating support for C++ exception handling, see “Controlling Exception Handling”.

+

Enabling exceptions lets you throw them across any code compiled by the Carbide C/C++ compiler. However, you cannot throw exceptions across the following:

+ +

If you throw an exception across one of these, the code calls terminate() and exits.

+

If you throw an exception while allocating a class object or an array of class objects, the code automatically destructs the partially constructed objects and de-allocates the memory for them.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_extensions.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_extensions.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_extensions.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,20 +1,20 @@ - - - - - -Carbide Implementation of C++ - - - -

Extensions to ISO Standard C++

-

This section describes Carbide extensions to the C standard that apply to all targets. In most cases, you turn the extension on or off with a setting . See C/C++ Language Panel for information about this panel.

-

The __PRETTY_FUNCTION__ Predefined Identifier

-

The __PRETTY_FUNCTION__ predefined identifier represents the qualified (unmangled) C++ name of the function being compiled.

-

For related information, see Predefined Symbols. -

- - - - - + + + + + +Carbide Implementation of C++ + + + +

Extensions to ISO Standard C++

+

This section describes Carbide extensions to the C standard that apply to all targets. In most cases, you turn the extension on or off with a setting . See C/C++ Language Panel for information about this panel.

+

The __PRETTY_FUNCTION__ Predefined Identifier

+

The __PRETTY_FUNCTION__ predefined identifier represents the qualified (unmangled) C++ name of the function being compiled.

+

For related information, see Predefined Symbols. +

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_impl_additional_keywords.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_impl_additional_keywords.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_impl_additional_keywords.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,16 +1,16 @@ - - - - - -Additional Keywords - - - -

Additional Keywords

-

(ISO C++, §2.8, §2.11) The Carbide.c++ language reserves symbols from these two sections as keywords.

- - - - - + + + + + +Additional Keywords + + + +

Additional Keywords

+

(ISO C++, §2.8, §2.11) The Carbide.c++ language reserves symbols from these two sections as keywords.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_impl_default_args.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_impl_default_args.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_impl_default_args.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,22 +1,22 @@ - - - - - -Default Arguments in Member Functions - - - -

Default Arguments in Member Functions

-

(ISO C++, §8.3.6) The compiler does not bind default arguments in a member function at the end of the class declaration. Before the default argument appears, you must declare any value that you use in the default argument expression. An example using default arguments in member functions:

-

class foo {
- enum A { AA };
- int f(A a = AA); // OK
- int f(B b = BB); // ERROR: BB is not declared yet
- enum B { BB };
- };

- - - - - + + + + + +Default Arguments in Member Functions + + + +

Default Arguments in Member Functions

+

(ISO C++, §8.3.6) The compiler does not bind default arguments in a member function at the end of the class declaration. Before the default argument appears, you must declare any value that you use in the default argument expression. An example using default arguments in member functions:

+

class foo {
+ enum A { AA };
+ int f(A a = AA); // OK
+ int f(B b = BB); // ERROR: BB is not declared yet
+ enum B { BB };
+ };

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_impl_forward_decl.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_impl_forward_decl.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_impl_forward_decl.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,24 +1,24 @@ - - - - - -Forward Declarations of Arrays of Incomplete Type - - - -

Forward Declarations of Arrays of Incomplete Type

-

The Carbide.c++ compiler allows the forward declaration of arrays of incomplete type. An example of forward declaration of array of incomplete type:

-
-

extern struct incomplete arr[10];

-

struct incomplete {
- int a, b, c;
- };

-

struct incomplete arr[10]; -

-
- - - - - + + + + + +Forward Declarations of Arrays of Incomplete Type + + + +

Forward Declarations of Arrays of Incomplete Type

+

The Carbide.c++ compiler allows the forward declaration of arrays of incomplete type. An example of forward declaration of array of incomplete type:

+
+

extern struct incomplete arr[10];

+

struct incomplete {
+ int a, b, c;
+ };

+

struct incomplete arr[10]; +

+
+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_impl_implicit_return.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_impl_implicit_return.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_impl_implicit_return.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,25 +1,25 @@ - - - - - -Implicit Return Statement for main() - - - -

Implicit Return Statement for main()

-

In C++, the compiler adds a

-

return 0;

-

statement to the main() function of a program if the function returns an int result and does not end with a user return statement.

-

Examples:

-

int main() { } // equivalent to:
- // int main() { return 0; }
-
- main() { } // equivalent to:
- // int main() { return 0; }

-

If you enable the ANSI Strict setting , the compiler enforces an external int main() function.

- - - - - + + + + + +Implicit Return Statement for main() + + + +

Implicit Return Statement for main()

+

In C++, the compiler adds a

+

return 0;

+

statement to the main() function of a program if the function returns an int result and does not end with a user return statement.

+

Examples:

+

int main() { } // equivalent to:
+ // int main() { return 0; }
+
+ main() { } // equivalent to:
+ // int main() { return 0; }

+

If you enable the ANSI Strict setting , the compiler enforces an external int main() function.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_impl_inherited_members.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_impl_inherited_members.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_impl_inherited_members.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,47 +1,47 @@ - - - - - -Calling an Inherited Member Function - - - -

Calling an Inherited Member Function

-

(ISO C++, §10.3) You can call an inherited virtual member function rather than its local override in two ways. The first method is recommended for referring to member functions defined in a base class or any other parent class. The second method, while more convenient, is not recommended if you are using your source code with other compilers.

-

The standard method of calling inherited member functions

-

This method adheres to the ISO C++ Standard and simply qualifies the member function with its base class.

-

Assume you have two classes, MyBaseClass and MySubClass, each implementing a function named MyFunc().

-

From within a function of MySubClass, you can call the base class version of MyFunc() this way:

-

MyBaseClass::MyFunc();

-

However, if you change the class hierarchy, this call might break. Assume you introduce an intermediate class, and your hierarchy is now MyBaseClass, MyMiddleClass, and MySubClass. Each has a version of MyFunc(). The code above still calls the original version of MyFunc() in the MyBaseClass, bypassing the additional behavior you implemented in MyMiddleClass. This kind of subtlety in the code can lead to unexpected results or bugs that are difficult to locate.

-

Using inheritance to call inherited member functions

-

The def_inherited pragma defines an implicit inherited member for a base class. Use this directive before using the inherited symbol:

-

#pragma def_inherited on

-

WARNING! The ISO C++ standard does not support the use of inherited.

-

You can call the inherited version of MyFunc() this way:

-

inherited::MyFunc();

-

With the inherited symbol, the compiler identifies the base class at compile time. This line of code calls the immediate base class in both cases: where the base class is MyBaseClass, and where the immediate base class is MyMiddleClass.

-

If your class hierarchy changes at a later date and your subclass inherits from a different base class, the immediate base class is still called, despite the change in hierarchy.

-

The syntax is as follows:

-

inherited::func-name(param-list);

-

The statement calls the func-name in the class’s immediate base class. If the class has more than one immediate base class (because of multiple inheritance) and the compiler cannot decide which func-name to call, the compiler generates an error.

-

This example creates a Q class that draws its objects by adding behavior to the O class.

-
-
Listing 1. Using inherited to Call an Inherited Member Function
-

#pragma def_inherited on
- struct O { virtual void draw(int,int); };
- struct Q : O { void draw(int,int); };

-

void Q::draw (int x,int y)
- {
- inherited::draw(x,y); // Perform behavior of base class
- ... // Perform added behavior
- }

-
-

For related information on this pragma see “def_inherited”. -

- - - - - + + + + + +Calling an Inherited Member Function + + + +

Calling an Inherited Member Function

+

(ISO C++, §10.3) You can call an inherited virtual member function rather than its local override in two ways. The first method is recommended for referring to member functions defined in a base class or any other parent class. The second method, while more convenient, is not recommended if you are using your source code with other compilers.

+

The standard method of calling inherited member functions

+

This method adheres to the ISO C++ Standard and simply qualifies the member function with its base class.

+

Assume you have two classes, MyBaseClass and MySubClass, each implementing a function named MyFunc().

+

From within a function of MySubClass, you can call the base class version of MyFunc() this way:

+

MyBaseClass::MyFunc();

+

However, if you change the class hierarchy, this call might break. Assume you introduce an intermediate class, and your hierarchy is now MyBaseClass, MyMiddleClass, and MySubClass. Each has a version of MyFunc(). The code above still calls the original version of MyFunc() in the MyBaseClass, bypassing the additional behavior you implemented in MyMiddleClass. This kind of subtlety in the code can lead to unexpected results or bugs that are difficult to locate.

+

Using inheritance to call inherited member functions

+

The def_inherited pragma defines an implicit inherited member for a base class. Use this directive before using the inherited symbol:

+

#pragma def_inherited on

+

WARNING! The ISO C++ standard does not support the use of inherited.

+

You can call the inherited version of MyFunc() this way:

+

inherited::MyFunc();

+

With the inherited symbol, the compiler identifies the base class at compile time. This line of code calls the immediate base class in both cases: where the base class is MyBaseClass, and where the immediate base class is MyMiddleClass.

+

If your class hierarchy changes at a later date and your subclass inherits from a different base class, the immediate base class is still called, despite the change in hierarchy.

+

The syntax is as follows:

+

inherited::func-name(param-list);

+

The statement calls the func-name in the class’s immediate base class. If the class has more than one immediate base class (because of multiple inheritance) and the compiler cannot decide which func-name to call, the compiler generates an error.

+

This example creates a Q class that draws its objects by adding behavior to the O class.

+
+
Listing 1. Using inherited to Call an Inherited Member Function
+

#pragma def_inherited on
+ struct O { virtual void draw(int,int); };
+ struct Q : O { void draw(int,int); };

+

void Q::draw (int x,int y)
+ {
+ inherited::draw(x,y); // Perform behavior of base class
+ ... // Perform added behavior
+ }

+
+

For related information on this pragma see “def_inherited”. +

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_impl_keyword_ordering.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_impl_keyword_ordering.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_impl_keyword_ordering.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,22 +1,22 @@ - - - - - -Keyword Ordering - - - -

Keyword Ordering

-

(ISO C++, §7.1.2, §11.4) If you use the friend keyword in a declaration, it must be the first word in the declaration. The virtual keyword does not have to be the first word in a declaration. An example using the virtual or friend Keywords:

-

class foo {
- virtual int f0(); // OK
- int virtual f1(); // OK
- friend int f2(); // OK
- int friend f3(); // ERROR
- };

- - - - - + + + + + +Keyword Ordering + + + +

Keyword Ordering

+

(ISO C++, §7.1.2, §11.4) If you use the friend keyword in a declaration, it must be the first word in the declaration. The virtual keyword does not have to be the first word in a declaration. An example using the virtual or friend Keywords:

+

class foo {
+ virtual int f0(); // OK
+ int virtual f1(); // OK
+ friend int f2(); // OK
+ int friend f3(); // ERROR
+ };

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_impl_namespaces.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_impl_namespaces.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_impl_namespaces.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,34 +1,34 @@ - - - - - -Namespaces - - - -

Namespaces

-

Carbide supports namespaces, which provide the scope for identifiers. Listing 3.1 provides an example of how you define items in a namespace.

-

namespace NS
- {
- int foo();
- void bar();
- }

-

The above example defines an int variable named NS::foo and a function named NS::bar.

-

You can nest namespaces. For example, you can define an identifier as A::B::C::D::E where A, B, and C are nested namespaces and D is either another namespace or a class. You cannot use namespaces within class definitions.

-

You can rename namespaces for a module. For example:

-

namespace ENA = ExampleNamespaceAlpha;

-

creates a namespace alias called ENA for the original namespace ExampleNamespaceAlpha.

-

You can import items from a namespace. For example:

-

using namespace NS;

-

makes anything in NS visible in the current namespace without a qualifier. To limit the scope of an import, specify a single identifier. For example:

-

using NS::bar;

-

only exposes NS::bar as bar in the current space. This form of using is considered a declaration. So, the following statements:

-

using NS::foo;
- int foo;

-

are not allowed because foo is being redeclared in the current namespace, thereby masking the foo imported from NS.

- - - - - + + + + + +Namespaces + + + +

Namespaces

+

Carbide supports namespaces, which provide the scope for identifiers. Listing 3.1 provides an example of how you define items in a namespace.

+

namespace NS
+ {
+ int foo();
+ void bar();
+ }

+

The above example defines an int variable named NS::foo and a function named NS::bar.

+

You can nest namespaces. For example, you can define an identifier as A::B::C::D::E where A, B, and C are nested namespaces and D is either another namespace or a class. You cannot use namespaces within class definitions.

+

You can rename namespaces for a module. For example:

+

namespace ENA = ExampleNamespaceAlpha;

+

creates a namespace alias called ENA for the original namespace ExampleNamespaceAlpha.

+

You can import items from a namespace. For example:

+

using namespace NS;

+

makes anything in NS visible in the current namespace without a qualifier. To limit the scope of an import, specify a single identifier. For example:

+

using NS::bar;

+

only exposes NS::bar as bar in the current space. This form of using is considered a declaration. So, the following statements:

+

using NS::foo;
+ int foo;

+

are not allowed because foo is being redeclared in the current namespace, thereby masking the foo imported from NS.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_impl_vendor_abi.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_impl_vendor_abi.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_impl_vendor_abi.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,32 +1,32 @@ - - - - - -Vendor Independent C++ ABI - - - -

Vendor Independent C++ ABI

-

The Carbide.c++ compiler currently supports these parts of the vendor independent C++ application binary interface (ABI):

- -

The following features work but do not conform to the ABI specification:

- -

NOTE This ABI only works with some compiler targets.

-

For more information, see www.codesourcery.com/cxx-abi.

- - - - - + + + + + +Vendor Independent C++ ABI + + + +

Vendor Independent C++ ABI

+

The Carbide.c++ compiler currently supports these parts of the vendor independent C++ application binary interface (ABI):

+ +

The following features work but do not conform to the ABI specification:

+ +

NOTE This ABI only works with some compiler targets.

+

For more information, see www.codesourcery.com/cxx-abi.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_implementation.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_implementation.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_implementation.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - -Carbide Implementation of C++ - - - -

Carbide Implementation of C++

-

This section describes how the Carbide.c++ compiler implements certain parts of the C++ standard, as described in The Annotated C++ Reference Manual (Addison-Wesley) by Ellis and Stroustrup. The topics discussed in this section are:

- - - - - - + + + + + +Carbide Implementation of C++ + + + +

Carbide Implementation of C++

+

This section describes how the Carbide.c++ compiler implements certain parts of the C++ standard, as described in The Annotated C++ Reference Manual (Addison-Wesley) by Ellis and Stroustrup. The topics discussed in this section are:

+ + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_rtti_dynamic_cast.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_rtti_dynamic_cast.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_rtti_dynamic_cast.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,47 +1,47 @@ - - - - - -Using the dynamic_cast Operator - - - -

Using the dynamic_cast Operator

-

The dynamic_cast operator lets you safely convert a pointer of one type to a pointer of another type. Unlike an ordinary cast, dynamic_cast returns 0 if the conversion is not possible. An ordinary cast returns an unpredictable value that might crash your program if the conversion is not possible.

-

The syntax for the dynamic_cast operator is as follows:

-

dynamic_cast<Type*>(expr)

-

The Type must be either void or a class with at least one virtual member function. If the object to which expr points (*expr) is of type Type or derived from type Type, this expression converts expr to a pointer of type Type* and returns it. Otherwise, it returns 0, the null pointer.

-

For example, take these classes:

-

class Person { virtual void func(void) { ; } };
- class Athlete : public Person { /* . . . */ };
-class Superman : public Athlete { /* . . . */ };

-

And these pointers:

-

Person *lois = new Person;
- Person *arnold = new Athlete;
- Person *clark = new Superman;
-Athlete *a;

-

This is how dynamic_cast works with each pointer:

-

a = dynamic_cast<Athlete*>(arnold);
- // a is arnold, since arnold is an Athlete.
- a = dynamic_cast<Athlete*>(lois);
- // a is 0, since lois is not an Athelete.
- a = dynamic_cast<Athlete*>(clark);
-// a is clark, since clark is both a Superman and an Athlete.

-

You can also use the dynamic_cast operator with reference types. However, since there is no equivalent to the null pointer for references, dynamic_cast throws an exception of type std::bad_cast if it cannot perform the conversion.

-

This is an example of using dynamic_cast with a reference:

-

#include <exception>
- using namespace std;
- Person &superref = *clark;
- try {
- Person &ref = dynamic_cast<Person&>(superref);
- }
- catch(bad_cast) {
- cout << "oops!" << endl;
- } -

- - - - - + + + + + +Using the dynamic_cast Operator + + + +

Using the dynamic_cast Operator

+

The dynamic_cast operator lets you safely convert a pointer of one type to a pointer of another type. Unlike an ordinary cast, dynamic_cast returns 0 if the conversion is not possible. An ordinary cast returns an unpredictable value that might crash your program if the conversion is not possible.

+

The syntax for the dynamic_cast operator is as follows:

+

dynamic_cast<Type*>(expr)

+

The Type must be either void or a class with at least one virtual member function. If the object to which expr points (*expr) is of type Type or derived from type Type, this expression converts expr to a pointer of type Type* and returns it. Otherwise, it returns 0, the null pointer.

+

For example, take these classes:

+

class Person { virtual void func(void) { ; } };
+ class Athlete : public Person { /* . . . */ };
+class Superman : public Athlete { /* . . . */ };

+

And these pointers:

+

Person *lois = new Person;
+ Person *arnold = new Athlete;
+ Person *clark = new Superman;
+Athlete *a;

+

This is how dynamic_cast works with each pointer:

+

a = dynamic_cast<Athlete*>(arnold);
+ // a is arnold, since arnold is an Athlete.
+ a = dynamic_cast<Athlete*>(lois);
+ // a is 0, since lois is not an Athelete.
+ a = dynamic_cast<Athlete*>(clark);
+// a is clark, since clark is both a Superman and an Athlete.

+

You can also use the dynamic_cast operator with reference types. However, since there is no equivalent to the null pointer for references, dynamic_cast throws an exception of type std::bad_cast if it cannot perform the conversion.

+

This is an example of using dynamic_cast with a reference:

+

#include <exception>
+ using namespace std;
+ Person &superref = *clark;
+ try {
+ Person &ref = dynamic_cast<Person&>(superref);
+ }
+ catch(bad_cast) {
+ cout << "oops!" << endl;
+ } +

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_rtti_typeid_operator.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_rtti_typeid_operator.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_rtti_typeid_operator.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,50 +1,50 @@ - - - - - -Using the typeid Operator - - - -

Using the typeid Operator

-

The typeid operator lets you determine the type of an object. Like the sizeof operator, it takes two kinds of arguments:

- -

NOTE Whenever you use typeid operator, you must #include the typeinfo header file.

-

The typeid operator returns a reference to a std::type_info object that you can compare with the == and != operators. For example, if you have these classes and objects:

-
-

class Person { /* . . . */ };
- class Athlete : public Person { /* . . . */ };

-

using namespace std;

-

Person *lois = new Person;
- Athlete *arnold = new Athlete;
- Athlete *louganis = new Athlete;

-
-

All these expressions are true:

-

#include <typeinfo>
- // . . .
- if (typeid(Athlete) == typeid(*arnold))
- // arnold is an Athlete, result is true
- if (typeid(*arnold) == typeid(*louganis))
- // arnold and louganis are both Athletes, result is true
- if (typeid(*lois) == typeid(*arnold)) // ...
- // lois and arnold are not the same type, result is false

-

You can access the name of a type with the name() member function in the std::type_info class. For example, these statements:

-

#include <typeinfo>
- // . . .
- cout << "Lois is a(n) "
-<< typeid(*lois).name() << endl;
-cout << "Arnold is a(n) "
-<< typeid(*arnold).name() << endl;

-

Print this:

-

Lois is a(n) Person
- Arnold is a(n) Athlete
-

- - - - - + + + + + +Using the typeid Operator + + + +

Using the typeid Operator

+

The typeid operator lets you determine the type of an object. Like the sizeof operator, it takes two kinds of arguments:

+ +

NOTE Whenever you use typeid operator, you must #include the typeinfo header file.

+

The typeid operator returns a reference to a std::type_info object that you can compare with the == and != operators. For example, if you have these classes and objects:

+
+

class Person { /* . . . */ };
+ class Athlete : public Person { /* . . . */ };

+

using namespace std;

+

Person *lois = new Person;
+ Athlete *arnold = new Athlete;
+ Athlete *louganis = new Athlete;

+
+

All these expressions are true:

+

#include <typeinfo>
+ // . . .
+ if (typeid(Athlete) == typeid(*arnold))
+ // arnold is an Athlete, result is true
+ if (typeid(*arnold) == typeid(*louganis))
+ // arnold and louganis are both Athletes, result is true
+ if (typeid(*lois) == typeid(*arnold)) // ...
+ // lois and arnold are not the same type, result is false

+

You can access the name of a type with the name() member function in the std::type_info class. For example, these statements:

+

#include <typeinfo>
+ // . . .
+ cout << "Lois is a(n) "
+<< typeid(*lois).name() << endl;
+cout << "Arnold is a(n) "
+<< typeid(*arnold).name() << endl;

+

Print this:

+

Lois is a(n) Person
+ Arnold is a(n) Athlete
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_rtti_working.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_rtti_working.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_rtti_working.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,21 +1,21 @@ - - - - - -Working with RTTI - - - -

Working with RTTI

-

This section describes how to work with runtime type information features of C++ supported by the Carbide.c++ compiler. RTTI lets you cast an object of one type as another type, get information about objects, and compare their types at runtime.

-

The topics in this section are:

- - - - - - + + + + + +Working with RTTI + + + +

Working with RTTI

+

This section describes how to work with runtime type information features of C++ supported by the Carbide.c++ compiler. RTTI lets you cast an object of one type as another type, get information about objects, and compare their types at runtime.

+

The topics in this section are:

+ + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_templates_conformance.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_templates_conformance.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_templates_conformance.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,99 +1,99 @@ - - - - - -Better Template Conformance - - - -

Better Template Conformance

-

Versions 2.5 and later of Carbide.c++ enforces the ISO C++ standard more closely when translating templates than previous versions of Carbide.c++. By default this new template translation is off. To ensure that template source code follows the ISO C++ standard more closely, turn on the ISO C++ Template Parser option .

-

The compiler provides pragmas to help update your source code to the more conformant template features. The parse_func_templ pragma controls the new template features. The parse_mfunc_templ pragma controls the new template features for class member functions only. The pragma warn_no_typename warns for the missing use of the typename keyword required by the ISO C++ standard.

-

When using the new template parsing features, the compiler enforces more careful use of the typename and template keywords, and follows different rules for resolving names during declaration and instantiation than before.

-

A qualified name that refers to a type and that depends on a template parameter must begin with typename (ISO C++, §14.6). An example using the typename Keyword:

-

template <typename T> void f()
- {
- T::name *ptr; // ERROR: an attempt to multiply T::name by ptr
- typename T::name *ptr; // OK
- }

-

The compiler requires the template keyword at the end of “.” and “->” operators, and for qualified identifiers that depend on a template parameter. An example using the template Keyword:

-

template <typename T> void f(T* ptr)
- {
- ptr->f<int>(); // ERROR: f is less than int
- ptr->template f<int>(); // OK
- }

-

Names referred to inside a template declaration that are not dependent on the template declaration (that do not rely on template arguments) must be declared before the template’s declaration. These names are bound to the template declaration at the point where the template is defined. Bindings are not affected by definitions that are in scope at the point of instantiation. Listing 1 shows an example.

-
-

Listing 1. Binding Non-dependent Identifiers

-

void f(char);

-

template <typename T> void tmpl_func()
- {
- f(1); // Uses f(char); f(int) is not defined yet.
- g(); // ERROR: g() is not defined yet.
- }
- void g();
- void f(int);

-
-

Names of template arguments that are dependent in base classes must be explicitly qualified (ISO C++, §14.6.2). See Listing 2.

-
-

Listing 2. Qualifying Template Arguments in Base Classes

-

template <typename T> struct Base
- {
- void f();
- }
- template <typename T> struct Derive: Base<T>
- {
- void g()
- {
- f(); // ERROR: Base<T>::f() is not visible.
- Base<T>::f(); // OK
- }
- }

-
-

When a template contains a function call in which at least one of the function’s arguments is type-dependent, the compiler uses the name of the function in the context of the template definition (ISO C++, §14.6.2.2) and the context of its instantiation (ISO C++, §14.6.4.2). Listing 3 shows an example.

-
-

Listing 3. Function Call with Type-dependent Argument

-

void f(char);

-

template <typename T> void type_dep_func()
- {
- f(1); // Uses f(char), above; f(int) is not declared yet.
- f(T()); // f() called with a type-dependent argument.
- }

-

void f(int);
- struct A{};
- void f(A);

-

int main()
- {
- type_dep_func<int>(); // Calls f(char) twice.
- type_dep_func<A>(); // Calls f(char) and f(A);
- return 0;
- }

-
-

The compiler only uses external names to look up type-dependent arguments in function calls.

-

static void f(int); // f() is internal.
- template <typename T> void type_dep_fun_ext()
- {
- f(T()); // f() called with a type-dependent argument.
-}
-
-int main()
- {
- type_dep_fun_ext<int>(); // ERROR: f(int) must be external.
-}

-

The compiler does not allow expressions in inline assembly statements that depend on template parameters.

-

template <typename T> void asm_tmpl()
- {
- asm { move #sizeof(T), D0 ); // ERROR: Not yet supported.
- }

-

The compiler also supports the address of template-id rules.

-

template <typename T> void foo(T) {}
- template <typename T> void bar(T) {}
- ...
- foo{ &bar<int> ); // now accepted
-

- - - - - + + + + + +Better Template Conformance + + + +

Better Template Conformance

+

Versions 2.5 and later of Carbide.c++ enforces the ISO C++ standard more closely when translating templates than previous versions of Carbide.c++. By default this new template translation is off. To ensure that template source code follows the ISO C++ standard more closely, turn on the ISO C++ Template Parser option .

+

The compiler provides pragmas to help update your source code to the more conformant template features. The parse_func_templ pragma controls the new template features. The parse_mfunc_templ pragma controls the new template features for class member functions only. The pragma warn_no_typename warns for the missing use of the typename keyword required by the ISO C++ standard.

+

When using the new template parsing features, the compiler enforces more careful use of the typename and template keywords, and follows different rules for resolving names during declaration and instantiation than before.

+

A qualified name that refers to a type and that depends on a template parameter must begin with typename (ISO C++, §14.6). An example using the typename Keyword:

+

template <typename T> void f()
+ {
+ T::name *ptr; // ERROR: an attempt to multiply T::name by ptr
+ typename T::name *ptr; // OK
+ }

+

The compiler requires the template keyword at the end of “.” and “->” operators, and for qualified identifiers that depend on a template parameter. An example using the template Keyword:

+

template <typename T> void f(T* ptr)
+ {
+ ptr->f<int>(); // ERROR: f is less than int
+ ptr->template f<int>(); // OK
+ }

+

Names referred to inside a template declaration that are not dependent on the template declaration (that do not rely on template arguments) must be declared before the template’s declaration. These names are bound to the template declaration at the point where the template is defined. Bindings are not affected by definitions that are in scope at the point of instantiation. Listing 1 shows an example.

+
+

Listing 1. Binding Non-dependent Identifiers

+

void f(char);

+

template <typename T> void tmpl_func()
+ {
+ f(1); // Uses f(char); f(int) is not defined yet.
+ g(); // ERROR: g() is not defined yet.
+ }
+ void g();
+ void f(int);

+
+

Names of template arguments that are dependent in base classes must be explicitly qualified (ISO C++, §14.6.2). See Listing 2.

+
+

Listing 2. Qualifying Template Arguments in Base Classes

+

template <typename T> struct Base
+ {
+ void f();
+ }
+ template <typename T> struct Derive: Base<T>
+ {
+ void g()
+ {
+ f(); // ERROR: Base<T>::f() is not visible.
+ Base<T>::f(); // OK
+ }
+ }

+
+

When a template contains a function call in which at least one of the function’s arguments is type-dependent, the compiler uses the name of the function in the context of the template definition (ISO C++, §14.6.2.2) and the context of its instantiation (ISO C++, §14.6.4.2). Listing 3 shows an example.

+
+

Listing 3. Function Call with Type-dependent Argument

+

void f(char);

+

template <typename T> void type_dep_func()
+ {
+ f(1); // Uses f(char), above; f(int) is not declared yet.
+ f(T()); // f() called with a type-dependent argument.
+ }

+

void f(int);
+ struct A{};
+ void f(A);

+

int main()
+ {
+ type_dep_func<int>(); // Calls f(char) twice.
+ type_dep_func<A>(); // Calls f(char) and f(A);
+ return 0;
+ }

+
+

The compiler only uses external names to look up type-dependent arguments in function calls.

+

static void f(int); // f() is internal.
+ template <typename T> void type_dep_fun_ext()
+ {
+ f(T()); // f() called with a type-dependent argument.
+}
+
+int main()
+ {
+ type_dep_fun_ext<int>(); // ERROR: f(int) must be external.
+}

+

The compiler does not allow expressions in inline assembly statements that depend on template parameters.

+

template <typename T> void asm_tmpl()
+ {
+ asm { move #sizeof(T), D0 ); // ERROR: Not yet supported.
+ }

+

The compiler also supports the address of template-id rules.

+

template <typename T> void foo(T) {}
+ template <typename T> void bar(T) {}
+ ...
+ foo{ &bar<int> ); // now accepted
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_templates_declaring.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_templates_declaring.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_templates_declaring.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,54 +1,54 @@ - - - - - -Providing declarations when declaring the template - - - -

Providing declarations when declaring the template

-

Carbide.c++ processes any declarations in a template when the template is declared, not when it is instantiated.

-

Although the C++ compiler currently accepts declarations in templates that are not available when the template is declared, future versions of the compiler will not. Listing 1 shows some examples.

-
-
Listing 1. Declarations in Template Declarations
-

// You must define names in a class template declaration

-

struct bar;
- template<typename T> struct foo {
- bar *member; // OK
- };
- struct bar { };
- foo<int> fi;

-

// Names in template argument dependent base classes:

-

template<typename T> struct foo {
- typedef T *tptr;
- };

-

template<typename T> struct foo {
- typedef T *tptr;
- };
- template<typename T> struct bar : foo<T> {
- typename foo<T>::tptr member; // OK
- };

-

// The correct usage of typename in template argument
- // dependent qualified names in some contexts:

-

template<class T> struct X {
- typedef X *xptr;
- xptr f();
- };
- template<class T> X<T>::xptr X<T>::f() // 'typename' missing
- {
- return 0;
- }

-

// Workaround: Use 'typename':

-

template<class T> typename X<T>::xptr X<T>::f() // OK
- {
- return 0;
- }
- -

-
- - - - - + + + + + +Providing declarations when declaring the template + + + +

Providing declarations when declaring the template

+

Carbide.c++ processes any declarations in a template when the template is declared, not when it is instantiated.

+

Although the C++ compiler currently accepts declarations in templates that are not available when the template is declared, future versions of the compiler will not. Listing 1 shows some examples.

+
+
Listing 1. Declarations in Template Declarations
+

// You must define names in a class template declaration

+

struct bar;
+ template<typename T> struct foo {
+ bar *member; // OK
+ };
+ struct bar { };
+ foo<int> fi;

+

// Names in template argument dependent base classes:

+

template<typename T> struct foo {
+ typedef T *tptr;
+ };

+

template<typename T> struct foo {
+ typedef T *tptr;
+ };
+ template<typename T> struct bar : foo<T> {
+ typename foo<T>::tptr member; // OK
+ };

+

// The correct usage of typename in template argument
+ // dependent qualified names in some contexts:

+

template<class T> struct X {
+ typedef X *xptr;
+ xptr f();
+ };
+ template<class T> X<T>::xptr X<T>::f() // 'typename' missing
+ {
+ return 0;
+ }

+

// Workaround: Use 'typename':

+

template<class T> typename X<T>::xptr X<T>::f() // OK
+ {
+ return 0;
+ }
+ +

+
+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_templates_defining.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_templates_defining.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_templates_defining.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,89 +1,89 @@ - - - - - -Declaring and Defining Templates - - - -

Declaring and Defining Templates

-

In a header file, declare your class functions and function templates, as shown in Listing 3.9.

-
-

Listing 1. templ.h: A Template Declaration File

-

template <class T>
- class Templ {
- T member;
- public:
- Templ(T x) { member=x; }
- T Get();
- };
-
- template <class T>
- T Max(T,T);

-
-

In a source file, include the header file, then define the function templates and the member functions of the class templates. Listing 3.10 shows you an example.

-

This source file is a template definition file, which you include in any file that uses your templates. You do not need to add the template definition file to your project. Although this is technically a source file, you work with it as if it were a header file.

-

The template definition file does not generate code. The compiler cannot generate code for a template until you specify what values it should substitute for the template arguments. Specifying these values is called instantiating the template. See Instantiating a Template.

-
-

Listing 2. templ.cp: A Template Definition File

-

#include "templ.h"
-
- template <class T>
- T Templ<T>::Get()
- {
- return member;
- }
-
- template <class T>
- T Max(T x, T y)
- {
- return ((x>y)?x:y);
- }

-
-

WARNING! Do not include the original template declaration file, which ends in .h, in your source file. Otherwise, the compiler generates an error saying that the function or class is undefined.

-

Providing declarations when declaring the template

-

Carbide.c++ processes any declarations in a template when the template is declared, not when it is instantiated.

-

Although the C++ compiler currently accepts declarations in templates that are not available when the template is declared, future versions of the compiler will not. Listing 3.11 shows some examples.

-
-
Listing 3.11 Declarations in Template Declarations
-

// You must define names in a class template declaration

-

struct bar;
- template<typename T> struct foo {
- bar *member; // OK
- };
- struct bar { };
- foo<int> fi;

-

// Names in template argument dependent base classes:

-

template<typename T> struct foo {
- typedef T *tptr;
- };

-

template<typename T> struct foo {
- typedef T *tptr;
- };
- template<typename T> struct bar : foo<T> {
- typename foo<T>::tptr member; // OK
- };

-

// The correct usage of typename in template argument
- // dependent qualified names in some contexts:

-

template<class T> struct X {
- typedef X *xptr;
- xptr f();
- };
- template<class T> X<T>::xptr X<T>::f() // 'typename' missing
- {
- return 0;
- }

-

// Workaround: Use 'typename':

-

template<class T> typename X<T>::xptr X<T>::f() // OK
- {
- return 0;
- }
- -

-
- - - - - + + + + + +Declaring and Defining Templates + + + +

Declaring and Defining Templates

+

In a header file, declare your class functions and function templates, as shown in Listing 3.9.

+
+

Listing 1. templ.h: A Template Declaration File

+

template <class T>
+ class Templ {
+ T member;
+ public:
+ Templ(T x) { member=x; }
+ T Get();
+ };
+
+ template <class T>
+ T Max(T,T);

+
+

In a source file, include the header file, then define the function templates and the member functions of the class templates. Listing 3.10 shows you an example.

+

This source file is a template definition file, which you include in any file that uses your templates. You do not need to add the template definition file to your project. Although this is technically a source file, you work with it as if it were a header file.

+

The template definition file does not generate code. The compiler cannot generate code for a template until you specify what values it should substitute for the template arguments. Specifying these values is called instantiating the template. See Instantiating a Template.

+
+

Listing 2. templ.cp: A Template Definition File

+

#include "templ.h"
+
+ template <class T>
+ T Templ<T>::Get()
+ {
+ return member;
+ }
+
+ template <class T>
+ T Max(T x, T y)
+ {
+ return ((x>y)?x:y);
+ }

+
+

WARNING! Do not include the original template declaration file, which ends in .h, in your source file. Otherwise, the compiler generates an error saying that the function or class is undefined.

+

Providing declarations when declaring the template

+

Carbide.c++ processes any declarations in a template when the template is declared, not when it is instantiated.

+

Although the C++ compiler currently accepts declarations in templates that are not available when the template is declared, future versions of the compiler will not. Listing 3.11 shows some examples.

+
+
Listing 3.11 Declarations in Template Declarations
+

// You must define names in a class template declaration

+

struct bar;
+ template<typename T> struct foo {
+ bar *member; // OK
+ };
+ struct bar { };
+ foo<int> fi;

+

// Names in template argument dependent base classes:

+

template<typename T> struct foo {
+ typedef T *tptr;
+ };

+

template<typename T> struct foo {
+ typedef T *tptr;
+ };
+ template<typename T> struct bar : foo<T> {
+ typename foo<T>::tptr member; // OK
+ };

+

// The correct usage of typename in template argument
+ // dependent qualified names in some contexts:

+

template<class T> struct X {
+ typedef X *xptr;
+ xptr f();
+ };
+ template<class T> X<T>::xptr X<T>::f() // 'typename' missing
+ {
+ return 0;
+ }

+

// Workaround: Use 'typename':

+

template<class T> typename X<T>::xptr X<T>::f() // OK
+ {
+ return 0;
+ }
+ +

+
+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_templates_instant_auto.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_templates_instant_auto.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_templates_instant_auto.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,29 +1,29 @@ - - - - - -Instantiating a Template: Automatic - - - -

Automatic instantiation

-

To instantiate templates automatically, include the template definition file in all source files that use the template, then use the template members like any other type or function. The compiler automatically generates code for a template instantiation whenever it sees a new one. Listing 1 shows how to automatically instantiate the templates for class Templ and class Max.

-
-

Listing 1. myprog.cp: A Source File that Uses Templates

-

#include <iostreams.h>
- #include "templ.cp" // includes templ.h as well

-

void main(void) {
- Templ<long> a = 1, b = 2;
- // The compiler instantiates Templ<long> here.
- cout << Max(a.Get(), b.Get());
- // The compiler instantiates Max<long>() here.
- };

-
-

If you use automatic instantiation, the compiler might take longer to translate your program because the compiler has to determine on its own which instantiations you need. It also scatters the object code for the template instantiations throughout your program.
-

- - - - - + + + + + +Instantiating a Template: Automatic + + + +

Automatic instantiation

+

To instantiate templates automatically, include the template definition file in all source files that use the template, then use the template members like any other type or function. The compiler automatically generates code for a template instantiation whenever it sees a new one. Listing 1 shows how to automatically instantiate the templates for class Templ and class Max.

+
+

Listing 1. myprog.cp: A Source File that Uses Templates

+

#include <iostreams.h>
+ #include "templ.cp" // includes templ.h as well

+

void main(void) {
+ Templ<long> a = 1, b = 2;
+ // The compiler instantiates Templ<long> here.
+ cout << Max(a.Get(), b.Get());
+ // The compiler instantiates Max<long>() here.
+ };

+
+

If you use automatic instantiation, the compiler might take longer to translate your program because the compiler has to determine on its own which instantiations you need. It also scatters the object code for the template instantiations throughout your program.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_templates_instant_explicit.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_templates_instant_explicit.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_templates_instant_explicit.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,42 +1,42 @@ - - - - - -Instantiating a Template: Implicit - - - -

Explicit instantiation

-

To instantiate templates explicitly, include the template definition file in a source file, and write a template instantiation statement for every instantiation. The syntax for a class template instantiation is as follows:

-

template class class-name<templ-specs>;

-

The syntax for a function template instantiation is as follows:

-

template return-type func-name<templ-specs>(arg-specs);

-

Listing 1 shows how to explicitly instantiate the templates in Listing 3.9 and Listing 3.10.

-
-

Listing 1. myinst.cp: Explicitly Instantiating Templates

-

#include "templ.cp"

-

template class Templ<long>; // class instantiation
- template long Max<long>(long,long); // function instantiation

-
-

When you explicitly instantiate a function, you do not need to include in templ-specs any arguments that the compiler can deduce from arg-specs. For example, in Listing 1 you can instantiate Max<long>() like this:

-

template long Max<>(long, long);
- // The compiler can tell from the arguments
-// that you are instantiating Max<long>()

-

Use explicit instantiation to make your program compile faster. Because the instantiations can be in one file with no other code, you can even put them in a separate library.

-

The compiler also supports the explicit instantiation of non-template members. Listing 2 shows an example.

-
-
Listing 2. Explicit Instantiation of Non-Template Members
-

template <class T> struct X {
- static T i;
- };

-

template <class T> T X<T>::i = 1;
- template char X<char>::i;

-
-

NOTE Explicit instantiation is not in the ARM but is part of the ISO C++ standard.
-

- - - - - + + + + + +Instantiating a Template: Implicit + + + +

Explicit instantiation

+

To instantiate templates explicitly, include the template definition file in a source file, and write a template instantiation statement for every instantiation. The syntax for a class template instantiation is as follows:

+

template class class-name<templ-specs>;

+

The syntax for a function template instantiation is as follows:

+

template return-type func-name<templ-specs>(arg-specs);

+

Listing 1 shows how to explicitly instantiate the templates in Listing 3.9 and Listing 3.10.

+
+

Listing 1. myinst.cp: Explicitly Instantiating Templates

+

#include "templ.cp"

+

template class Templ<long>; // class instantiation
+ template long Max<long>(long,long); // function instantiation

+
+

When you explicitly instantiate a function, you do not need to include in templ-specs any arguments that the compiler can deduce from arg-specs. For example, in Listing 1 you can instantiate Max<long>() like this:

+

template long Max<>(long, long);
+ // The compiler can tell from the arguments
+// that you are instantiating Max<long>()

+

Use explicit instantiation to make your program compile faster. Because the instantiations can be in one file with no other code, you can even put them in a separate library.

+

The compiler also supports the explicit instantiation of non-template members. Listing 2 shows an example.

+
+
Listing 2. Explicit Instantiation of Non-Template Members
+

template <class T> struct X {
+ static T i;
+ };

+

template <class T> T X<T>::i = 1;
+ template char X<char>::i;

+
+

NOTE Explicit instantiation is not in the ARM but is part of the ISO C++ standard.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_templates_instantiating.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_templates_instantiating.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_templates_instantiating.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,24 +1,24 @@ - - - - - -Instantiating a Template - - - -

Instantiating a Template

-

The compiler cannot generate code for a template until you:

- -

For information on the first two requirements, see Declaring and Defining Templates.

-

Specifying the data type(s) and other arguments for a template is called instantiating the template. Carbide.c++ gives you two ways to instantiate a template. You can let the compiler instantiate it automatically when you first use it, or you can explicitly create all the instantiations you expect to use.
-

- - - - - + + + + + +Instantiating a Template + + + +

Instantiating a Template

+

The compiler cannot generate code for a template until you:

+ +

For information on the first two requirements, see Declaring and Defining Templates.

+

Specifying the data type(s) and other arguments for a template is called instantiating the template. Carbide.c++ gives you two ways to instantiate a template. You can let the compiler instantiate it automatically when you first use it, or you can explicitly create all the instantiations you expect to use.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_templates_working.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_templates_working.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_templates_working.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - -Working with Templates - - - -

Working with Templates

-

(ISO C++, §14) This section describes how to organize your template declarations and definitions in files. It also describes how to explicitly instantiate templates using a syntax that is not in the ARM but is part of the ISO C++ standard.

-

This section includes the following topics:

- - - - - - + + + + + +Working with Templates + + + +

Working with Templates

+

(ISO C++, §14) This section describes how to organize your template declarations and definitions in files. It also describes how to explicitly instantiate templates using a syntax that is not in the ARM but is part of the ISO C++ standard.

+

This section includes the following topics:

+ + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/emb_systems/emb_activating.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/emb_systems/emb_activating.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/emb_systems/emb_activating.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,18 +1,18 @@ - - - - - -C++ and Embedded Systems - - - -

Activating EC++

-

To compile EC++ source code, enable the EC++ Compatibility Mode setting .

-

To test for EC++ compatibility mode at compile time, use the __embedded_cplusplus predefined symbol. For more information, see “Predefined Symbols”. -

- - - - - + + + + + +C++ and Embedded Systems + + + +

Activating EC++

+

To compile EC++ source code, enable the EC++ Compatibility Mode setting .

+

To test for EC++ compatibility mode at compile time, use the __embedded_cplusplus predefined symbol. For more information, see “Predefined Symbols”. +

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/emb_systems/emb_code_compiler.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/emb_systems/emb_code_compiler.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/emb_systems/emb_code_compiler.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,33 +1,33 @@ - - - - - -Compiler-related strategies - - - -

Compiler-related Strategies

-

Compiler-related strategies rely on compiler features to reduce object code size.

- -

Size Optimizations

-

Carbide compilers include optimization settings for size or speed and various levels of optimization. Choose size as your desired outcome and the level of optimization to apply.

-

Optimization settings for your target are controlled by settings in the Processor panel.

-

When debugging, compile your code without any optimizations. Some optimizations disrupt the relationship between the source and object code required by the debugger. Optimize your code after you have finished debugging.

-

See also C/C++ Language Panel.

-

Inlining

-

With Carbide, you can disable inlining, allow normal inlining, auto-inline, or set the maximum depth of inlining.

-

Inlining can reduce or increase code size. There is no definite answer for this question. Inlining small functions can make a program smaller, especially if you have a class library with a lot of getter/setter member functions.

-

However, MSL C++ defines many functions as inline, which is not good if you want minimal code size. For optimal code size when using MSL C++, disable inlining when building the library. If you are not using MSL C++, normal inlining and a common-sense use of the keyword inline might improve your code size.

-

In Carbide, you control inlining as a language setting .

-

When debugging your code, disable inlining to maintain a clear correspondence between source and object code. After debugging, set the inlining level that has the best effect on your object code.

-

See also Inlining. -

- - - - - + + + + + +Compiler-related strategies + + + +

Compiler-related Strategies

+

Compiler-related strategies rely on compiler features to reduce object code size.

+ +

Size Optimizations

+

Carbide compilers include optimization settings for size or speed and various levels of optimization. Choose size as your desired outcome and the level of optimization to apply.

+

Optimization settings for your target are controlled by settings in the Processor panel.

+

When debugging, compile your code without any optimizations. Some optimizations disrupt the relationship between the source and object code required by the debugger. Optimize your code after you have finished debugging.

+

See also C/C++ Language Panel.

+

Inlining

+

With Carbide, you can disable inlining, allow normal inlining, auto-inline, or set the maximum depth of inlining.

+

Inlining can reduce or increase code size. There is no definite answer for this question. Inlining small functions can make a program smaller, especially if you have a class library with a lot of getter/setter member functions.

+

However, MSL C++ defines many functions as inline, which is not good if you want minimal code size. For optimal code size when using MSL C++, disable inlining when building the library. If you are not using MSL C++, normal inlining and a common-sense use of the keyword inline might improve your code size.

+

In Carbide, you control inlining as a language setting .

+

When debugging your code, disable inlining to maintain a clear correspondence between source and object code. After debugging, set the inlining level that has the best effect on your object code.

+

See also Inlining. +

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/emb_systems/emb_code_language.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/emb_systems/emb_code_language.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/emb_systems/emb_code_language.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,40 +1,40 @@ - - - - - -Language-related strategies - - - -

Language-related Strategies

-

Language-related strategies limit or avoid the use of ISO C++ features. While these features can make software design and maintenance easier, they can also increase code size.

- -

Virtual Functions

-

For optimal code size, do not use virtual functions unless absolutely necessary. A virtual function is never dead-stripped, even if it is never called.

-

Runtime Type Identification

-

If code size is an issue, do not use RTTI because it generates a data table for every class. Disabling RTTI decreases the size of the data section.

-

The EC++ proposal does not allow runtime type identification.

-

See also “Controlling RTTI”.

-

Exception Handling

-

If you must handle exceptions, be careful when using C++ exception handling routines. Carbide has a zero runtime overhead error handling mechanism. However, using exceptions does increase code size, particularly the exception tables data.

-

The EC++ proposal does not allow exception handling.

-

NOTE The proposed ISO standard libraries and the use of the new operator require exception handling.

-

Operator New

-

The C++ new operator might throw an exception, depending on how the runtime library implements the new operator. To make the new operator throw exceptions, set __throws_bad_alloc to 1 in the prefix file for your target and rebuild your library. To prevent the new operator from throwing exceptions, set __throws_bad_alloc to 0 in the prefix file for your target and rebuild your library.

-

See your release notes or Targeting manual for more information.

-

Multiple and Virtual Inheritance

-

Implementing multiple inheritance requires a modest amount of code and data overhead. The EC++ proposal does not allow multiple inheritance.

-

For optimal code size, do not use virtual inheritance. Virtual base classes are often complex and add a lot of code to the constructor and destructor functions.

-

The EC++ proposal does not allow virtual inheritance.

- - - - - + + + + + +Language-related strategies + + + +

Language-related Strategies

+

Language-related strategies limit or avoid the use of ISO C++ features. While these features can make software design and maintenance easier, they can also increase code size.

+ +

Virtual Functions

+

For optimal code size, do not use virtual functions unless absolutely necessary. A virtual function is never dead-stripped, even if it is never called.

+

Runtime Type Identification

+

If code size is an issue, do not use RTTI because it generates a data table for every class. Disabling RTTI decreases the size of the data section.

+

The EC++ proposal does not allow runtime type identification.

+

See also “Controlling RTTI”.

+

Exception Handling

+

If you must handle exceptions, be careful when using C++ exception handling routines. Carbide has a zero runtime overhead error handling mechanism. However, using exceptions does increase code size, particularly the exception tables data.

+

The EC++ proposal does not allow exception handling.

+

NOTE The proposed ISO standard libraries and the use of the new operator require exception handling.

+

Operator New

+

The C++ new operator might throw an exception, depending on how the runtime library implements the new operator. To make the new operator throw exceptions, set __throws_bad_alloc to 1 in the prefix file for your target and rebuild your library. To prevent the new operator from throwing exceptions, set __throws_bad_alloc to 0 in the prefix file for your target and rebuild your library.

+

See your release notes or Targeting manual for more information.

+

Multiple and Virtual Inheritance

+

Implementing multiple inheritance requires a modest amount of code and data overhead. The EC++ proposal does not allow multiple inheritance.

+

For optimal code size, do not use virtual inheritance. Virtual base classes are often complex and add a lot of code to the constructor and destructor functions.

+

The EC++ proposal does not allow virtual inheritance.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/emb_systems/emb_code_library.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/emb_systems/emb_code_library.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/emb_systems/emb_code_library.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,28 +1,28 @@ - - - - - -Library-related strategies - - - -

Library-related strategies

-

Library related strategies include:

- -

Stream-Based Classes

-

MSL C++ stream-based classes initialize several instances of direct and indirect objects. When code size is critical, do not use stream-based classes, which include standard input (cin), standard output (cout), and standard error (cerr). There are also wide-character equivalents for the normal input and output routines. Use only standard C input and output functions unless stream-based classes are absolutely necessary.

-

In addition to the standard C++ stream classes, avoid using string streams for in-core formatting because they generate heavy overhead. If size is critical, use C’s sprintf or sscanf functions instead.

-

The EC++ proposal does not support templatized classes or functions. MSL adheres to the ISO proposed standards that are template-based.

-

Alternative Class Libraries

-

MSL C++ is based on the ISO proposed C++ standard, which is implemented using templates that have a large initial overhead for specialization.

-

To avoid this overhead, consider devising your own commonly-used vector, string, or utility classes. You can also use other class libraries, such as the NIH's (National Institute of Health) Class Library. If you do use an alternative library, beware of potential problems with virtual inheritance, RTTI, or other causes of larger code size as described above. -

- - - - - + + + + + +Library-related strategies + + + +

Library-related strategies

+

Library related strategies include:

+ +

Stream-Based Classes

+

MSL C++ stream-based classes initialize several instances of direct and indirect objects. When code size is critical, do not use stream-based classes, which include standard input (cin), standard output (cout), and standard error (cerr). There are also wide-character equivalents for the normal input and output routines. Use only standard C input and output functions unless stream-based classes are absolutely necessary.

+

In addition to the standard C++ stream classes, avoid using string streams for in-core formatting because they generate heavy overhead. If size is critical, use C’s sprintf or sscanf functions instead.

+

The EC++ proposal does not support templatized classes or functions. MSL adheres to the ISO proposed standards that are template-based.

+

Alternative Class Libraries

+

MSL C++ is based on the ISO proposed C++ standard, which is implemented using templates that have a large initial overhead for specialization.

+

To avoid this overhead, consider devising your own commonly-used vector, string, or utility classes. You can also use other class libraries, such as the NIH's (National Institute of Health) Class Library. If you do use an alternative library, beware of potential problems with virtual inheritance, RTTI, or other causes of larger code size as described above. +

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/emb_systems/emb_differences.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/emb_systems/emb_differences.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/emb_systems/emb_differences.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,35 +1,35 @@ - - - - - -Differences Between ISO C++ and EC++ - - - -

Differences Between ISO C++ and EC++

-

The EC++ proposal does not support the following ISO C++ (ANSI C++) features.

-

Templates

-

ANSI C++ supports templates. The EC++ proposal does not include template support for class or functions.

-

Libraries

-

The EC++ proposal supports the <string>, <complex>, <ios>, <streambuf>, <istream>, and <ostream> classes, but only in a non-template form. The EC++ specifications do not support any other ANSI C++ libraries, including the STL-type algorithm libraries.

-

File Operations

-

The EC++ proposal does not support any file operations except simple console input and output file types.

-

Localization

-

The EC++ proposal does not contain localization libraries because of the excessive memory requirements.

-

Exception Handling

-

The EC++ proposal does not support exception handling.

-

Unsupported Language Features

-

The EC++ proposal does not support the following language features:

- - - - - - + + + + + +Differences Between ISO C++ and EC++ + + + +

Differences Between ISO C++ and EC++

+

The EC++ proposal does not support the following ISO C++ (ANSI C++) features.

+

Templates

+

ANSI C++ supports templates. The EC++ proposal does not include template support for class or functions.

+

Libraries

+

The EC++ proposal supports the <string>, <complex>, <ios>, <streambuf>, <istream>, and <ostream> classes, but only in a non-template form. The EC++ specifications do not support any other ANSI C++ libraries, including the STL-type algorithm libraries.

+

File Operations

+

The EC++ proposal does not support any file operations except simple console input and output file types.

+

Localization

+

The EC++ proposal does not contain localization libraries because of the excessive memory requirements.

+

Exception Handling

+

The EC++ proposal does not support exception handling.

+

Unsupported Language Features

+

The EC++ proposal does not support the following language features:

+ + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/emb_systems/emb_smaller_code.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/emb_systems/emb_smaller_code.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/emb_systems/emb_smaller_code.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,24 +1,24 @@ - - - - - -Obtaining Smaller Code Size in C++ - - - -

Obtaining Smaller Code Size in C++

-

Consider the following C++ programming strategies to ensure optimal code size:

- -

NOTE In all strategies, reducing object code size can affect program performance.

-

The EC++ proposal uses some of these strategies as part of its specification. Other strategies apply to C++ programming in general. Any C++ program can use these strategies, regardless of whether it follows the EC++ proposal or not. -

- - - - - + + + + + +Obtaining Smaller Code Size in C++ + + + +

Obtaining Smaller Code Size in C++

+

Consider the following C++ programming strategies to ensure optimal code size:

+ +

NOTE In all strategies, reducing object code size can affect program performance.

+

The EC++ proposal uses some of these strategies as part of its specification. Other strategies apply to C++ programming in general. Any C++ program can use these strategies, regardless of whether it follows the EC++ proposal or not. +

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/emb_systems/emb_specifications.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/emb_systems/emb_specifications.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/emb_systems/emb_specifications.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - -EC++ Specifications - - - -

EC++ Specifications

-

This section describes how to design software that adhere to the EC++ proposal.

-

Language Related Issues

-

To make sure your source code complies with both ISO C++ and EC++ standards, follow these guidelines:

- -

You can disable certain C++ features, such as RTTI and exceptions, using the compiler settings in the C++ Language panel, described in C/C++ Language Panel

-

Library-Related Issues

-

Do not refer to routines, data structures, and classes in the Metrowerks Standard Library (MSL) for C++. -

- - - - - + + + + + +EC++ Specifications + + + +

EC++ Specifications

+

This section describes how to design software that adhere to the EC++ proposal.

+

Language Related Issues

+

To make sure your source code complies with both ISO C++ and EC++ standards, follow these guidelines:

+ +

You can disable certain C++ features, such as RTTI and exceptions, using the compiler settings in the C++ Language panel, described in C/C++ Language Panel

+

Library-Related Issues

+

Do not refer to routines, data structures, and classes in the Metrowerks Standard Library (MSL) for C++. +

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/emb_systems/emb_systems.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/emb_systems/emb_systems.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/emb_systems/emb_systems.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,23 +1,23 @@ - - - - - -C++ and Embedded Systems - - - -

C++ and Embedded Systems

-

This section describes how to develop software for embedded systems using Carbide.c++ compilers. Embedded systems topics include:

- -

NOTE This chapter discusses program design strategies for embedded systems and is not meant to be a definitive solution. Currently, you can use the Carbide.c++ compiler to develop embedded systems that are compatible with Embedded C++ (EC++).

- - - - - + + + + + +C++ and Embedded Systems + + + +

C++ and Embedded Systems

+

This section describes how to develop software for embedded systems using Carbide.c++ compilers. Embedded systems topics include:

+ +

NOTE This chapter discusses program design strategies for embedded systems and is not meant to be a definitive solution. Currently, you can use the Carbide.c++ compiler to develop embedded systems that are compatible with Embedded C++ (EC++).

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_as_warnings.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_as_warnings.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_as_warnings.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,19 +1,19 @@ - - - - - -Warnings as Errors - - - -

Warnings as Errors

-

If you enable the Treat All Warnings as Errors setting, the compiler treats all warnings as though they were errors. It does not compile a file successfully until you resolve all warnings.

-

The Treat All Warnings as Errors setting corresponds to the pragma warning_errors. To check this setting, use __option (warning_errors).

-

See Checking Option Settings for information on how to use this directive.
-

- - - - - + + + + + +Warnings as Errors + + + +

Warnings as Errors

+

If you enable the Treat All Warnings as Errors setting, the compiler treats all warnings as though they were errors. It does not compile a file successfully until you resolve all warnings.

+

The Treat All Warnings as Errors setting corresponds to the pragma warning_errors. To check this setting, use __option (warning_errors).

+

See Checking Option Settings for information on how to use this directive.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_bad_conversions.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_bad_conversions.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_bad_conversions.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,20 +1,20 @@ - - - - - -Bad Conversions of Pointer Values - - - -

Bad Conversions of Pointer Values

-

Use either of the following pragmas to detect bad pointer value conversions:

- - - - - - + + + + + +Bad Conversions of Pointer Values + + + +

Bad Conversions of Pointer Values

+

Use either of the following pragmas to detect bad pointer value conversions:

+ + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_common.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_common.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_common.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,44 +1,44 @@ - - - - - -Common Errors - - - -

Common Errors

-

If you enable the Possible Errors setting, the compiler generates a warning if it encounters common errors such as the following:

- -
-

if (a=b) f(); // WARNING: a=b is an assignment
- if ((a=b)!=0) f(); // OK: (a=b)!=0 is a comparison, no warning
- if (a==b) f(); // OK: (a==b) is a comparison, no warning

-
- -
-

a == 0; // WARNING: This is a comparison.
- a = 0; // OK: This is an assignment, no warning

-
- -
-

while (i++); // WARNING: Unintended infinite loop

-

If you intended to create an infinite loop, put white space or a comment between the while statement and the semicolon.

-

These statements suppress the above errors or warnings.

-

while (i++) ; // OK: White space separation, no warning
- while (i++) /*: Comment separation, no warning */ ;

-
-

The Possible Errors setting corresponds to the pragma warn_possunwant. To check this setting, use __option (warn_possunwant).

-

See Checking Option Settings for information on how to use this directive.
-

- - - - - + + + + + +Common Errors + + + +

Common Errors

+

If you enable the Possible Errors setting, the compiler generates a warning if it encounters common errors such as the following:

+ +
+

if (a=b) f(); // WARNING: a=b is an assignment
+ if ((a=b)!=0) f(); // OK: (a=b)!=0 is a comparison, no warning
+ if (a==b) f(); // OK: (a==b) is a comparison, no warning

+
+ +
+

a == 0; // WARNING: This is a comparison.
+ a = 0; // OK: This is an assignment, no warning

+
+ +
+

while (i++); // WARNING: Unintended infinite loop

+

If you intended to create an infinite loop, put white space or a comment between the while statement and the semicolon.

+

These statements suppress the above errors or warnings.

+

while (i++) ; // OK: White space separation, no warning
+ while (i++) /*: Comment separation, no warning */ ;

+
+

The Possible Errors setting corresponds to the pragma warn_possunwant. To check this setting, use __option (warn_possunwant).

+

See Checking Option Settings for information on how to use this directive.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_empty_decl.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_empty_decl.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_empty_decl.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,22 +1,22 @@ - - - - - -Empty Declarations - - - -

Empty Declarations

-

If you enable the Empty Declarations setting, the compiler issues a warning when it encounters a declaration with no variable name.
-For example:

-

int ; // WARNING
- int i; // OK

-

The Empty Declarations setting corresponds to the pragma warn_emptydecl. To check this setting, use __option (warn_emptydecl).

-

See Checking Option Settings for information on how to use this directive.
-

- - - - - + + + + + +Empty Declarations + + + +

Empty Declarations

+

If you enable the Empty Declarations setting, the compiler issues a warning when it encounters a declaration with no variable name.
+For example:

+

int ; // WARNING
+ int i; // OK

+

The Empty Declarations setting corresponds to the pragma warn_emptydecl. To check this setting, use __option (warn_emptydecl).

+

See Checking Option Settings for information on how to use this directive.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_extra_commas.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_extra_commas.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_extra_commas.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,20 +1,20 @@ - - - - - -Extra Commas - - - -

Extra Commas

-

If you enable the Extra Commas setting, the compiler generates a warning when it encounters an extra comma. For example, this statement is legal in C but generates a warning when you enable this setting:

-

int a[] = { 1, 2, 3, 4, }; // ^ WARNING: Extra comma after 4

-

The Extra Commas setting corresponds to the pragma warn_extracomma. To check this setting, use __option (warn_extracomma).

-

See Checking Option Settings for information on how to use this directive.
-

- - - - - + + + + + +Extra Commas + + + +

Extra Commas

+

If you enable the Extra Commas setting, the compiler generates a warning when it encounters an extra comma. For example, this statement is legal in C but generates a warning when you enable this setting:

+

int a[] = { 1, 2, 3, 4, }; // ^ WARNING: Extra comma after 4

+

The Extra Commas setting corresponds to the pragma warn_extracomma. To check this setting, use __option (warn_extracomma).

+

See Checking Option Settings for information on how to use this directive.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_hidden_virtual_fn.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_hidden_virtual_fn.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_hidden_virtual_fn.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,31 +1,31 @@ - - - - - -Hidden Virtual Functions - - - -

Hidden Virtual Functions

-

If you enable the Hidden virtual functions setting, the compiler generates a warning if you declare a non-virtual member function in a subclass that hides an inherited virtual function in a superclass. One function hides another if it has the same name but a different argument type. An example of hidden virtual functions:

-
-

class A {
- public:
- virtual void f(int);
- virtual void g(int);
- };

-

class B: public A {
- public:
- void f(char); // WARNING: Hides A::f(int)
- virtual void g(int); // OK: Overrides A::g(int)
- };

-
-

The Hidden virtual functions setting corresponds to the pragma warn_hidevirtual. To check this setting, use __option (warn_hidevirtual).

-

See Checking Option Settings for information on how to use this directive.
-

- - - - - + + + + + +Hidden Virtual Functions + + + +

Hidden Virtual Functions

+

If you enable the Hidden virtual functions setting, the compiler generates a warning if you declare a non-virtual member function in a subclass that hides an inherited virtual function in a superclass. One function hides another if it has the same name but a different argument type. An example of hidden virtual functions:

+
+

class A {
+ public:
+ virtual void f(int);
+ virtual void g(int);
+ };

+

class B: public A {
+ public:
+ void f(char); // WARNING: Hides A::f(int)
+ virtual void g(int); // OK: Overrides A::g(int)
+ };

+
+

The Hidden virtual functions setting corresponds to the pragma warn_hidevirtual. To check this setting, use __option (warn_hidevirtual).

+

See Checking Option Settings for information on how to use this directive.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_ignore_fn.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_ignore_fn.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_ignore_fn.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - -Ignored Function Results - - - -

Ignored Function Results

-

If you enable the pragma warn_resultnotused, the compiler issues a warning when it encounters a statement that calls a function without using its result. To prevent this warning, cast the statement with (void). See Listing 6.13 for an example.

-
-
Listing 6.13 Example of Pragma warn_resultnotused
-

#pragma warn_resultnotused on
- void foo(int a,int b)
- {
- bar(); // warning: result of bar() is not used
- (void)bar(); // void cast suppresses warning
- }
-

-
- - - - - + + + + + +Ignored Function Results + + + +

Ignored Function Results

+

If you enable the pragma warn_resultnotused, the compiler issues a warning when it encounters a statement that calls a function without using its result. To prevent this warning, cast the statement with (void). See Listing 6.13 for an example.

+
+
Listing 6.13 Example of Pragma warn_resultnotused
+

#pragma warn_resultnotused on
+ void foo(int a,int b)
+ {
+ bar(); // warning: result of bar() is not used
+ (void)bar(); // void cast suppresses warning
+ }
+

+
+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_ill_pragmas.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_ill_pragmas.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_ill_pragmas.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,22 +1,22 @@ - - - - - -Illegal Pragmas - - - -

Illegal Pragmas

-

If you enable the Illegal Pragmas setting, the compiler issues a warning when it encounters a pragma it does not recognize. For example, the pragma statements below generate warnings with the Illegal Pragmas setting enabled:

-

#pragma near_data off // WARNING: near_data is not a pragma.
- #pragma far_data select // WARNING: select is not defined
-#pragma far_data on // OK

-

The Illegal Pragmas setting corresponds to the pragma warn_illpragma, described at warn_illpragma”. To check this setting, use __option (warn_illpragma).

-

See Checking Option Settings for information on how to use this directive.
-

- - - - - + + + + + +Illegal Pragmas + + + +

Illegal Pragmas

+

If you enable the Illegal Pragmas setting, the compiler issues a warning when it encounters a pragma it does not recognize. For example, the pragma statements below generate warnings with the Illegal Pragmas setting enabled:

+

#pragma near_data off // WARNING: near_data is not a pragma.
+ #pragma far_data select // WARNING: select is not defined
+#pragma far_data on // OK

+

The Illegal Pragmas setting corresponds to the pragma warn_illpragma, described at warn_illpragma”. To check this setting, use __option (warn_illpragma).

+

See Checking Option Settings for information on how to use this directive.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_implicit_math.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_implicit_math.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_implicit_math.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,48 +1,48 @@ - - - - - -Implicit Arithmetic Conversions - - - -

Implicit Arithmetic Conversions

-

The compiler converts values automatically from one type to another to perform some operations (ISO C, §3.2 and ISO C++, §4). These kinds of conversions are called “implicit conversions” because they are not explicitly stated in the source code.

-

The rules the compiler follows for deciding when to apply implicit conversions sometimes gives results you do not expect. If you enable the Implicit Arithmetic Conversions setting, the compiler issues a warning when it applies implicit conversions:

- -

For example, assigning the value of a variable of type long to a variable of type char results in a warning if you enable this setting.

-

The compiler also has pragmas that control specific of implicit conversions the compiler warns about (Table 6.1).

-
Table 6.1 Implicit Arithmetic Conversion Pragmas
- - - - - - - - - - - - - - - - - - - - - -
This pragma…Warns about this kind of conversion
warn_illunionmembersa floating point value to an integer value
warn_impl_i2f_convan integer value to a floating-point value
warn_impl_s2u_conva signed value to an unsigned value
warn_implicitconvall; this pragma is equivalent to the Implicit Arithmetic Conversions setting
- - - - - + + + + + +Implicit Arithmetic Conversions + + + +

Implicit Arithmetic Conversions

+

The compiler converts values automatically from one type to another to perform some operations (ISO C, §3.2 and ISO C++, §4). These kinds of conversions are called “implicit conversions” because they are not explicitly stated in the source code.

+

The rules the compiler follows for deciding when to apply implicit conversions sometimes gives results you do not expect. If you enable the Implicit Arithmetic Conversions setting, the compiler issues a warning when it applies implicit conversions:

+ +

For example, assigning the value of a variable of type long to a variable of type char results in a warning if you enable this setting.

+

The compiler also has pragmas that control specific of implicit conversions the compiler warns about (Table 6.1).

+
Table 6.1 Implicit Arithmetic Conversion Pragmas
+ + + + + + + + + + + + + + + + + + + + + +
This pragma…Warns about this kind of conversion
warn_illunionmembersa floating point value to an integer value
warn_impl_i2f_convan integer value to a floating-point value
warn_impl_s2u_conva signed value to an unsigned value
warn_implicitconvall; this pragma is equivalent to the Implicit Arithmetic Conversions setting
+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_inline_fn.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_inline_fn.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_inline_fn.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,19 +1,19 @@ - - - - - -inline Functions That Are Not Inlined - - - -

inline Functions That Are Not Inlined

-

If you enable the Non-Inlined Functions setting, the compiler issues a warning when it cannot inline a function.

-

This setting corresponds to pragma warn_notinlined. To check this setting, use __option (warn_notinlined).

-

See Checking Option Settings for information on how to use this directive. -

- - - - - + + + + + +inline Functions That Are Not Inlined + + + +

inline Functions That Are Not Inlined

+

If you enable the Non-Inlined Functions setting, the compiler issues a warning when it cannot inline a function.

+

This setting corresponds to pragma warn_notinlined. To check this setting, use __option (warn_notinlined).

+

See Checking Option Settings for information on how to use this directive. +

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_mixed_use.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_mixed_use.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_mixed_use.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,22 +1,22 @@ - - - - - -Mixed Use of ‘class’ and ‘struct’ Keywords - - - -

Mixed Use of ‘class’ and ‘struct’ Keywords

-

If you enable the Inconsistent ‘class’ / ‘struct’ Usage setting, the compiler issues a warning if you use the class and struct keywords in the definition and declaration of the same identifier.

-

class X;
- struct X { int a; }; // warning

-

Use this warning when using static or dynamic libraries to link with object code produced by another C++ compiler that distinguishes between class and structure variables in its name “mangling.”

-

This setting corresponds to pragma warn_structclass. To check this setting, use __option (warn_structclass).

-

See Checking Option Settings for information on how to use this directive.
-

- - - - - + + + + + +Mixed Use of ‘class’ and ‘struct’ Keywords + + + +

Mixed Use of ‘class’ and ‘struct’ Keywords

+

If you enable the Inconsistent ‘class’ / ‘struct’ Usage setting, the compiler issues a warning if you use the class and struct keywords in the definition and declaration of the same identifier.

+

class X;
+ struct X { int a; }; // warning

+

Use this warning when using static or dynamic libraries to link with object code produced by another C++ compiler that distinguishes between class and structure variables in its name “mangling.”

+

This setting corresponds to pragma warn_structclass. To check this setting, use __option (warn_structclass).

+

See Checking Option Settings for information on how to use this directive.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_realigned_data.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_realigned_data.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_realigned_data.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,18 +1,18 @@ - - - - - -Realigned Data Structures - - - -

Realigned Data Structures

-

If you enable the pragma warn_padding, the compiler warns about any bytes it adds to data structures to improve their memory alignment. Refer to the appropriate Targeting manual for more information on how the compiler pads data structures for a particular processor or operating system.

-

This pragma reports warnings for C source code only. It does not report warnings for C++ source code.
-

- - - - - + + + + + +Realigned Data Structures + + + +

Realigned Data Structures

+

If you enable the pragma warn_padding, the compiler warns about any bytes it adds to data structures to improve their memory alignment. Refer to the appropriate Targeting manual for more information on how the compiler pads data structures for a particular processor or operating system.

+

This pragma reports warnings for C source code only. It does not report warnings for C++ source code.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_redundent.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_redundent.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_redundent.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - -Redundant Statements - - - -

Redundant Statements

-

If you enable the pragma warn_no_side_effect, the compiler issues a warning when it encounters a statement that produces no side effect. To prevent a statement with no side effects from signalling this warning, cast the statement with (void). See Listing 6.12 for an example.

-
-
Listing 6.12 Example of Pragma warn_no_side_effect
-

#pragma warn_no_side_effect on
- void foo(int a,int b)
- {
- a+b; // warning: expression has no side effect
- (void)(a+b); // void cast suppresses warning
- }
-

-
- - - - - + + + + + +Redundant Statements + + + +

Redundant Statements

+

If you enable the pragma warn_no_side_effect, the compiler issues a warning when it encounters a statement that produces no side effect. To prevent a statement with no side effects from signalling this warning, cast the statement with (void). See Listing 6.12 for an example.

+
+
Listing 6.12 Example of Pragma warn_no_side_effect
+

#pragma warn_no_side_effect on
+ void foo(int a,int b)
+ {
+ a+b; // warning: expression has no side effect
+ (void)(a+b); // void cast suppresses warning
+ }
+

+
+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_suspicious_assgn.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_suspicious_assgn.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_suspicious_assgn.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,64 +1,64 @@ - - - - - -Suspicious Assignments and Incorrect Function Returns - - - -

Suspicious Assignments and Incorrect Function Returns

-

If you enable the Extended Error Checking setting, the C compiler generates a warning if it encounters one of the following potential problems:

- -
-
-

Listing 1. Non-void Function with no return Statement

-

main() /* assumed to return int */
- {
- printf ("hello world\n");
- } /* WARNING: no return statement */
- Listing 6.8 does not generate a warning.
- Listing 6.8 Explicitly Specifying a Function’s void Return Type
- void main() /* function declared to return void */
- {
- printf ("hello world\n");
- }
-

-
-
- -
-
-
Listing 2. Assigning to an Enumerated Type
-

enum Day { Sunday, Monday, Tuesday, Wednesday,
- Thursday, Friday, Saturday } d;

-

d = 5; /* WARNING */
- d = Monday; /* OK */
- d = (Day)3 ; /* OK */
-• An empty return statement in a function that is not declared void. For example, the following code results in a warning:
- int MyInit(void)
- {
- int err = GetMyResources();
- if (err!=0) return; /* ERROR: Empty return statement */

-

/* ... */
- This is OK:
- int MyInit(void)
- {
- int err = GetMyResources();
- if (err!=0) return -1; /* OK */

-

/* ... */

-
-
-

The Extended Error Checking setting corresponds to the pragma extended_errorcheck, described at extended_errorcheck. To check this setting, use __option (extended_errorcheck).

-

See Checking Option Settings for information on how to use this directive.
-

- - - - - + + + + + +Suspicious Assignments and Incorrect Function Returns + + + +

Suspicious Assignments and Incorrect Function Returns

+

If you enable the Extended Error Checking setting, the C compiler generates a warning if it encounters one of the following potential problems:

+ +
+
+

Listing 1. Non-void Function with no return Statement

+

main() /* assumed to return int */
+ {
+ printf ("hello world\n");
+ } /* WARNING: no return statement */
+ Listing 6.8 does not generate a warning.
+ Listing 6.8 Explicitly Specifying a Function’s void Return Type
+ void main() /* function declared to return void */
+ {
+ printf ("hello world\n");
+ }
+

+
+
+ +
+
+
Listing 2. Assigning to an Enumerated Type
+

enum Day { Sunday, Monday, Tuesday, Wednesday,
+ Thursday, Friday, Saturday } d;

+

d = 5; /* WARNING */
+ d = Monday; /* OK */
+ d = (Day)3 ; /* OK */
+• An empty return statement in a function that is not declared void. For example, the following code results in a warning:
+ int MyInit(void)
+ {
+ int err = GetMyResources();
+ if (err!=0) return; /* ERROR: Empty return statement */

+

/* ... */
+ This is OK:
+ int MyInit(void)
+ {
+ int err = GetMyResources();
+ if (err!=0) return -1; /* OK */

+

/* ... */

+
+
+

The Extended Error Checking setting corresponds to the pragma extended_errorcheck, described at extended_errorcheck. To check this setting, use __option (extended_errorcheck).

+

See Checking Option Settings for information on how to use this directive.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_unused_args.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_unused_args.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_unused_args.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,46 +1,46 @@ - - - - - -Unused Arguments - - - -

Unused Arguments

-

If you enable the Unused Arguments setting, the compiler generates a warning when it encounters an argument you declare but do not use. This check helps you find arguments that you either misspelled or did not use in your program.

-

void foo(int temp,int errer); // ERROR: errer is misspelled
- {
- error = do_something(); // WARNING: temp and error are
- // unused.
-}

-

You can declare an argument that you do not use in two ways without receiving this warning:

- -
-

void foo(int temp, int error)
- {
- #pragma unused (temp)
- /* Compiler does not warn that temp is not used */
- error=do_something();
- }

-
- -
-

void foo(int /* temp */, int error)
- {
- /* Compiler does not warn that "temp" is not used.
- error=do_something(); */
- }

-
-

The Unused Arguments setting corresponds to the pragma warn_unusedarg, described at warn_unusedarg. To check this setting, use __option (warn_unusedarg).

-

See Checking Option Settings for information on how to use this directive.
-

- - - - - + + + + + +Unused Arguments + + + +

Unused Arguments

+

If you enable the Unused Arguments setting, the compiler generates a warning when it encounters an argument you declare but do not use. This check helps you find arguments that you either misspelled or did not use in your program.

+

void foo(int temp,int errer); // ERROR: errer is misspelled
+ {
+ error = do_something(); // WARNING: temp and error are
+ // unused.
+}

+

You can declare an argument that you do not use in two ways without receiving this warning:

+ +
+

void foo(int temp, int error)
+ {
+ #pragma unused (temp)
+ /* Compiler does not warn that temp is not used */
+ error=do_something();
+ }

+
+ +
+

void foo(int /* temp */, int error)
+ {
+ /* Compiler does not warn that "temp" is not used.
+ error=do_something(); */
+ }

+
+

The Unused Arguments setting corresponds to the pragma warn_unusedarg, described at warn_unusedarg. To check this setting, use __option (warn_unusedarg).

+

See Checking Option Settings for information on how to use this directive.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_unused_vars.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_unused_vars.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/errors/err_unused_vars.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,44 +1,44 @@ - - - - - -Unused Variables - - - - -

Unused Variables

-

If you enable the Unused Variables setting, the compiler generates a warning when it encounters a local variable you declare but do not use. This check helps you find variables that you either misspelled or did not use in your program. Listing 1 shows an example.

-
-
Listing 1. Unused Local Variables Example
-

int error;
- void foo(void)
- {
- int temp, errer; // ERROR: errer is misspelled
- error = do_something()
- // WARNING: temp and error are unused.
- }

-
-

If you want to use this warning but need to declare a variable that you do not use, include the pragma unused, as in Listing 2.

-
-
Listing 2. Suppressing Unused Variable Warnings
-

void foo(void)
- {
- int i, temp, error;

-

#pragma unused (i, temp) /* Do not warn that i and temp */
- error=do_something(); /* are not used */
- }

-
-

The Unused Variables setting corresponds to the pragma warn_unusedvar, described at warn_unusedvar. To check this setting, use __option (warn_unusedvar).

-

See Checking Option Settings for information on how to use this directive.
-

- - - - - + + + + + +Unused Variables + + + + +

Unused Variables

+

If you enable the Unused Variables setting, the compiler generates a warning when it encounters a local variable you declare but do not use. This check helps you find variables that you either misspelled or did not use in your program. Listing 1 shows an example.

+
+
Listing 1. Unused Local Variables Example
+

int error;
+ void foo(void)
+ {
+ int temp, errer; // ERROR: errer is misspelled
+ error = do_something()
+ // WARNING: temp and error are unused.
+ }

+
+

If you want to use this warning but need to declare a variable that you do not use, include the pragma unused, as in Listing 2.

+
+
Listing 2. Suppressing Unused Variable Warnings
+

void foo(void)
+ {
+ int i, temp, error;

+

#pragma unused (i, temp) /* Do not warn that i and temp */
+ error=do_something(); /* are not used */
+ }

+
+

The Unused Variables setting corresponds to the pragma warn_unusedvar, described at warn_unusedvar. To check this setting, use __option (warn_unusedvar).

+

See Checking Option Settings for information on how to use this directive.
+

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/images/about.png Binary file core/com.nokia.carbide.cpp.compiler.doc.user/html/images/about.png has changed diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/images/about_cpp.png Binary file core/com.nokia.carbide.cpp.compiler.doc.user/html/images/about_cpp.png has changed diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/images/gold_header.png Binary file core/com.nokia.carbide.cpp.compiler.doc.user/html/images/gold_header.png has changed diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/images/mwccsym2_version.png Binary file core/com.nokia.carbide.cpp.compiler.doc.user/html/images/mwccsym2_version.png has changed diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/introduction/conventions.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/introduction/conventions.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/introduction/conventions.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,44 +1,44 @@ - - - - - -Conventions Used in This Reference - - - -

Conventions Used in This Reference

-

References to a chapter or section number in The C International Standard (ISO/IEC 9899:1999) appear as (ISO C, §number).

-

References to a chapter or section number in The C++ International Standard (ISO/IEC: 14882) appear as (ISO C++, §number).

-

This manual also uses syntax examples that describe the format of C source code statements:

-

#pragma parameter [return-reg] func-name [param-regs]

-

#pragma optimize_for_size on | off | reset

-

Table 1. describes how to interpret these statements.

-

Table 1. Understanding Syntax Examples

- - - - - - - - - - - - - - - - - - - - - -
If the text looks like…Then…
literalInclude the text in your statement exactly as you see it.
metasymbolReplace the symbol with an appropriate value. The text after the syntax example describes what the appropriate values are.
a | b | cUse one of the symbols in the statement: either a, b, or c.
[a]Include the symbol, a, only if necessary. The text after the syntax example describes when to include it.
- - - - - + + + + + +Conventions Used in This Reference + + + +

Conventions Used in This Reference

+

References to a chapter or section number in The C International Standard (ISO/IEC 9899:1999) appear as (ISO C, §number).

+

References to a chapter or section number in The C++ International Standard (ISO/IEC: 14882) appear as (ISO C++, §number).

+

This manual also uses syntax examples that describe the format of C source code statements:

+

#pragma parameter [return-reg] func-name [param-regs]

+

#pragma optimize_for_size on | off | reset

+

Table 1. describes how to interpret these statements.

+

Table 1. Understanding Syntax Examples

+ + + + + + + + + + + + + + + + + + + + + +
If the text looks like…Then…
literalInclude the text in your statement exactly as you see it.
metasymbolReplace the symbol with an appropriate value. The text after the syntax example describes what the appropriate values are.
a | b | cUse one of the symbols in the statement: either a, b, or c.
[a]Include the symbol, a, only if necessary. The text after the syntax example describes when to include it.
+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/introduction/documentation.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/introduction/documentation.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/introduction/documentation.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,23 +1,23 @@ - - - - - -Where to Look for Related Information - - - -

Where to Look for Related Information

-

Additional information on programming for the Symbian OS using Carbide.c++ and SDKs can be found at:

- -

For general information on using the Carbide IDE and debugger, see the Carbide.c++ User Guide.

- - - - - + + + + + +Where to Look for Related Information + + + +

Where to Look for Related Information

+

Additional information on programming for the Symbian OS using Carbide.c++ and SDKs can be found at:

+ +

For general information on using the Carbide IDE and debugger, see the Carbide.c++ User Guide.

+ + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/introduction/intro.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/introduction/intro.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/introduction/intro.htm Mon Jul 19 16:13:24 2010 -0500 @@ -26,7 +26,7 @@
  • Conventions Used in this Reference
  • - + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/introduction/new_features.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/introduction/new_features.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/introduction/new_features.htm Mon Jul 19 16:13:24 2010 -0500 @@ -5,11 +5,50 @@ New Features & Bug Fixes +

    New Features & Bug Fixes

    -

    A list of bug fixes for the compiler and linker can be found in the Symbian_x86_BuildTools_Notes.txt file located in the <Carbide_Install_Dir>\x86Build\Release_Notes directory.

    +

    A list of bug fixes for the compiler and linker can be found in the Symbian_x86_BuildTools_Notes.txt file located in the <Carbide_Install_Dir>\x86Build\Release_Notes directory. The latest build information is always available on the Symbian Foundation Wiki under WINSCW (build version information).

    This reference has new and updated topics:

    +
    3.2.5 Build 489
    + +
    3.2.5 Build 488
    + +
    3.2.5 Build 487
    + +
    3.2.5 Build 486
    + +
    3.2.5 Build 485
    + +
    3.2.5 Build 482
    + +
    3.2.5 Build 481
    + +

    Previous releases

    - + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/introduction/version.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/introduction/version.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/introduction/version.htm Mon Jul 19 16:13:24 2010 -0500 @@ -10,7 +10,7 @@

    Verifying the Compiler Version

    To determine what version of the Carbide.c++ compiler you are using, follow the steps below.

    NOTE The Carbide.c++ compiler is stored in <Carbide_Install_Dir>\x86Build\Symbian_Tools\Command_Line_Tools.

    -

    +

    Figure 1. Getting compiler version using Command Prompt.

    From the Carbide IDE

    @@ -48,7 +48,7 @@

    - + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/legal.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/legal.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/legal.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,34 +1,34 @@ - - - - - - Legal - - - - -

    License Information

    -
    COPYRIGHTS
    -

    Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.eclipse.org/legal/epl-v10.html

    -
    NOTICES
    -

    Portions of this product are covered by the following licenses:

    - -

     

    - + + + + + + Legal + + + + +

    License Information

    +
    COPYRIGHTS
    +

    Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.eclipse.org/legal/epl-v10.html

    +
    NOTICES
    +

    Portions of this product are covered by the following licenses:

    + +

     

    + \ No newline at end of file diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/perf_inst_manager.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/perf_inst_manager.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/perf_inst_manager.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,17 +1,17 @@ - - - - - -Use Instance Manager - - - -

    Use Instance Manager

    -

    The Use Instance Manager option reduces compile time by telling the compiler to generate any instance of a template (or non-inlined inline) function only once. Object code size and associated debug information size is reduced. This does not affect the output file size, though, since the compiler is effectively doing the same task as the linker in this mode.

    -

    You can control where the instance database is stored using the #pragma instmgr_file.

    - - - - - + + + + + +Use Instance Manager + + + +

    Use Instance Manager

    +

    The Use Instance Manager option reduces compile time by telling the compiler to generate any instance of a template (or non-inlined inline) function only once. Object code size and associated debug information size is reduced. This does not affect the output file size, though, since the compiler is effectively doing the same task as the linker in this mode.

    +

    You can control where the instance database is stored using the #pragma instmgr_file.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/perf_pragma_scope.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/perf_pragma_scope.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/perf_pragma_scope.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,35 +1,35 @@ - - - - - -Pragma Scope in Precompiled Files - - - -

    Pragma Scope in Precompiled Files

    -

    Pragma settings inside a precompiled file affect only the source code within that file. The pragma settings for an item declared in a precompiled header file (such as data or a function) are saved then restored when the precompiled header file is included.

    -

    For example, the source code in Listing 5.3 specifies that the variable xxx is a far variable.

    -
    -
    Listing 5.3 Pragma Settings in a Precompiled Header
    -

    // my_pch.pch
    - // Generate a precompiled header named pch.mch.

    -

    #pragma precompile_target "my_pch.mch"

    -

    #pragma far_data on
    - extern int xxx;

    -
    -

    The source code in Listing 5.4 includes the precompiled version of Listing 5.3.

    -
    -
    Listing 5.4 Pragma Settings in an Included Precompiled File
    -

    // test.c
    - #pragma far_data off // far data is disabled
    - #include "my_pch.mch" // this precompiled file sets far_data on
    - // far_data is still off but xxx is still a far variable

    -
    -

    The pragma setting in the precompiled file is active within the precompiled file, even though the source file including the precompiled file has a different setting. -

    - - - - - + + + + + +Pragma Scope in Precompiled Files + + + +

    Pragma Scope in Precompiled Files

    +

    Pragma settings inside a precompiled file affect only the source code within that file. The pragma settings for an item declared in a precompiled header file (such as data or a function) are saved then restored when the precompiled header file is included.

    +

    For example, the source code in Listing 5.3 specifies that the variable xxx is a far variable.

    +
    +
    Listing 5.3 Pragma Settings in a Precompiled Header
    +

    // my_pch.pch
    + // Generate a precompiled header named pch.mch.

    +

    #pragma precompile_target "my_pch.mch"

    +

    #pragma far_data on
    + extern int xxx;

    +
    +

    The source code in Listing 5.4 includes the precompiled version of Listing 5.3.

    +
    +
    Listing 5.4 Pragma Settings in an Included Precompiled File
    +

    // test.c
    + #pragma far_data off // far data is disabled
    + #include "my_pch.mch" // this precompiled file sets far_data on
    + // far_data is still off but xxx is still a far variable

    +
    +

    The pragma setting in the precompiled file is active within the precompiled file, even though the source file including the precompiled file has a different setting. +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/perf_precompiled_auto.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/perf_precompiled_auto.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/perf_precompiled_auto.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,25 +1,25 @@ - - - - - -Updating a Precompiled File Automatically - - - -

    Updating a Precompiled File Automatically

    -

    Use the Carbide IDE’s project manager to update a precompiled header automatically. The IDE creates a precompiled file from a source code file during a compile, update, or make operation if the source code file meets these criteria:

    - -

    See the Carbide IDE User Guide for information on how the IDE determines that a file must be updated.

    -

    The IDE uses the build target’s settings to preprocess and precompile files.
    -

    - - - - - + + + + + +Updating a Precompiled File Automatically + + + +

    Updating a Precompiled File Automatically

    +

    Use the Carbide IDE’s project manager to update a precompiled header automatically. The IDE creates a precompiled file from a source code file during a compile, update, or make operation if the source code file meets these criteria:

    + +

    See the Carbide IDE User Guide for information on how the IDE determines that a file must be updated.

    +

    The IDE uses the build target’s settings to preprocess and precompile files.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/perf_precompiled_files.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/perf_precompiled_files.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/perf_precompiled_files.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,19 +1,19 @@ - - - - - -When to Use Precompiled Files - - - -

    When to Use Precompiled Files

    -

    Source code files in a project typically use many header files. Typically, the same header files are included by each source code file in a project, forcing the compiler to read these same header files repeatedly during compilation. To shorten the time spent compiling and recompiling the same header files, Carbide C/C++ can precompile a header file, allowing it to be subsequently preprocessed much faster than a regular text source code file.

    -

    For example, as a convenience, programmers often create a header file that contains commonly-used preprocessor definitions and includes frequently-used header files. This header file is then included by each source code file in the project, saving the programmer some time and effort while writing source code.

    -

    This convenience comes at a cost, though. While the programmer saves time typing, the compiler does extra work, preprocessing and compiling this header file each time it compiles a source code file that includes it.

    -

    This header file can be precompiled so that, instead of preprocessing multiple duplications, the compiler needs to load just one precompiled header file.

    - - - - - + + + + + +When to Use Precompiled Files + + + +

    When to Use Precompiled Files

    +

    Source code files in a project typically use many header files. Typically, the same header files are included by each source code file in a project, forcing the compiler to read these same header files repeatedly during compilation. To shorten the time spent compiling and recompiling the same header files, Carbide C/C++ can precompile a header file, allowing it to be subsequently preprocessed much faster than a regular text source code file.

    +

    For example, as a convenience, programmers often create a header file that contains commonly-used preprocessor definitions and includes frequently-used header files. This header file is then included by each source code file in the project, saving the programmer some time and effort while writing source code.

    +

    This convenience comes at a cost, though. While the programmer saves time typing, the compiler does extra work, preprocessing and compiling this header file each time it compiles a source code file that includes it.

    +

    This header file can be precompiled so that, instead of preprocessing multiple duplications, the compiler needs to load just one precompiled header file.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/perf_precompiled_ide.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/perf_precompiled_ide.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/perf_precompiled_ide.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,33 +1,33 @@ - - - - - -Precompiling a File in the Carbide IDE - - - -

    Precompiling a File in the Carbide IDE

    -

    To precompile a file in the Carbide IDE, use the Precompile command in the Project menu:

    -
    -
      -
    1. Start the Carbide IDE.
    2. -
    3. Open or create a project.
    4. -
    5. Choose or create a build target in the project.
    6. -

      The settings in the project’s active build target will be used when preprocessing and precompiling the file you want to precompile.

      -
    7. Open the source code file to precompile.
    8. -

      See “What Can be Precompiled” for information on what a precompiled file may contain.

      -
    9. From the Project menu, choose Precompile.
    10. -

      A save dialog box appears.

      -
    11. Choose a location and type a name for the new precompiled file.
    12. -

      The IDE precompiles the file and saves it.

      -
    13. Click Save.
    14. -

      The save dialog box closes, and the IDE precompiles the file you opened, saving it in the folder you specified, giving it the name you specified.

      -
    -
    -

    You may now include the new precompiled file in source code files.

    - - - - - + + + + + +Precompiling a File in the Carbide IDE + + + +

    Precompiling a File in the Carbide IDE

    +

    To precompile a file in the Carbide IDE, use the Precompile command in the Project menu:

    +
    +
      +
    1. Start the Carbide IDE.
    2. +
    3. Open or create a project.
    4. +
    5. Choose or create a build target in the project.
    6. +

      The settings in the project’s active build target will be used when preprocessing and precompiling the file you want to precompile.

      +
    7. Open the source code file to precompile.
    8. +

      See “What Can be Precompiled” for information on what a precompiled file may contain.

      +
    9. From the Project menu, choose Precompile.
    10. +

      A save dialog box appears.

      +
    11. Choose a location and type a name for the new precompiled file.
    12. +

      The IDE precompiles the file and saves it.

      +
    13. Click Save.
    14. +

      The save dialog box closes, and the IDE precompiles the file you opened, saving it in the folder you specified, giving it the name you specified.

      +
    +
    +

    You may now include the new precompiled file in source code files.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/perf_precompiled_using.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/perf_precompiled_using.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/perf_precompiled_using.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,45 +1,45 @@ - - - - - -Using a Precompiled Header File - - - -

    Using a Precompiled Header File

    -

    Although a precompiled file is not a text file, you use it like you would a regular header file. To include a precompiled header file in a source code file, use the #include directive.

    -

    NOTE Unlike regular header files in text format, a source code file may include only one precompiled file.

    -

    TIP Instead of explicitly including a precompiled file in each source code file with the #include directive, put the precompiled file name in the Prefix File field of the C/C++ Language settings panel. If the Prefix File field already specifies a file name, include the precompiled file in the prefix file with the #include directive.

    -

    Listing 5.1 and Listing 5.2 show an example.

    -
    -
    Listing 5.1 Header File that Creates a Precompiled Header File for C
    -

    // sock_header.pch
    - // When compiled or precompiled, this file will generate a
    - // precompiled file named "sock_precomp.mch"

    -

    #pragma precompile_target "sock_precomp.mch"

    -

    #define SOCK_VERSION "SockSorter 2.0"
    - #include "sock_std.h"
    - #include "sock_string.h"
    - #include "sock_sorter.h"

    -
    -
    -
    Listing 5.2 Using a Precompiled File
    -

    // sock_main.c
    - // Instead of including all the files included in
    - // sock_header.pch, we use sock_precomp.h instead.
    - //
    - // A precompiled file must be included before anything else.

    -

    #include "sock_precomp.mch"

    -

    int main(void)
    - {
    - // ...
    - return 0;
    - } -

    -
    - - - - - + + + + + +Using a Precompiled Header File + + + +

    Using a Precompiled Header File

    +

    Although a precompiled file is not a text file, you use it like you would a regular header file. To include a precompiled header file in a source code file, use the #include directive.

    +

    NOTE Unlike regular header files in text format, a source code file may include only one precompiled file.

    +

    TIP Instead of explicitly including a precompiled file in each source code file with the #include directive, put the precompiled file name in the Prefix File field of the C/C++ Language settings panel. If the Prefix File field already specifies a file name, include the precompiled file in the prefix file with the #include directive.

    +

    Listing 5.1 and Listing 5.2 show an example.

    +
    +
    Listing 5.1 Header File that Creates a Precompiled Header File for C
    +

    // sock_header.pch
    + // When compiled or precompiled, this file will generate a
    + // precompiled file named "sock_precomp.mch"

    +

    #pragma precompile_target "sock_precomp.mch"

    +

    #define SOCK_VERSION "SockSorter 2.0"
    + #include "sock_std.h"
    + #include "sock_string.h"
    + #include "sock_sorter.h"

    +
    +
    +
    Listing 5.2 Using a Precompiled File
    +

    // sock_main.c
    + // Instead of including all the files included in
    + // sock_header.pch, we use sock_precomp.h instead.
    + //
    + // A precompiled file must be included before anything else.

    +

    #include "sock_precomp.mch"

    +

    int main(void)
    + {
    + // ...
    + return 0;
    + } +

    +
    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/perf_precompiled_what.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/perf_precompiled_what.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/perf_precompiled_what.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,41 +1,41 @@ - - - - - -What Can be Precompiled - - - -

    What Can be Precompiled

    -

    A file to be precompiled does not have to be a header file (.h or .hpp files, for example), but it must meet these requirements:

    - -

    You cannot precompile libraries or other binary files.

    - -

    The Carbide IDE uses the build target settings to precompile a file.

    - -

    However, the file may define static data. C++ source code can contain inline functions and constant variable declarations (const).

    - -

    For example, to generate a precompiled header for use with Windows® compilers, you must use a Windows® compiler.

    - -

    Typically, a source code file includes a precompiled header file before anything else (except comments).

    - - - - - + + + + + +What Can be Precompiled + + + +

    What Can be Precompiled

    +

    A file to be precompiled does not have to be a header file (.h or .hpp files, for example), but it must meet these requirements:

    + +

    You cannot precompile libraries or other binary files.

    + +

    The Carbide IDE uses the build target settings to precompile a file.

    + +

    However, the file may define static data. C++ source code can contain inline functions and constant variable declarations (const).

    + +

    For example, to generate a precompiled header for use with Windows® compilers, you must use a Windows® compiler.

    + +

    Typically, a source code file includes a precompiled header file before anything else (except comments).

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/perf_preprocessing.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/perf_preprocessing.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/perf_preprocessing.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,22 +1,22 @@ - - - - - -Preprocessing and Precompiling - - - -

    Preprocessing and Precompiling

    -

    When precompiling a header file, the compiler preprocesses the file too. In other words, a precompiled file is preprocessed in the context of its precompilation, not in the context of its compilation.

    -

    The preprocessor also tracks macros used to guard #include files to reduce parsing time. Thus, if a file’s contents are surrounded with:

    -

    #ifndef FOO_H
    - #define FOO_H
    - // file contents
    - #endif

    -

    The compiler will not load the file twice, saving some small amount of time in the process.

    - - - - - + + + + + +Preprocessing and Precompiling + + + +

    Preprocessing and Precompiling

    +

    When precompiling a header file, the compiler preprocesses the file too. In other words, a precompiled file is preprocessed in the context of its precompilation, not in the context of its compilation.

    +

    The preprocessor also tracks macros used to guard #include files to reduce parsing time. Thus, if a file’s contents are surrounded with:

    +

    #ifndef FOO_H
    + #define FOO_H
    + // file contents
    + #endif

    +

    The compiler will not load the file twice, saving some small amount of time in the process.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/performance.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/performance.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/performance/performance.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - -Improving Compiler Performance - - - -

    Improving Compiler Performance

    -

    This section describes compiler features that decrease the amount of time to translate source code.

    - - - - - - + + + + + +Improving Compiler Performance + + + +

    Improving Compiler Performance

    +

    This section describes compiler features that decrease the amount of time to translate source code.

    + + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_ANSI_strict.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_ANSI_strict.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_ANSI_strict.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,73 +1,73 @@ - - - - - - - ANSI_strict - - - - -

    ANSI_strict

    -

    Controls the use of non-standard language features.

    -
    Syntax
    -

    #pragma ANSI_strict on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable the pragma ANSI_strict, the compiler generates an error if it encounters any of the following common ANSI extensions:

    - -
    -
    -

    a = b; // This is a C++-style comment

    -
    -
    - -
    -
    -

    void f(int ) {} /* OK, if ANSI Strict is disabled */
    - void f(int i) {} /* ALWAYS OK */

    -
    -
    - -
    -
    -

    #define add1(x) #x #1
    - /* OK, if ANSI_strict is disabled,

    -
    -

    but probably not what you wanted:

    -
    -

    add1(abc) creates "abc"#1 */
    - #define add2(x) #x "2"
    - /* ALWAYS OK: add2(abc) creates "abc2" */

    -
    -
    - -
    -
    -

    - #ifdef __CARBIDE__
    - /* . . . */
    - #endif __CARBIDE__ /* OK, if ANSI_strict is disabled */

    -

    #ifdef __CARBIDE__
    - /* . . . */
    - #endif /*__CARBIDE__*/ /* ALWAYS OK */

    -
    -
    -

    This pragma corresponds to the ANSI Strict setting . To check this setting, use __option (ANSI_strict), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + ANSI_strict + + + + +

    ANSI_strict

    +

    Controls the use of non-standard language features.

    +
    Syntax
    +

    #pragma ANSI_strict on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable the pragma ANSI_strict, the compiler generates an error if it encounters any of the following common ANSI extensions:

    + +
    +
    +

    a = b; // This is a C++-style comment

    +
    +
    + +
    +
    +

    void f(int ) {} /* OK, if ANSI Strict is disabled */
    + void f(int i) {} /* ALWAYS OK */

    +
    +
    + +
    +
    +

    #define add1(x) #x #1
    + /* OK, if ANSI_strict is disabled,

    +
    +

    but probably not what you wanted:

    +
    +

    add1(abc) creates "abc"#1 */
    + #define add2(x) #x "2"
    + /* ALWAYS OK: add2(abc) creates "abc2" */

    +
    +
    + +
    +
    +

    + #ifdef __CARBIDE__
    + /* . . . */
    + #endif __CARBIDE__ /* OK, if ANSI_strict is disabled */

    +

    #ifdef __CARBIDE__
    + /* . . . */
    + #endif /*__CARBIDE__*/ /* ALWAYS OK */

    +
    +
    +

    This pragma corresponds to the ANSI Strict setting . To check this setting, use __option (ANSI_strict), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_access_errors.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_access_errors.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_access_errors.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,24 +1,24 @@ - - - - - -access_errors - - - -

    access_errors

    -

    Controls whether or not to change illegal access errors to warnings.

    -
    Syntax
    -

    #pragma access_errors on | off | reset

    -
    Targets
    -

    All platforms.

    -
    Remarks
    -

    If you enable this pragma, the compiler issues an error instead of a warning when it detects illegal access to protected or private members. This has the effect of including the file once (like #pragma once). This is not a portable usage.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (access_errors), described in Checking Settings.

    -

    The default setting is on.

    - - - - - + + + + + +access_errors + + + +

    access_errors

    +

    Controls whether or not to change illegal access errors to warnings.

    +
    Syntax
    +

    #pragma access_errors on | off | reset

    +
    Targets
    +

    All platforms.

    +
    Remarks
    +

    If you enable this pragma, the compiler issues an error instead of a warning when it detects illegal access to protected or private members. This has the effect of including the file once (like #pragma once). This is not a portable usage.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (access_errors), described in Checking Settings.

    +

    The default setting is on.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_align.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_align.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_align.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,18 +1,18 @@ - - - - - - - access_errors - - - - -

    align

    -

    See pragma options.

    - - - - - + + + + + + + access_errors + + + + +

    align

    +

    See pragma options.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_always_inline.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_always_inline.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_always_inline.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - always_inline - - - - -

    always_inline (deprecated)

    -

    Controls the use of inlined functions.

    -
    Syntax
    -

    #pragma always_inline on | off | reset

    -
    Targets
    -

    All platforms.

    -
    Remarks
    -

    This pragma is strongly deprecated. Use the pragma inline_depth instead.

    -

    If you enable this pragma, the compiler ignores all inlining limits and attempts to inline all functions where it is legal to do so.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (always_inline), described in Checking Settings.

    -

    The default setting is off.

    - - - - - + + + + + + + always_inline + + + + +

    always_inline (deprecated)

    +

    Controls the use of inlined functions.

    +
    Syntax
    +

    #pragma always_inline on | off | reset

    +
    Targets
    +

    All platforms.

    +
    Remarks
    +

    This pragma is strongly deprecated. Use the pragma inline_depth instead.

    +

    If you enable this pragma, the compiler ignores all inlining limits and attempts to inline all functions where it is legal to do so.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (always_inline), described in Checking Settings.

    +

    The default setting is off.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_arm_conform.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_arm_conform.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_arm_conform.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,18 +1,18 @@ - - - - - - - ARM_conform - - - - -

    ARM_conform

    -

    This pragma is no longer available.

    - - - - - + + + + + + + ARM_conform + + + + +

    ARM_conform

    +

    This pragma is no longer available.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_arm_scoping.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_arm_scoping.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_arm_scoping.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,33 +1,33 @@ - - - - - - - ARM_scoping - - - - -

    ARM_scoping

    -

    Controls the scope of variables declared in the expression parts of if, while, and for statements.

    -
    Syntax
    -

    #pragma ARM_scoping on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, any variable you declare in any of the above conditional expressions remains valid until the end of the block that contains the statement. Otherwise, the variables only remains valid until the end of that statement. Listing 10.5 shows an example.

    -
    -

    Listing 10.5 Example of Using Variables Declared in for Statement

    -

    for( int i=1; i<1000; i++) {
    - /* . . . */ }
    - return i; // OK if ARM_conform is enabled.

    -
    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (ARM_scoping. They default setting is off.

    -

    - - - - - + + + + + + + ARM_scoping + + + + +

    ARM_scoping

    +

    Controls the scope of variables declared in the expression parts of if, while, and for statements.

    +
    Syntax
    +

    #pragma ARM_scoping on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, any variable you declare in any of the above conditional expressions remains valid until the end of the block that contains the statement. Otherwise, the variables only remains valid until the end of that statement. Listing 10.5 shows an example.

    +
    +

    Listing 10.5 Example of Using Variables Declared in for Statement

    +

    for( int i=1; i<1000; i++) {
    + /* . . . */ }
    + return i; // OK if ARM_conform is enabled.

    +
    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (ARM_scoping. They default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_array_new_delete.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_array_new_delete.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_array_new_delete.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - array_new_delete - - - - -

    array_new_delete

    -

    Use to enable the operator new[]/delete[] in array allocation/deallocation operations.

    -
    Syntax
    -

    #pragma array_new_delete on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    - To check this setting, use __option (array_new_delete). The default setting is on. -

    - - - - - + + + + + + + array_new_delete + + + + +

    array_new_delete

    +

    Use to enable the operator new[]/delete[] in array allocation/deallocation operations.

    +
    Syntax
    +

    #pragma array_new_delete on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    + To check this setting, use __option (array_new_delete). The default setting is on. +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_asmpoundcomment.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_asmpoundcomment.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_asmpoundcomment.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,28 +1,28 @@ - - - - - - - asmpoundcomment - - - - -

    asmpoundcomment

    -

    Controls whether the “#” symbol is treated as a comment character in inline assembly.

    -
    Syntax
    -

    #pragma asmpoundcomment on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    NOTE Some targets may have additional comment characters, and may treat these characters as comments even when #pragma asmpoundcomment off is used.

    -

    WARNING! Using this pragma may interfere with the assembly language of a specific target.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (asmpoundcomment). The default setting is on.

    -

    - - - - - + + + + + + + asmpoundcomment + + + + +

    asmpoundcomment

    +

    Controls whether the “#” symbol is treated as a comment character in inline assembly.

    +
    Syntax
    +

    #pragma asmpoundcomment on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    NOTE Some targets may have additional comment characters, and may treat these characters as comments even when #pragma asmpoundcomment off is used.

    +

    WARNING! Using this pragma may interfere with the assembly language of a specific target.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (asmpoundcomment). The default setting is on.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_asmsemicolcomment.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_asmsemicolcomment.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_asmsemicolcomment.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - asmsemicolcomment - - - - -

    asmsemicolcomment

    -

    Controls whether the “;” symbol is treated as a comment character in inline assembly.

    -
    Syntax
    -

    #pragma asmsemicolcomment on | off | reset

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    NOTE Some targets may have additional comment characters, and may treat these characters as comments even when #pragma asmsemicolcomment off is used.

    -

    WARNING! Using this pragma may interfere with the assembly language of a specific target.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (asmsemicolcomment). The default setting is on.

    -

    - - - - - + + + + + + + asmsemicolcomment + + + + +

    asmsemicolcomment

    +

    Controls whether the “;” symbol is treated as a comment character in inline assembly.

    +
    Syntax
    +

    #pragma asmsemicolcomment on | off | reset

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    NOTE Some targets may have additional comment characters, and may treat these characters as comments even when #pragma asmsemicolcomment off is used.

    +

    WARNING! Using this pragma may interfere with the assembly language of a specific target.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (asmsemicolcomment). The default setting is on.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_auto_inline.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_auto_inline.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_auto_inline.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,28 +1,28 @@ - - - - - - - access_errors - - - - -

    auto_inline

    -

    Controls which functions to inline.

    -
    Syntax
    -

    #pragma auto_inline on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler automatically chooses functions to inline for you, in addition to functions declared “inline”.
    - Note that if you enable either the Don’t Inline setting (“Inlining”) or the dont_inline pragma (“dont_inline”), the compiler ignores the setting of the auto_inline pragma and does not inline any functions.

    -

    This pragma corresponds to the Auto-Inline setting. To check this setting, use __option (auto_inline), described in Checking Settings. The default setting is off.

    -

    See also "Iinlining".

    - - - - - + + + + + + + access_errors + + + + +

    auto_inline

    +

    Controls which functions to inline.

    +
    Syntax
    +

    #pragma auto_inline on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler automatically chooses functions to inline for you, in addition to functions declared “inline”.
    + Note that if you enable either the Don’t Inline setting (“Inlining”) or the dont_inline pragma (“dont_inline”), the compiler ignores the setting of the auto_inline pragma and does not inline any functions.

    +

    This pragma corresponds to the Auto-Inline setting. To check this setting, use __option (auto_inline), described in Checking Settings. The default setting is off.

    +

    See also "Iinlining".

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_bool.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_bool.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_bool.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,28 +1,28 @@ - - - - - - - bool - - - - -

    bool

    -

    Determines whether or not bool, true, and false are treated as keywords.

    -
    Syntax
    -

    #pragma bool on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, you can use the standard C++ bool type to represent true and false. Disable this pragma if recognizing bool, true, or false as keywords causes problems in your program.

    -

    NOTE This only applies when C++ is enabled using either the Force C++ Compilation option or #pragma cplusplus on.

    -

    This pragma corresponds to the Enable bool Support setting , described in “Using the bool Type”. To check this setting, use __option (bool), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + bool + + + + +

    bool

    +

    Determines whether or not bool, true, and false are treated as keywords.

    +
    Syntax
    +

    #pragma bool on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, you can use the standard C++ bool type to represent true and false. Disable this pragma if recognizing bool, true, or false as keywords causes problems in your program.

    +

    NOTE This only applies when C++ is enabled using either the Force C++ Compilation option or #pragma cplusplus on.

    +

    This pragma corresponds to the Enable bool Support setting , described in “Using the bool Type”. To check this setting, use __option (bool), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_c99.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_c99.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_c99.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,180 +1,180 @@ - - - - - - - c99 - - - - -

    c99

    -

    Controls the use of a subset of C99 language features.

    -
    Syntax
    -

    #pragma c99 on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    Set pragma c99 on to tell the Carbide x86 compiler to use the following supported C99 language features:

    - -
    -
    -

    #pragma c99 on
    - struct my_struct {
    - int i;
    - char c[2];} my_var;
    - my_var = ((struct my_struct) {x + y, 'a', 0});

    -
    -
    - -
    -
    -

    #pragma c99 on

    -

    struct X {
    - int a,b,c;
    - } x = { .c = 3, .a = 1, 2 };

    -

    union U {
    - char a;
    - long b;
    - } u = { .b = 1234567 };

    -

    int arr1[6] = { 1,2, [4] = 3,4 };
    - int arr2[6] = { 1, [1 ... 4] = 3,4 }; // GCC only, not part of C99

    -
    -
    - -
    -
    -

    struct {
    - int r;
    - char arr[];
    - } s;

    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Constant TypeFormat
    hex-fp-constanthex-string [ ‘.’ hex-string ] hex-exp [ size ]
    hex-stringhex-digit { hex-digit }
    hex-exp‘p’ decimal-string
    size‘f’ | ‘F’ | ‘l’ | ‘L’
    decimal-stringdecimal-digit { decimal-digit }
    decimal-digit<any decimal digit>
    hex-digit<any hexadecimal digit>
    -

    The compiler generates a warning when the mantissa is more precise than the host floating point format, and warnings are enabled. It generates an error if the exponent is too wide for the host float format.

    -

    Examples include:

    -

    0x2f.3a2p3
    - 0xEp1f
    - 0x1.8p0L

    -

    The standard library supports printing floats in this format using the “%a” and “%A” specifiers.

    -
    - -
    -
    -

    // good example of C99 Variable Length Array usage

    -

    #pragma c99 on
    - void f(int n) {
    - int arr[n];
    - ...
    - }

    -
    -

    While this example generates an error:

    -
    -

    // bad example of C99 Variable Length Array usage

    -

    #pragma c99 on
    - int n;
    - int arr[n]; // generates an error: variable length array
    - // types can only be used in local or
    - // function prototype scope

    -
    -

    A variable length array cannot be used in a function template’s prototype scope or in a local template typedef, as shown below:

    -
    -

    // bad example of C99 usage in Function Prototype

    -

    #pragma c99 on
    - template<typename T> int f(int n, int A[n][n]);
    - {
    - } // generates an error: variable length arrays
    - // cannot be used in function template prototypes
    - // or local template variables

    -
    -
    - -
    -
    -

    // examples of C99 Unsuffixed Constants

    -

    #pragma c99 on // and ULONG_MAX == 4294967295
    - sizeof(4294967295) == sizeof(long long)
    - sizeof(4294967295u) == sizeof(unsigned long)

    -

    #pragma c99 off
    - sizeof(4294967295) == sizeof(unsigned long)
    - sizeof(4294967295u) == sizeof(unsigned long)

    -
    -
    -

    The following C99 features are not currently supported:

    - -

    This pragma corresponds to the Enable C99 Extensions setting . To check this setting, use __option(c99), described in Checking Settings. The default setting is off.
    -

    -

    - - - - - + + + + + + + c99 + + + + +

    c99

    +

    Controls the use of a subset of C99 language features.

    +
    Syntax
    +

    #pragma c99 on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    Set pragma c99 on to tell the Carbide x86 compiler to use the following supported C99 language features:

    + +
    +
    +

    #pragma c99 on
    + struct my_struct {
    + int i;
    + char c[2];} my_var;
    + my_var = ((struct my_struct) {x + y, 'a', 0});

    +
    +
    + +
    +
    +

    #pragma c99 on

    +

    struct X {
    + int a,b,c;
    + } x = { .c = 3, .a = 1, 2 };

    +

    union U {
    + char a;
    + long b;
    + } u = { .b = 1234567 };

    +

    int arr1[6] = { 1,2, [4] = 3,4 };
    + int arr2[6] = { 1, [1 ... 4] = 3,4 }; // GCC only, not part of C99

    +
    +
    + +
    +
    +

    struct {
    + int r;
    + char arr[];
    + } s;

    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Constant TypeFormat
    hex-fp-constanthex-string [ ‘.’ hex-string ] hex-exp [ size ]
    hex-stringhex-digit { hex-digit }
    hex-exp‘p’ decimal-string
    size‘f’ | ‘F’ | ‘l’ | ‘L’
    decimal-stringdecimal-digit { decimal-digit }
    decimal-digit<any decimal digit>
    hex-digit<any hexadecimal digit>
    +

    The compiler generates a warning when the mantissa is more precise than the host floating point format, and warnings are enabled. It generates an error if the exponent is too wide for the host float format.

    +

    Examples include:

    +

    0x2f.3a2p3
    + 0xEp1f
    + 0x1.8p0L

    +

    The standard library supports printing floats in this format using the “%a” and “%A” specifiers.

    +
    + +
    +
    +

    // good example of C99 Variable Length Array usage

    +

    #pragma c99 on
    + void f(int n) {
    + int arr[n];
    + ...
    + }

    +
    +

    While this example generates an error:

    +
    +

    // bad example of C99 Variable Length Array usage

    +

    #pragma c99 on
    + int n;
    + int arr[n]; // generates an error: variable length array
    + // types can only be used in local or
    + // function prototype scope

    +
    +

    A variable length array cannot be used in a function template’s prototype scope or in a local template typedef, as shown below:

    +
    +

    // bad example of C99 usage in Function Prototype

    +

    #pragma c99 on
    + template<typename T> int f(int n, int A[n][n]);
    + {
    + } // generates an error: variable length arrays
    + // cannot be used in function template prototypes
    + // or local template variables

    +
    +
    + +
    +
    +

    // examples of C99 Unsuffixed Constants

    +

    #pragma c99 on // and ULONG_MAX == 4294967295
    + sizeof(4294967295) == sizeof(long long)
    + sizeof(4294967295u) == sizeof(unsigned long)

    +

    #pragma c99 off
    + sizeof(4294967295) == sizeof(unsigned long)
    + sizeof(4294967295u) == sizeof(unsigned long)

    +
    +
    +

    The following C99 features are not currently supported:

    + +

    This pragma corresponds to the Enable C99 Extensions setting . To check this setting, use __option(c99), described in Checking Settings. The default setting is off.
    +

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_check_header_flags.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_check_header_flags.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_check_header_flags.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,29 +1,29 @@ - - - - - - - check_header_flags - - - - -

    check_header_flags

    -

    Controls whether or not to ensure that a precompiled header’s data matches a project’s target settings.

    -
    Syntax
    -

    #pragma check_header_flags on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    This pragma affects precompiled headers only.

    -

    If you enable this pragma, the compiler ensures that the precompiled header’s preferences for double size (8-byte or 12-byte), int size (2-byte or 4-byte) and floating point math correspond to the build target’s settings. If they do not match, the compiler generates an error.

    -

    If your precompiled header file depends on these settings, enable this pragma. Otherwise, disable it.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (check_header_flags), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + check_header_flags + + + + +

    check_header_flags

    +

    Controls whether or not to ensure that a precompiled header’s data matches a project’s target settings.

    +
    Syntax
    +

    #pragma check_header_flags on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    This pragma affects precompiled headers only.

    +

    If you enable this pragma, the compiler ensures that the precompiled header’s preferences for double size (8-byte or 12-byte), int size (2-byte or 4-byte) and floating point math correspond to the build target’s settings. If they do not match, the compiler generates an error.

    +

    If your precompiled header file depends on these settings, enable this pragma. Otherwise, disable it.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (check_header_flags), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_const_strings.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_const_strings.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_const_strings.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - const_strings - - - - -

    const_strings

    -

    Controls the const-ness of string literals.

    -
    Syntax
    -

    #pragma const_strings [ on | off | reset ] -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the type of string literals is an array const char[n], or const wchar_t[n] for wide strings, where n is the length of the string literal plus 1 for a terminating NUL character. Otherwise, the type char[n] or wchar_t[n] is used.

    -

    This pragma does not correspond to any setting . To check this setting, use __option (const_strings), this pragma is on when compiling C++ source code; off when compiling C source code.

    - - - - - - + + + + + + + const_strings + + + + +

    const_strings

    +

    Controls the const-ness of string literals.

    +
    Syntax
    +

    #pragma const_strings [ on | off | reset ] +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the type of string literals is an array const char[n], or const wchar_t[n] for wide strings, where n is the length of the string literal plus 1 for a terminating NUL character. Otherwise, the type char[n] or wchar_t[n] is used.

    +

    This pragma does not correspond to any setting . To check this setting, use __option (const_strings), this pragma is on when compiling C++ source code; off when compiling C source code.

    + + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_cplusplus.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_cplusplus.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_cplusplus.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - cplusplus - - - - -

    cplusplus

    -

    Controls whether or not to translate subsequent source code as C or C++ source code.

    -
    Syntax
    -

    #pragma cplusplus on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler translates the source code that follows as C++ code. Otherwise, the compiler uses the suffix of the filename to determine how to compile it. If a file name ends in .c, .h, or .pch, the compiler automatically compiles it as C code, otherwise as C++. Use this pragma only if a file contains both C and C++ code.

    -

    NOTE The Carbide C/C++ compilers do not distinguish between uppercase and lowercase letters in file names and file name extensions except on UNIX-based systems.

    -

    This pragma corresponds to the Force C++ Compilation setting . To check this setting, use __option (cplusplus), described in Checking Settings. The default setting is off.

    - - - - - + + + + + + + cplusplus + + + + +

    cplusplus

    +

    Controls whether or not to translate subsequent source code as C or C++ source code.

    +
    Syntax
    +

    #pragma cplusplus on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler translates the source code that follows as C++ code. Otherwise, the compiler uses the suffix of the filename to determine how to compile it. If a file name ends in .c, .h, or .pch, the compiler automatically compiles it as C code, otherwise as C++. Use this pragma only if a file contains both C and C++ code.

    +

    NOTE The Carbide C/C++ compilers do not distinguish between uppercase and lowercase letters in file names and file name extensions except on UNIX-based systems.

    +

    This pragma corresponds to the Force C++ Compilation setting . To check this setting, use __option (cplusplus), described in Checking Settings. The default setting is off.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_cpp_extensions.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_cpp_extensions.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_cpp_extensions.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,59 +1,59 @@ - - - - - - - cpp_extensions - - - - -

    cpp_extensions

    -

    Controls language extensions to ISO C++.

    -
    Syntax
    -

    #pragma cpp_extensions on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, you can use the following extensions to the ANSI C++ standard that would otherwise be illegal:

    - -
    -
    #pragma cpp_extensions on
    - void foo()
    - {
    - union {
    - long hilo;
    - struct { short hi, lo; }; // anonymous struct
    - };
    - hi=0x1234;
    - lo=0x5678; // hilo==0x12345678
    - }
    -
    - -
    -
    -

    #pragma cpp_extensions on
    - struct Foo { void f(); }
    - void Foo::f()
    - {
    - void (Foo::*ptmf1)() = &Foo::f; // ALWAYS OK

    -

    void (Foo::*ptmf2)() = f; // OK if you enable cpp_extensions.
    - }

    -
    -
    - -

    This pragma does not correspond to any setting . To check this setting, use the __option (cpp_extensions). This pragma is on if generating Win32/x86-compatible object code; off if not.

    -

    - - - - - + + + + + + + cpp_extensions + + + + +

    cpp_extensions

    +

    Controls language extensions to ISO C++.

    +
    Syntax
    +

    #pragma cpp_extensions on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, you can use the following extensions to the ANSI C++ standard that would otherwise be illegal:

    + +
    +
    #pragma cpp_extensions on
    + void foo()
    + {
    + union {
    + long hilo;
    + struct { short hi, lo; }; // anonymous struct
    + };
    + hi=0x1234;
    + lo=0x5678; // hilo==0x12345678
    + }
    +
    + +
    +
    +

    #pragma cpp_extensions on
    + struct Foo { void f(); }
    + void Foo::f()
    + {
    + void (Foo::*ptmf1)() = &Foo::f; // ALWAYS OK

    +

    void (Foo::*ptmf2)() = f; // OK if you enable cpp_extensions.
    + }

    +
    +
    + +

    This pragma does not correspond to any setting . To check this setting, use the __option (cpp_extensions). This pragma is on if generating Win32/x86-compatible object code; off if not.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_debug_inline.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_debug_inline.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_debug_inline.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,28 +1,28 @@ - - - - - - - debuginline - - - - -

    debuginline

    -

    Controls whether the compiler emits debugging information for expanded inline function calls.

    -
    Syntax
    -

    #pragma debuginline on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If the compiler emits debugging information for inline function calls, then the debugger can step into the body of the inlined function. This more closely resembles the debugging experience for un-inlined code.

    -

    NOTE Since the actual “call” and “return” instructions are no longer present when stepping through inline code, the debugger will immediately jump to the body of an inlined function and “return” before reaching the return statement for the function. Thus, the debugging experience of inlined functions may not be as smooth as debugging un-inlined code.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (debuginline), described in Checking Settings. The default setting is on.

    -

    - - - - - + + + + + + + debuginline + + + + +

    debuginline

    +

    Controls whether the compiler emits debugging information for expanded inline function calls.

    +
    Syntax
    +

    #pragma debuginline on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If the compiler emits debugging information for inline function calls, then the debugger can step into the body of the inlined function. This more closely resembles the debugging experience for un-inlined code.

    +

    NOTE Since the actual “call” and “return” instructions are no longer present when stepping through inline code, the debugger will immediately jump to the body of an inlined function and “return” before reaching the return statement for the function. Thus, the debugging experience of inlined functions may not be as smooth as debugging un-inlined code.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (debuginline), described in Checking Settings. The default setting is on.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_def_inherited.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_def_inherited.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_def_inherited.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,32 +1,32 @@ - - - - - - - def_inherited - - - - -

    def_inherited

    -

    Controls the use of inherited.

    -
    Syntax
    -

    #pragma def_inherited on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    The use of this pragma is deprecated. It lets you use the non-standard inherited symbol in C++ programming by implicitly adding

    -

    typedef base inherited;

    -

    as the first member in classes with a single base class.

    -

    NOTE The ISO C++ standard does not support the inherited symbol. Only the Carbide.c++ language implements the inherited symbol for single inheritance.

    -

    NOTE Pragmas may no longer correspond to their textual position in the file when this pragma is on.

    -

    This pragma does not correspond to any setting . To check this setting, use the __option (def_inherited), described in Checking Settings. The default setting is off.
    -

    -

    - - - - - + + + + + + + def_inherited + + + + +

    def_inherited

    +

    Controls the use of inherited.

    +
    Syntax
    +

    #pragma def_inherited on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    The use of this pragma is deprecated. It lets you use the non-standard inherited symbol in C++ programming by implicitly adding

    +

    typedef base inherited;

    +

    as the first member in classes with a single base class.

    +

    NOTE The ISO C++ standard does not support the inherited symbol. Only the Carbide.c++ language implements the inherited symbol for single inheritance.

    +

    NOTE Pragmas may no longer correspond to their textual position in the file when this pragma is on.

    +

    This pragma does not correspond to any setting . To check this setting, use the __option (def_inherited), described in Checking Settings. The default setting is off.
    +

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_defer_codegen.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_defer_codegen.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_defer_codegen.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,41 +1,41 @@ - - - - - - - defer_codegen - - - - -

    defer_codegen

    -

    Controls the inlining of functions that are not yet compiled.

    -
    Syntax
    -

    #pragma defer_codegen on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    This setting lets you use inline and auto-inline functions that are called before their definition:

    -
    -

    #pragma defer_codegen on
    - #pragma auto_inline on

    -

    extern void f();
    - extern void g();

    -

    main()
    - {
    - f(); // will be inlined
    - g(); // will be inlined
    - }

    -

    inline void f() {}
    - void g() {}

    -
    -

    NOTE The compiler requires more memory at compile time if you enable this pragma.

    -

    This pragma corresponds to the Deferred Inlining setting . To check this setting, use the __option (defer_codegen), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + defer_codegen + + + + +

    defer_codegen

    +

    Controls the inlining of functions that are not yet compiled.

    +
    Syntax
    +

    #pragma defer_codegen on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    This setting lets you use inline and auto-inline functions that are called before their definition:

    +
    +

    #pragma defer_codegen on
    + #pragma auto_inline on

    +

    extern void f();
    + extern void g();

    +

    main()
    + {
    + f(); // will be inlined
    + g(); // will be inlined
    + }

    +

    inline void f() {}
    + void g() {}

    +
    +

    NOTE The compiler requires more memory at compile time if you enable this pragma.

    +

    This pragma corresponds to the Deferred Inlining setting . To check this setting, use the __option (defer_codegen), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_defer_defarg_parsing.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_defer_defarg_parsing.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_defer_defarg_parsing.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,44 +1,44 @@ - - - - - - - defer_defarg_parsing - - - - -

    defer_defarg_parsing

    -

    Defers the parsing of default arguments in member functions.

    -
    Syntax
    -

    #pragma defer_defarg_parsing on | off -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    To be accepted as valid, some default expressions with template arguments will require additional parentheses. For example, the following source code generates an error:

    -
    -

    template<typename T,typename U> struct X { T t; U u; };

    -

    struct Y {
    - // the following line is not accepted, and generates
    - // an error with defer_defarg_parsing on
    - void f(X<int,int> = X<int,int>());
    - };

    -
    -

    While this version will not:

    -
    -

    template<typename T,typename U> struct X { T t; U u; };

    -

    struct Y {
    - // following line is OK,
    - // if default argument is parenthesized
    - void f(X<int,int> = (X<int,int>()) );
    - };

    -
    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (defer_defarg_parsing). The default setting is on.
    -

    - - - - - + + + + + + + defer_defarg_parsing + + + + +

    defer_defarg_parsing

    +

    Defers the parsing of default arguments in member functions.

    +
    Syntax
    +

    #pragma defer_defarg_parsing on | off +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    To be accepted as valid, some default expressions with template arguments will require additional parentheses. For example, the following source code generates an error:

    +
    +

    template<typename T,typename U> struct X { T t; U u; };

    +

    struct Y {
    + // the following line is not accepted, and generates
    + // an error with defer_defarg_parsing on
    + void f(X<int,int> = X<int,int>());
    + };

    +
    +

    While this version will not:

    +
    +

    template<typename T,typename U> struct X { T t; U u; };

    +

    struct Y {
    + // following line is OK,
    + // if default argument is parenthesized
    + void f(X<int,int> = (X<int,int>()) );
    + };

    +
    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (defer_defarg_parsing). The default setting is on.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_direct_destruction.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_direct_destruction.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_direct_destruction.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,18 +1,18 @@ - - - - - - - direct_destruction - - - - -

    direct_destruction (not available)

    -

    This pragma is no longer available.

    - - - - - + + + + + + + direct_destruction + + + + +

    direct_destruction (not available)

    +

    This pragma is no longer available.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_dollar_identifiers.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_dollar_identifiers.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_dollar_identifiers.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - dollar_identifiers - - - - -

    dollar_identifiers

    -

    Controls use of dollar signs ($) in identifiers.

    -
    Syntax
    -

    #pragma dollar_identifiers on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler accepts dollar signs ($) in identifiers. Otherwise, the compiler issues an error if it encounters anything but underscores, alphabetic, numeric character, and universal characters (\uxxxx, \Uxxxxxxxx) in an identifier.

    -

    This pragma does not correspond to any panel setting. To check this setting, use the __option (dollar_identifiers), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + dollar_identifiers + + + + +

    dollar_identifiers

    +

    Controls use of dollar signs ($) in identifiers.

    +
    Syntax
    +

    #pragma dollar_identifiers on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler accepts dollar signs ($) in identifiers. Otherwise, the compiler issues an error if it encounters anything but underscores, alphabetic, numeric character, and universal characters (\uxxxx, \Uxxxxxxxx) in an identifier.

    +

    This pragma does not correspond to any panel setting. To check this setting, use the __option (dollar_identifiers), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_dont_inline.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_dont_inline.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_dont_inline.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,28 +1,28 @@ - - - - - - - dont_inline - - - - -

    dont_inline

    -

    Controls the generation of inline functions.

    -
    Syntax
    -

    #pragma dont_inline on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler does not inline any function calls, even those declared with the inline keyword or within a class declaration. Also, it does not automatically inline functions, regardless of the setting of the pragma auto_inline, described in “auto_inline”. If you disable this pragma, the compiler expands all inline function calls, within the limits you set through other inlining-related pragmas.

    -

    This pragma corresponds to the Don’t Inline setting in Inline Depth dropdown menu . To check this setting, use __option (dont_inline), described in Checking Settings. The default setting is off.
    -

    -

    - - - - - + + + + + + + dont_inline + + + + +

    dont_inline

    +

    Controls the generation of inline functions.

    +
    Syntax
    +

    #pragma dont_inline on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler does not inline any function calls, even those declared with the inline keyword or within a class declaration. Also, it does not automatically inline functions, regardless of the setting of the pragma auto_inline, described in “auto_inline”. If you disable this pragma, the compiler expands all inline function calls, within the limits you set through other inlining-related pragmas.

    +

    This pragma corresponds to the Don’t Inline setting in Inline Depth dropdown menu . To check this setting, use __option (dont_inline), described in Checking Settings. The default setting is off.
    +

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_dont_reuse_strings.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_dont_reuse_strings.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_dont_reuse_strings.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,32 +1,32 @@ - - - - - - - access_errors - - - - -

    dont_reuse_strings

    -

    Controls whether or not to store each string literal separately in the string pool.

    -
    Syntax
    -

    #pragma dont_reuse_strings on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler stores each string literal separately. Otherwise, the compiler stores only one copy of identical string literals. This pragma helps you save memory if your program contains a lot of identical string literals that you do not modify.

    -

    For example, take this code segment:

    -

    char *str1="Hello";
    - char *str2="Hello"
    - *str2 = 'Y';

    -

    If you enable this pragma, str1 is "Hello", and str2 is "Yello". Otherwise, both str1 and str2 are "Yello".

    -

    This pragma corresponds to the Reuse Strings setting . To check this setting, use __option (dont_reuse_strings), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + access_errors + + + + +

    dont_reuse_strings

    +

    Controls whether or not to store each string literal separately in the string pool.

    +
    Syntax
    +

    #pragma dont_reuse_strings on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler stores each string literal separately. Otherwise, the compiler stores only one copy of identical string literals. This pragma helps you save memory if your program contains a lot of identical string literals that you do not modify.

    +

    For example, take this code segment:

    +

    char *str1="Hello";
    + char *str2="Hello"
    + *str2 = 'Y';

    +

    If you enable this pragma, str1 is "Hello", and str2 is "Yello". Otherwise, both str1 and str2 are "Yello".

    +

    This pragma corresponds to the Reuse Strings setting . To check this setting, use __option (dont_reuse_strings), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_ecplusplus.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_ecplusplus.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_ecplusplus.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - ecplusplus - - - - -

    ecplusplus

    -

    Controls the use of embedded C++ features.

    -
    Syntax
    -

    #pragma ecplusplus on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the C++ compiler disables the non-EC++ features of ANSI C++ such as templates, multiple inheritance, and so on. See “C++ and Embedded Systems” for more information on Embedded C++ support in Carbide C/C++ compilers.

    -

    This pragma corresponds to the EC++ Compatibility Mode setting . To check this setting, use __option (ecplusplus), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + ecplusplus + + + + +

    ecplusplus

    +

    Controls the use of embedded C++ features.

    +
    Syntax
    +

    #pragma ecplusplus on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the C++ compiler disables the non-EC++ features of ANSI C++ such as templates, multiple inheritance, and so on. See “C++ and Embedded Systems” for more information on Embedded C++ support in Carbide C/C++ compilers.

    +

    This pragma corresponds to the EC++ Compatibility Mode setting . To check this setting, use __option (ecplusplus), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_enumsalwaysint.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_enumsalwaysint.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_enumsalwaysint.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,39 +1,39 @@ - - - - - - - enumsalwaysint - - - - -

    enumsalwaysint

    -

    Specifies the size of enumerated types.

    -
    Syntax
    -

    #pragma enumsalwaysint on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the C/C++ compiler makes an enumerated type the same size as an int. If an enumerated constant is larger than int, the compiler generates an error. If this pragma is not enabled, the compiler makes an enumerated type the size of any integral type. It chooses the integral type with the size that most closely matches the size of the largest enumerated constant.

    -

    The type could be as small as a char or as large as a long long. Listing 10.15 shows an example.

    -
    -

    Listing 10.15 Example of Enumerations the Same as Size as int

    -

    enum SmallNumber { One = 1, Two = 2 };
    - /* If you enable enumsalwaysint, this type is the same size as an int.
    - Otherwise, this type is the same size as a char. */

    -

    enum BigNumber
    - { ThreeThousandMillion = 3000000000 };
    - /* If you enable enumsalwaysint, the compiler might generate an error.
    - Otherwise, this type is the same size as a long long. */

    -
    -

    For more information on how the compiler handles enumerated types, see Enumerated Types.

    -

    This pragma corresponds to the Enums Always Int setting . To check this setting, use __option (enumsalwaysint), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + enumsalwaysint + + + + +

    enumsalwaysint

    +

    Specifies the size of enumerated types.

    +
    Syntax
    +

    #pragma enumsalwaysint on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the C/C++ compiler makes an enumerated type the same size as an int. If an enumerated constant is larger than int, the compiler generates an error. If this pragma is not enabled, the compiler makes an enumerated type the size of any integral type. It chooses the integral type with the size that most closely matches the size of the largest enumerated constant.

    +

    The type could be as small as a char or as large as a long long. Listing 10.15 shows an example.

    +
    +

    Listing 10.15 Example of Enumerations the Same as Size as int

    +

    enum SmallNumber { One = 1, Two = 2 };
    + /* If you enable enumsalwaysint, this type is the same size as an int.
    + Otherwise, this type is the same size as a char. */

    +

    enum BigNumber
    + { ThreeThousandMillion = 3000000000 };
    + /* If you enable enumsalwaysint, the compiler might generate an error.
    + Otherwise, this type is the same size as a long long. */

    +
    +

    For more information on how the compiler handles enumerated types, see Enumerated Types.

    +

    This pragma corresponds to the Enums Always Int setting . To check this setting, use __option (enumsalwaysint), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_errno_name.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_errno_name.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_errno_name.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,33 +1,33 @@ - - - - - - - errno_name - - - - -

    errno_name

    -

    Tells the optimizer how to find the errno identifier.

    -
    Syntax
    -

    #pragma errno_name id | ... -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    When this pragma is used, the optimizer can use the identifier errno (either a macro or a function call) to optimize standard C library functions better. If not used, the optimizer makes worst-case assumptions about the effects of calls to the standard C library.

    -

    NOTE The MSL C library already includes a use of this pragma, so you would only need to use it for third-party C libraries.

    -

    If errno resolves to a variable name, specify it like this:

    -

    #pragma errno_name _Errno

    -

    If errno is a function call accessing ordinarily inaccessible globals, use this form:

    -

    #pragma errno_name ...

    -

    Otherwise, do not use this pragma as it can result in incorrect optimizations in your code.

    -

    This pragma does not correspond to any panel setting. By default, this pragma is unspecified (worst case assumption).

    -

    - - - - - + + + + + + + errno_name + + + + +

    errno_name

    +

    Tells the optimizer how to find the errno identifier.

    +
    Syntax
    +

    #pragma errno_name id | ... +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    When this pragma is used, the optimizer can use the identifier errno (either a macro or a function call) to optimize standard C library functions better. If not used, the optimizer makes worst-case assumptions about the effects of calls to the standard C library.

    +

    NOTE The MSL C library already includes a use of this pragma, so you would only need to use it for third-party C libraries.

    +

    If errno resolves to a variable name, specify it like this:

    +

    #pragma errno_name _Errno

    +

    If errno is a function call accessing ordinarily inaccessible globals, use this form:

    +

    #pragma errno_name ...

    +

    Otherwise, do not use this pragma as it can result in incorrect optimizations in your code.

    +

    This pragma does not correspond to any panel setting. By default, this pragma is unspecified (worst case assumption).

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_exceptions.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_exceptions.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_exceptions.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,28 +1,28 @@ - - - - - - - exceptions - - - - -

    exceptions

    -

    Controls the support of C++ exception handling.

    -
    Syntax
    -

    #pragma exceptions on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, you can use the try and catch statements in C++ to perform exception handling. If your program does not use exception handling, disable this setting to make your program smaller.

    -

    You can throw exceptions across any code compiled by the Carbide C/C++ compiler with #pragma exceptions on. You cannot throw exceptions across libraries compiled with #pragma exceptions off. If you throw an exception across one of these, the code calls terminate() and exits.

    -

    This pragma corresponds to the Enable C++ Exceptions setting . To check this setting, use __option (exceptions), described in Checking Settings. The default setting is on.

    -

    - - - - - + + + + + + + exceptions + + + + +

    exceptions

    +

    Controls the support of C++ exception handling.

    +
    Syntax
    +

    #pragma exceptions on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, you can use the try and catch statements in C++ to perform exception handling. If your program does not use exception handling, disable this setting to make your program smaller.

    +

    You can throw exceptions across any code compiled by the Carbide C/C++ compiler with #pragma exceptions on. You cannot throw exceptions across libraries compiled with #pragma exceptions off. If you throw an exception across one of these, the code calls terminate() and exits.

    +

    This pragma corresponds to the Enable C++ Exceptions setting . To check this setting, use __option (exceptions), described in Checking Settings. The default setting is on.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_explicit_zero_data.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_explicit_zero_data.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_explicit_zero_data.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - explicit_zero_data - - - - -

    explicit_zero_data

    -

    Controls the placement of zero-initialized data.

    -
    Syntax
    -

    #pragma explicit_zero_data on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    Places zero-initialized data into the initialized data section instead of the BSS section when on.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (explicit_zero_data), described in Checking Settings. The default setting is off.

    - - - - - + + + + + + + explicit_zero_data + + + + +

    explicit_zero_data

    +

    Controls the placement of zero-initialized data.

    +
    Syntax
    +

    #pragma explicit_zero_data on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    Places zero-initialized data into the initialized data section instead of the BSS section when on.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (explicit_zero_data), described in Checking Settings. The default setting is off.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_export.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_export.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_export.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,30 +1,30 @@ - - - - - - - export - - - - -

    export

    -

    Controls the exporting of data or functions.

    -
    Syntax
    -

    #pragma export on | off | reset
    -
    #pragma export list name1 [, name2 ]*

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    When using the #pragma export on format, all functions are automatically exported.

    -

    When using the #pragma export list format, use it to tag data or functions for exporting. It applies to all names if it is used on an overloaded function. You cannot use this pragma for C++ member functions or static class members. An example of an lxported list:

    -

    extern int f(),g;
    -#pragma export list f,g

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (export), described in Checking Settings.

    -

    - - - - - + + + + + + + export + + + + +

    export

    +

    Controls the exporting of data or functions.

    +
    Syntax
    +

    #pragma export on | off | reset
    +
    #pragma export list name1 [, name2 ]*

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    When using the #pragma export on format, all functions are automatically exported.

    +

    When using the #pragma export list format, use it to tag data or functions for exporting. It applies to all names if it is used on an overloaded function. You cannot use this pragma for C++ member functions or static class members. An example of an lxported list:

    +

    extern int f(),g;
    +#pragma export list f,g

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (export), described in Checking Settings.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_extended_errorcheck.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_extended_errorcheck.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_extended_errorcheck.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - extended_errorcheck - - - - -

    extended_errorcheck

    -

    Controls the issuing of warnings for possible unintended logical errors.

    -
    Syntax
    -

    #pragma extended_errorcheck on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the C compiler generates a warning (not an error) if it encounters some common programming errors. See “Suspicious Assignments and Incorrect Function Returns” for descriptions of the errors that result in this warning.

    -

    This pragma corresponds to the Extended Error Checking setting . To check this setting, use __option (extended_errorcheck), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + extended_errorcheck + + + + +

    extended_errorcheck

    +

    Controls the issuing of warnings for possible unintended logical errors.

    +
    Syntax
    +

    #pragma extended_errorcheck on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the C compiler generates a warning (not an error) if it encounters some common programming errors. See “Suspicious Assignments and Incorrect Function Returns” for descriptions of the errors that result in this warning.

    +

    This pragma corresponds to the Extended Error Checking setting . To check this setting, use __option (extended_errorcheck), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_faster_pch_gen.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_faster_pch_gen.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_faster_pch_gen.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - access_errors - - - - -

    faster_pch_gen

    -

    Controls the performance of precompiled header generation.

    -
    Syntax
    -

    #pragma faster_pch_gen on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, generating a precompiled header can be much faster, depending on the header structure. However, it can also be slightly larger.

    -

    This pragma does not correspond to any panel setting. To check this setting, use the __option (faster_pch_gen), described in Checking Settings. The default setting is off.

    - - - - - + + + + + + + access_errors + + + + +

    faster_pch_gen

    +

    Controls the performance of precompiled header generation.

    +
    Syntax
    +

    #pragma faster_pch_gen on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, generating a precompiled header can be much faster, depending on the header structure. However, it can also be slightly larger.

    +

    This pragma does not correspond to any panel setting. To check this setting, use the __option (faster_pch_gen), described in Checking Settings. The default setting is off.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_flat_include.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_flat_include.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_flat_include.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,28 +1,28 @@ - - - - - - - flat_include - - - - -

    flat_include

    -

    Searches an #include using a relative path using only the base filename.

    -
    Syntax
    -

    #pragma flat_include on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    When on, searches are performed where, for example “#include <sys/stat.h>” is treated the same as “#include <stat.h>”.
    - This pragma is useful when porting code form a different operating system, or when a project’s access paths cannot reach a given file.

    -

    This pragma does not correspond to any panel setting. To check this setting, use the __option (flat_include), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + flat_include + + + + +

    flat_include

    +

    Searches an #include using a relative path using only the base filename.

    +
    Syntax
    +

    #pragma flat_include on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    When on, searches are performed where, for example “#include <sys/stat.h>” is treated the same as “#include <stat.h>”.
    + This pragma is useful when porting code form a different operating system, or when a project’s access paths cannot reach a given file.

    +

    This pragma does not correspond to any panel setting. To check this setting, use the __option (flat_include), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_float_constants.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_float_constants.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_float_constants.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - float_constants - - - - -

    float_constants

    -

    Controls how floating pointing constants are treated.

    -
    Syntax
    -

    #pragma float_constants on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler assumes that all unqualified floating point constant values are of type float, not double. This pragma is useful when porting source code for programs optimized for the “float” rather than the “double” type.

    -

    When you enable this pragma, you can still explicitly declare a constant value as double by appending a “D” suffix. For related information, see “The “D” Constant Suffix”.

    -

    This pragma does not correspond to any panel setting. To check this setting, use the __option (float_constants), described in Checking Settings. The default setting is off.

    - - - - - + + + + + + + float_constants + + + + +

    float_constants

    +

    Controls how floating pointing constants are treated.

    +
    Syntax
    +

    #pragma float_constants on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler assumes that all unqualified floating point constant values are of type float, not double. This pragma is useful when porting source code for programs optimized for the “float” rather than the “double” type.

    +

    When you enable this pragma, you can still explicitly declare a constant value as double by appending a “D” suffix. For related information, see “The “D” Constant Suffix”.

    +

    This pragma does not correspond to any panel setting. To check this setting, use the __option (float_constants), described in Checking Settings. The default setting is off.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_force_active.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_force_active.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_force_active.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - force_active - - - - -

    force_active

    -

    Controls how “dead” functions are linked.

    -
    Syntax
    -

    #pragma force_active on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the linker leaves functions within the scope of the pragma in the finished application, even if the functions are never called in the program.

    -

    This pragma does not correspond to any panel setting. To check this setting, use the __option (force_active), described in Checking Settings. The default setting is off.

    - - - - - + + + + + + + force_active + + + + +

    force_active

    +

    Controls how “dead” functions are linked.

    +
    Syntax
    +

    #pragma force_active on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the linker leaves functions within the scope of the pragma in the finished application, even if the functions are never called in the program.

    +

    This pragma does not correspond to any panel setting. To check this setting, use the __option (force_active), described in Checking Settings. The default setting is off.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_fullpath_file.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_fullpath_file.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_fullpath_file.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - fullpath_file - - - - -

    fullpath_file

    -

    Controls if the __FILE__ macro returns a full path or the base filename. The default is off.

    -
    Syntax
    -

    #pragma fullpath_file on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    When on, the __FILE__ macro returns a full path to the current file, otherwise it returns the base filename.

    -

    This pragma does not correspond to any panel setting. To check this setting, use the __option (fullpath_file), described in Checking Settings. The default setting is off.

    - - - - - + + + + + + + fullpath_file + + + + +

    fullpath_file

    +

    Controls if the __FILE__ macro returns a full path or the base filename. The default is off.

    +
    Syntax
    +

    #pragma fullpath_file on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    When on, the __FILE__ macro returns a full path to the current file, otherwise it returns the base filename.

    +

    This pragma does not correspond to any panel setting. To check this setting, use the __option (fullpath_file), described in Checking Settings. The default setting is off.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_fullpath_prepdump.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_fullpath_prepdump.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_fullpath_prepdump.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - fullpath_prepdump - - - - -

    fullpath_prepdump

    -

    Shows the full path of included files in preprocessor output.

    -
    Syntax
    -

    #pragma fullpath_prepdump on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler shows the full paths of files specified by the #include directive as comments in the preprocessor output. Otherwise, only the file name portion of the path appears.

    -

    This pragma corresponds to the Show full paths option . To check this setting, use the __option (fullpath_prepdump), described in Checking Settings. See also “line_prepdump”. The default setting is off.

    -

    - - - - - + + + + + + + fullpath_prepdump + + + + +

    fullpath_prepdump

    +

    Shows the full path of included files in preprocessor output.

    +
    Syntax
    +

    #pragma fullpath_prepdump on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler shows the full paths of files specified by the #include directive as comments in the preprocessor output. Otherwise, only the file name portion of the path appears.

    +

    This pragma corresponds to the Show full paths option . To check this setting, use the __option (fullpath_prepdump), described in Checking Settings. See also “line_prepdump”. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_gcc_extensions.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_gcc_extensions.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_gcc_extensions.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,77 +1,77 @@ - - - - - - - access_errors - - - - -

    gcc_extensions

    -

    Controls the acceptance of GNU C language extensions.

    -
    Syntax
    -

    #pragma gcc_extensions on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler accepts GNU C extensions in C source code. This includes the following non-ANSI C extensions:

    - -
    -

    int foo(int arg)
    - {
    - int arr[2] = { arg, arg+1 };
    - }

    -
    - -
    -

    pragma gcc_extensions on
    - #define POW2(n) ({ int i,r; for(r=1,i=n; i>0; --i) r<<=1; r;})

    -

    This feature only works for expressions in function bodies and does not support code that requires any form of C++ exception handling (for example, throwing or catching exceptions or creating local or temporary class objects that require a destructor call).

    -

    int main()
    - {
    - return POW2(4);
    - }

    -
    - -
    -

    #pragma gcc_extensions on
    - struct S { int a, b, b; } s = { c:3, b:2, a:1 };

    -
    - -
    -

    #pragma gcc_extensions on
    - int x, y, z;
    - x = y ?: z;
    - Outputs:
    - x = y ? y ? z;

    -
    - -

    This pragma corresponds to the Enable GCC Extensions setting . To check the global optimizer, use __option (gcc_extensions), described in Checking Settings. The default setting is off.
    -

    -

    - - - - - + + + + + + + access_errors + + + + +

    gcc_extensions

    +

    Controls the acceptance of GNU C language extensions.

    +
    Syntax
    +

    #pragma gcc_extensions on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler accepts GNU C extensions in C source code. This includes the following non-ANSI C extensions:

    + +
    +

    int foo(int arg)
    + {
    + int arr[2] = { arg, arg+1 };
    + }

    +
    + +
    +

    pragma gcc_extensions on
    + #define POW2(n) ({ int i,r; for(r=1,i=n; i>0; --i) r<<=1; r;})

    +

    This feature only works for expressions in function bodies and does not support code that requires any form of C++ exception handling (for example, throwing or catching exceptions or creating local or temporary class objects that require a destructor call).

    +

    int main()
    + {
    + return POW2(4);
    + }

    +
    + +
    +

    #pragma gcc_extensions on
    + struct S { int a, b, b; } s = { c:3, b:2, a:1 };

    +
    + +
    +

    #pragma gcc_extensions on
    + int x, y, z;
    + x = y ?: z;
    + Outputs:
    + x = y ? y ? z;

    +
    + +

    This pragma corresponds to the Enable GCC Extensions setting . To check the global optimizer, use __option (gcc_extensions), described in Checking Settings. The default setting is off.
    +

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_global_optimizer.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_global_optimizer.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_global_optimizer.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - global_optimizer - - - - -

    global_optimizer

    -

    Controls whether the Global Optimizer is invoked by the compiler.

    -
    Syntax
    -

    #pragma global_optimizer on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    In most compilers, this pragma determines whether the Global Optimizer is invoked in the Global Optimizations panel. If disabled, only simple optimizations and back-end optimizations are performed.

    -

    NOTE This is not the same as #pragma optimization_level. The Global Optimizer is invoked even at optimization_level 0 if #pragma global_optimizer is enabled.

    -

    This pragma corresponds to the settings in the Global Optimizations panel. To check this setting, use __option (global_optimizer) described in Checking Settings. The default setting is on.

    - - - - - + + + + + + + global_optimizer + + + + +

    global_optimizer

    +

    Controls whether the Global Optimizer is invoked by the compiler.

    +
    Syntax
    +

    #pragma global_optimizer on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    In most compilers, this pragma determines whether the Global Optimizer is invoked in the Global Optimizations panel. If disabled, only simple optimizations and back-end optimizations are performed.

    +

    NOTE This is not the same as #pragma optimization_level. The Global Optimizer is invoked even at optimization_level 0 if #pragma global_optimizer is enabled.

    +

    This pragma corresponds to the settings in the Global Optimizations panel. To check this setting, use __option (global_optimizer) described in Checking Settings. The default setting is on.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_ignore_oldstyle.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_ignore_oldstyle.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_ignore_oldstyle.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,42 +1,42 @@ - - - - - - - access_errors - - - - -

    ignore_oldstyle

    -

    Controls the recognition of function declarations that follow the conventions in place before ANSI/ISO C (i.e., “K&R” style).

    -
    Syntax
    - -

    #pragma ignore_oldstyle on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler ignores old-style function declarations and lets you prototype a function any way you want. In old-style declarations, you do not specify the types of the arguments in the argument list but on separate lines.

    -

    For example, the code in Listing 10.21 defines a prototype for a function with an old-style declaration.

    -
    -

    Listing 10.21 Mixing Old-style and Prototype Function Declarations

    -

    int f(char x, short y, float z);

    -

    #pragma ignore_oldstyle on

    -

    f(x, y, z)
    - char x;
    - short y;
    - float z;
    - {
    - return (int)x+y+z;
    - }

    -

    #pragma ignore_oldstyle reset

    -
    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (ignore_oldstyle), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + access_errors + + + + +

    ignore_oldstyle

    +

    Controls the recognition of function declarations that follow the conventions in place before ANSI/ISO C (i.e., “K&R” style).

    +
    Syntax
    + +

    #pragma ignore_oldstyle on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler ignores old-style function declarations and lets you prototype a function any way you want. In old-style declarations, you do not specify the types of the arguments in the argument list but on separate lines.

    +

    For example, the code in Listing 10.21 defines a prototype for a function with an old-style declaration.

    +
    +

    Listing 10.21 Mixing Old-style and Prototype Function Declarations

    +

    int f(char x, short y, float z);

    +

    #pragma ignore_oldstyle on

    +

    f(x, y, z)
    + char x;
    + short y;
    + float z;
    + {
    + return (int)x+y+z;
    + }

    +

    #pragma ignore_oldstyle reset

    +
    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (ignore_oldstyle), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_import.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_import.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_import.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,29 +1,29 @@ - - - - - - - import - - - - -

    import

    -

    Controls the importing of data or functions.

    -
    Syntax
    - #pragma import on | off | reset
    - #pragma import list name1 [, name2 ]*

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    When using the #pragma import on format, all functions are automatically imported.

    -

    When using the #pragma import list format, use to tag data or functions for importing. It applies to all names if it is used on an overloaded function. You cannot use this pragma for C++ member functions or static class members. An example of an imported list:

    -

    extern int f(),g;
    - #pragma import list f,g

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (import), described in Checking Settings. The default setting is off.

    - - - - - + + + + + + + import + + + + +

    import

    +

    Controls the importing of data or functions.

    +
    Syntax
    + #pragma import on | off | reset
    + #pragma import list name1 [, name2 ]*

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    When using the #pragma import on format, all functions are automatically imported.

    +

    When using the #pragma import list format, use to tag data or functions for importing. It applies to all names if it is used on an overloaded function. You cannot use this pragma for C++ member functions or static class members. An example of an imported list:

    +

    extern int f(),g;
    + #pragma import list f,g

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (import), described in Checking Settings. The default setting is off.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_inline_bottom_up.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_inline_bottom_up.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_inline_bottom_up.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,40 +1,40 @@ - - - - - - - inline_bottom_up - - - - -

    inline_bottom_up

    -

    Controls the bottom-up function inlining method.

    -
    Syntax
    -

    #pragma inline_bottom_up on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    Bottom-up function inlining tries to expand up to eight levels of inline leaf functions. The maximum size of an expanded inline function and the caller of an inline function can be controlled by the pragmas shown in Listing 10.23 and Listing 10.24.

    -
    -

    Listing 10.23 Maximum Complexity of an Inlined Function

    -

    // maximum complexity of an inlined function
    - #pragma inline_max_size( max ) // default max == 256

    -
    -
    -

    Listing 10.24 Maximum Complexity of a Function that Calls Inlined Functions

    -

    // maximum complexity of a function that calls inlined functions
    - #pragma inline_max_total_size( max ) // default max == 10000

    -
    -

    where max loosely corresponds to the number of instructions in a function.

    -

    If you enable this pragma, the compiler calculates inline depth from the last function in the call chain up to the first function that starts the call chain. The number of functions the compiler inlines from the bottom depends on the values of inline_depth, inline_max_size, and inline_max_total_size. This method generates faster and smaller source code for some (but not all) programs with many nested inline function calls.

    -

    If you disable this pragma, top-down inlining is selected, and the inline_depth setting determines the limits for top-down inlining.

    -

    The pragmas inline_max_size and inline_max_total_size do not affect the compiler in top-down mode.

    -

    This pragma corresponds to the Bottom-up Inline setting . To check this setting, use __option (inline_bottom_up), described in Checking Settings. The default setting is off.

    - - - - - + + + + + + + inline_bottom_up + + + + +

    inline_bottom_up

    +

    Controls the bottom-up function inlining method.

    +
    Syntax
    +

    #pragma inline_bottom_up on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    Bottom-up function inlining tries to expand up to eight levels of inline leaf functions. The maximum size of an expanded inline function and the caller of an inline function can be controlled by the pragmas shown in Listing 10.23 and Listing 10.24.

    +
    +

    Listing 10.23 Maximum Complexity of an Inlined Function

    +

    // maximum complexity of an inlined function
    + #pragma inline_max_size( max ) // default max == 256

    +
    +
    +

    Listing 10.24 Maximum Complexity of a Function that Calls Inlined Functions

    +

    // maximum complexity of a function that calls inlined functions
    + #pragma inline_max_total_size( max ) // default max == 10000

    +
    +

    where max loosely corresponds to the number of instructions in a function.

    +

    If you enable this pragma, the compiler calculates inline depth from the last function in the call chain up to the first function that starts the call chain. The number of functions the compiler inlines from the bottom depends on the values of inline_depth, inline_max_size, and inline_max_total_size. This method generates faster and smaller source code for some (but not all) programs with many nested inline function calls.

    +

    If you disable this pragma, top-down inlining is selected, and the inline_depth setting determines the limits for top-down inlining.

    +

    The pragmas inline_max_size and inline_max_total_size do not affect the compiler in top-down mode.

    +

    This pragma corresponds to the Bottom-up Inline setting . To check this setting, use __option (inline_bottom_up), described in Checking Settings. The default setting is off.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_inline_bottom_up_once.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_inline_bottom_up_once.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_inline_bottom_up_once.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - inline_bottom_up_once - - - - -

    inline_bottom_up_once

    -

    Performs a single bottom-up function inlining operation.

    -
    Syntax
    -

    #pragma inline_bottom_up_once on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    - This pragma does not correspond to any panel setting. To check this setting, use __option (inline_bottom_up_once), described in Checking Settings. The default setting is on. -

    - - - - - + + + + + + + inline_bottom_up_once + + + + +

    inline_bottom_up_once

    +

    Performs a single bottom-up function inlining operation.

    +
    Syntax
    +

    #pragma inline_bottom_up_once on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    + This pragma does not correspond to any panel setting. To check this setting, use __option (inline_bottom_up_once), described in Checking Settings. The default setting is on. +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_inline_depth.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_inline_depth.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_inline_depth.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,39 +1,39 @@ - - - - - - - inline_depth - - - - -

    inline_depth

    -

    Controls how many passes are used to expand inline function calls.

    -
    Syntax
    -

    #pragma inline_depth(n)
    - #pragma inline_depth(smart)

    -
    Parameters
    -

    n

    -
    -

    Sets the number of passes used to expand inline function calls. The number n is an integer from 0 to 1024 or the smart specifier. It also represents the distance allowed in the call chain from the last function up. For example, if d is the total depth of a call chain, then functions below (d-n) are inlined if they do not exceed the following size settings:

    -

    #pragma inline_max_size(n)
    - #pragma inline_max_total_size(n)

    -

    The first pragma sets the maximum function size to be considered for inlining; the second sets the maximum size to which a function is allowed to grow after the functions it calls are inlined. Here, n is the number of statements, operands, and operators in the function, which turns out to be roughly twice the number of instructions generated by the function. However, this number can vary from function to function. For the inline_max_size pragma, the default value of n is 256; for the pragma inline_max_total_size, the default value of n is 10000.

    -
    -

    smart

    -
    -

    The smart specifier is the default mode, with four passes where the passes 2-4 are limited to small inline functions. All inlineable functions are expanded if inline_depth is set to 1-1024.
    -

    -
    -
    Targets
    - All platforms.
    -
    Remarks
    - The pragmas dont_inline and always_inline override this pragma. This pragma corresponds to the Inline Depth setting . The default setting is off. -

    - - - - - + + + + + + + inline_depth + + + + +

    inline_depth

    +

    Controls how many passes are used to expand inline function calls.

    +
    Syntax
    +

    #pragma inline_depth(n)
    + #pragma inline_depth(smart)

    +
    Parameters
    +

    n

    +
    +

    Sets the number of passes used to expand inline function calls. The number n is an integer from 0 to 1024 or the smart specifier. It also represents the distance allowed in the call chain from the last function up. For example, if d is the total depth of a call chain, then functions below (d-n) are inlined if they do not exceed the following size settings:

    +

    #pragma inline_max_size(n)
    + #pragma inline_max_total_size(n)

    +

    The first pragma sets the maximum function size to be considered for inlining; the second sets the maximum size to which a function is allowed to grow after the functions it calls are inlined. Here, n is the number of statements, operands, and operators in the function, which turns out to be roughly twice the number of instructions generated by the function. However, this number can vary from function to function. For the inline_max_size pragma, the default value of n is 256; for the pragma inline_max_total_size, the default value of n is 10000.

    +
    +

    smart

    +
    +

    The smart specifier is the default mode, with four passes where the passes 2-4 are limited to small inline functions. All inlineable functions are expanded if inline_depth is set to 1-1024.
    +

    +
    +
    Targets
    + All platforms.
    +
    Remarks
    + The pragmas dont_inline and always_inline override this pragma. This pragma corresponds to the Inline Depth setting . The default setting is off. +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_inline_max_auto_size.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_inline_max_auto_size.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_inline_max_auto_size.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,30 +1,30 @@ - - - - - - - inline_max_auto_size - - - - -

    inline_max_auto_size

    -

    Determines the maximum complexity for an auto-inlined function.

    -
    Syntax
    -

    #pragma inline_max_auto_size ( complex )

    -
    Parameters
    -

    complex

    -
    -

    The complex value is an approximation of the number of statements in a function, the current default is 15. Selecting a higher value will inline more functions, but can lead to excessive code bloat.

    -
    -
    Targets
    - All platforms.
    -
    Remarks
    - This pragma does not correspond to any panel setting. To check this setting, use __option (inline_max_auto_size), described in Checking Settings. -

    - - - - - + + + + + + + inline_max_auto_size + + + + +

    inline_max_auto_size

    +

    Determines the maximum complexity for an auto-inlined function.

    +
    Syntax
    +

    #pragma inline_max_auto_size ( complex )

    +
    Parameters
    +

    complex

    +
    +

    The complex value is an approximation of the number of statements in a function, the current default is 15. Selecting a higher value will inline more functions, but can lead to excessive code bloat.

    +
    +
    Targets
    + All platforms.
    +
    Remarks
    + This pragma does not correspond to any panel setting. To check this setting, use __option (inline_max_auto_size), described in Checking Settings. +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_inline_max_size.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_inline_max_size.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_inline_max_size.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,30 +1,30 @@ - - - - - - - inline_max_size - - - - -

    inline_max_size

    -

    Sets the maximum number of statements, operands, and operators used to consider the function for inlining.

    -
    Syntax
    -

    #pragma inline_max_size ( size )

    -
    Parameters
    -

    size

    -
    -

    The maximum number of statements, operands, and operators in the function to consider it for inlining, up to a maximum of 256.

    -
    -
    Targets
    - All platforms.
    -
    Remarks
    - This pragma does not correspond to any panel setting. To check this setting, use __option (inline_max_size), described in Checking Settings. The default is 256. -

    - - - - - + + + + + + + inline_max_size + + + + +

    inline_max_size

    +

    Sets the maximum number of statements, operands, and operators used to consider the function for inlining.

    +
    Syntax
    +

    #pragma inline_max_size ( size )

    +
    Parameters
    +

    size

    +
    +

    The maximum number of statements, operands, and operators in the function to consider it for inlining, up to a maximum of 256.

    +
    +
    Targets
    + All platforms.
    +
    Remarks
    + This pragma does not correspond to any panel setting. To check this setting, use __option (inline_max_size), described in Checking Settings. The default is 256. +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_inline_max_total_size.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_inline_max_total_size.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_inline_max_total_size.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,30 +1,30 @@ - - - - - - - inline_max_total_size - - - - -

    inline_max_total_size

    -

    Sets the maximum total size a function can grow to when the function it calls is inlined.

    -
    Syntax
    -

    #pragma inline_max_total_size ( max_size )

    -
    Parameters
    -

    max_size

    -
    -

    The maximum number of statements, operands, and operators the inlined function calls that are also inlined, up to a maximum of 10000.

    -
    -
    Targets
    - All platforms.
    -
    Remarks
    - This pragma does not correspond to any panel setting. To check this setting, use __option (inline_max_total_size), described in Checking Settings. The default is 10000. -

    - - - - - + + + + + + + inline_max_total_size + + + + +

    inline_max_total_size

    +

    Sets the maximum total size a function can grow to when the function it calls is inlined.

    +
    Syntax
    +

    #pragma inline_max_total_size ( max_size )

    +
    Parameters
    +

    max_size

    +
    +

    The maximum number of statements, operands, and operators the inlined function calls that are also inlined, up to a maximum of 10000.

    +
    +
    Targets
    + All platforms.
    +
    Remarks
    + This pragma does not correspond to any panel setting. To check this setting, use __option (inline_max_total_size), described in Checking Settings. The default is 10000. +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_instmgr_file.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_instmgr_file.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_instmgr_file.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,29 +1,29 @@ - - - - - - - instmgr_file - - - - -

    instmgr_file

    -

    Controls where the instance manager database is written, to the target data directory or to a separate file.

    -
    Syntax
    -

    #pragma instmgr_file "name" -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    When the Use Instance Manager option is on, the IDE writes the instance manager database to the project’s data directory. If the #pragma instmgr_file is used, the database is written to a separate file.

    -

    Also, a separate instance file is always written when the command-line tools are used.

    -

    NOTE Should you need to report a bug, use this option to create a separate instance manager database, which can then be sent to technical support with your bug report.

    -

    This pragma corresponds to the Use Instance Manager setting . The default setting is off.

    -

    - - - - - + + + + + + + instmgr_file + + + + +

    instmgr_file

    +

    Controls where the instance manager database is written, to the target data directory or to a separate file.

    +
    Syntax
    +

    #pragma instmgr_file "name" +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    When the Use Instance Manager option is on, the IDE writes the instance manager database to the project’s data directory. If the #pragma instmgr_file is used, the database is written to a separate file.

    +

    Also, a separate instance file is always written when the command-line tools are used.

    +

    NOTE Should you need to report a bug, use this option to create a separate instance manager database, which can then be sent to technical support with your bug report.

    +

    This pragma corresponds to the Use Instance Manager setting . The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_internal.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_internal.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_internal.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,30 +1,30 @@ - - - - - - - internal - - - - -

    internal

    -

    Controls the internalization of data or functions.

    -
    Syntax
    -

    #pragma internal on | off | reset
    - #pragma internal list name1 [, name2 ]*

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    When using the #pragma internal on format, all data and functions are automatically internalized.

    -

    Use the #pragma internal list format to tag specific data or functions for internalization. It applies to all names if it is used on an overloaded function. You cannot use this pragma for C++ member functions or static class members. An example of an internalized list:

    -

    extern int f(),g;
    - #pragma internal list f,g

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (internal), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + internal + + + + +

    internal

    +

    Controls the internalization of data or functions.

    +
    Syntax
    +

    #pragma internal on | off | reset
    + #pragma internal list name1 [, name2 ]*

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    When using the #pragma internal on format, all data and functions are automatically internalized.

    +

    Use the #pragma internal list format to tag specific data or functions for internalization. It applies to all names if it is used on an overloaded function. You cannot use this pragma for C++ member functions or static class members. An example of an internalized list:

    +

    extern int f(),g;
    + #pragma internal list f,g

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (internal), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_keepcomments.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_keepcomments.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_keepcomments.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - access_errors - - - - -

    keepcomments

    -

    Controls whether comments are emitted in the preprocessor output.

    -
    Syntax
    -

    #pragma keepcomments on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    - This pragma corresponds to the Keep comments option . The default setting is off. -

    - - - - - + + + + + + + access_errors + + + + +

    keepcomments

    +

    Controls whether comments are emitted in the preprocessor output.

    +
    Syntax
    +

    #pragma keepcomments on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    + This pragma corresponds to the Keep comments option . The default setting is off. +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_lib_export.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_lib_export.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_lib_export.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,31 +1,31 @@ - - - - - - - lib_export - - - - -

    lib_export

    -

    Controls the exporting of data or functions.

    -
    Syntax
    -

    #pragma lib_export on | off | reset
    - #pragma lib_export list name1 [, name2 ]*
    -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    When using the #pragma lib_export on format, all data and functions are automatically exported.

    -

    Use the #pragma lib_export list format to tag specific data or functions for exporting. It applies to all names if it is used on an overloaded function. You cannot use this pragma for C++ member functions or static class members. An example of a lib_export list:

    -

    extern int f(),g;
    - #pragma lib_export list f,g

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (lib_export), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + lib_export + + + + +

    lib_export

    +

    Controls the exporting of data or functions.

    +
    Syntax
    +

    #pragma lib_export on | off | reset
    + #pragma lib_export list name1 [, name2 ]*
    +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    When using the #pragma lib_export on format, all data and functions are automatically exported.

    +

    Use the #pragma lib_export list format to tag specific data or functions for exporting. It applies to all names if it is used on an overloaded function. You cannot use this pragma for C++ member functions or static class members. An example of a lib_export list:

    +

    extern int f(),g;
    + #pragma lib_export list f,g

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (lib_export), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_line_prepdump.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_line_prepdump.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_line_prepdump.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,28 +1,28 @@ - - - - - - - line_prepdump - - - - -

    line_prepdump

    -

    Shows #line directives in preprocessor output.

    -
    Syntax
    -

    #pragma line_prepdump on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, #line directives appear in preprocessor output, and line spacing is preserved through the insertion of empty lines.

    -

    Use this pragma with the command-line compiler’s -E option to make sure that #line directives are inserted in the compiler’s output.

    -

    This pragma corresponds to the Use #line option . To check this setting, use the __option (line_prepdump), described in Checking Settings. See also “fullpath_prepdump”. The default setting is off.

    -

    - - - - - + + + + + + + line_prepdump + + + + +

    line_prepdump

    +

    Shows #line directives in preprocessor output.

    +
    Syntax
    +

    #pragma line_prepdump on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, #line directives appear in preprocessor output, and line spacing is preserved through the insertion of empty lines.

    +

    Use this pragma with the command-line compiler’s -E option to make sure that #line directives are inserted in the compiler’s output.

    +

    This pragma corresponds to the Use #line option . To check this setting, use the __option (line_prepdump), described in Checking Settings. See also “fullpath_prepdump”. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_longlong.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_longlong.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_longlong.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,29 +1,29 @@ - - - - - - - longlong - - - - -

    longlong

    -

    Controls the availability of the long long type.

    -
    Syntax
    -

    #pragma longlong on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    When the longlong pragma is enabled, the C or C++ compiler lets you define a 64-bit integer with the type specifier long long. This type is twice as large as a long int, which is a 32-bit integer. A variable of type long long can hold values from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.

    -

    An unsigned long long can hold values from 0 to 18,446,744,073,709,551,615.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (longlong), described in Checking Settings.

    -

    This pragma is on in compiles that support the long long type by default. It is off in compiles that do not support, or cannot turn on, the long long type.

    -

    - - - - - + + + + + + + longlong + + + + +

    longlong

    +

    Controls the availability of the long long type.

    +
    Syntax
    +

    #pragma longlong on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    When the longlong pragma is enabled, the C or C++ compiler lets you define a 64-bit integer with the type specifier long long. This type is twice as large as a long int, which is a 32-bit integer. A variable of type long long can hold values from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.

    +

    An unsigned long long can hold values from 0 to 18,446,744,073,709,551,615.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (longlong), described in Checking Settings.

    +

    This pragma is on in compiles that support the long long type by default. It is off in compiles that do not support, or cannot turn on, the long long type.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_longlong_enums.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_longlong_enums.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_longlong_enums.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,28 +1,28 @@ - - - - - - - longlong_enums - - - - -

    longlong_enums

    -

    Controls whether or not enumerated types may have the size of the long long type.

    -
    Syntax
    -

    #pragma longlong_enums on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    This pragma lets you use enumerators that are large enough to be long long integers. It is ignored if you enable the pragma enumsalwaysint (described in “enumsalwaysint”).

    -

    For more information on how the compiler handles enumerated types, see Enumerated Types.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (longlong_enums), described in Checking Settings. The default setting is on.

    -

    - - - - - + + + + + + + longlong_enums + + + + +

    longlong_enums

    +

    Controls whether or not enumerated types may have the size of the long long type.

    +
    Syntax
    +

    #pragma longlong_enums on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    This pragma lets you use enumerators that are large enough to be long long integers. It is ignored if you enable the pragma enumsalwaysint (described in “enumsalwaysint”).

    +

    For more information on how the compiler handles enumerated types, see Enumerated Types.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (longlong_enums), described in Checking Settings. The default setting is on.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_longlong_prepeval.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_longlong_prepeval.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_longlong_prepeval.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - longlong_prepeval - - - - -

    longlong_prepeval

    -

    Controls whether or not the preprocessor treats integral constant expressions as long long.

    -
    Syntax
    -

    #pragma longlong_prepeval on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the C/C++ preprocessor treats integral constant expressions in #if, #elif as type long long.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (longlong_prepeval), described in Checking Settings. The default setting is on.

    -

    - - - - - + + + + + + + longlong_prepeval + + + + +

    longlong_prepeval

    +

    Controls whether or not the preprocessor treats integral constant expressions as long long.

    +
    Syntax
    +

    #pragma longlong_prepeval on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the C/C++ preprocessor treats integral constant expressions in #if, #elif as type long long.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (longlong_prepeval), described in Checking Settings. The default setting is on.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_macro_prepdump.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_macro_prepdump.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_macro_prepdump.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - macro_prepdump - - - - -

    macro_prepdump

    -

    Controls whether macro #defines and #undefs are emitted in the output when parsed.

    -
    Syntax
    -

    #pragma macro_prepdump on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    TIP Use this pragma to help unravel confusing problems like macros that are aliasing indentifiers or where headers are redefining macros unexpectedly.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (macro_prepdump), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + macro_prepdump + + + + +

    macro_prepdump

    +

    Controls whether macro #defines and #undefs are emitted in the output when parsed.

    +
    Syntax
    +

    #pragma macro_prepdump on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    TIP Use this pragma to help unravel confusing problems like macros that are aliasing indentifiers or where headers are redefining macros unexpectedly.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (macro_prepdump), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_mark.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_mark.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_mark.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,28 +1,28 @@ - - - - - - - mark - - - - -

    mark

    -

    Adds an item to the Function pop-up menu in the IDE editor.

    -
    Syntax
    -

    #pragma mark itemName

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    This pragma adds itemName to the source file’s Function pop-up menu. If you open the file in the Carbide Editor and select the item from the Function pop-up menu, the editor brings you to the pragma. Note that if the pragma is inside a function definition, the item does not appear in the Function pop-up menu.

    -

    If itemName begins with “--”, a menu separator appears in the IDE’s Function pop-up menu:

    -

    #pragma mark --

    -

    This pragma does not correspond to any panel setting.

    -

    - - - - - + + + + + + + mark + + + + +

    mark

    +

    Adds an item to the Function pop-up menu in the IDE editor.

    +
    Syntax
    +

    #pragma mark itemName

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    This pragma adds itemName to the source file’s Function pop-up menu. If you open the file in the Carbide Editor and select the item from the Function pop-up menu, the editor brings you to the pragma. Note that if the pragma is inside a function definition, the item does not appear in the Function pop-up menu.

    +

    If itemName begins with “--”, a menu separator appears in the IDE’s Function pop-up menu:

    +

    #pragma mark --

    +

    This pragma does not correspond to any panel setting.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_maxerrorcount.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_maxerrorcount.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_maxerrorcount.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,35 +1,35 @@ - - - - - - - maxerrorcount - - - - -

    maxerrorcount

    -

    Limits the number of errors emitted while compiling a single file.

    -
    Syntax
    -

    #pragma maxerrorcount( <num> | off )

    -
    Parameters
    -

    num

    -
    -

    Specifies the maximum number of error messages issued per source file.

    -
    -

    off

    -
    -

    Effectively unbounds the number of issued error messages.

    -
    -
    Targets
    - All platforms.
    -
    Remarks
    -

    The total number of error messages emitted may include one final message "Too many errors emitted."

    -

    This pragma does not correspond to any panel setting. By default, this pragma is off.

    -

    - - - - - + + + + + + + maxerrorcount + + + + +

    maxerrorcount

    +

    Limits the number of errors emitted while compiling a single file.

    +
    Syntax
    +

    #pragma maxerrorcount( <num> | off )

    +
    Parameters
    +

    num

    +
    +

    Specifies the maximum number of error messages issued per source file.

    +
    +

    off

    +
    +

    Effectively unbounds the number of issued error messages.

    +
    +
    Targets
    + All platforms.
    +
    Remarks
    +

    The total number of error messages emitted may include one final message "Too many errors emitted."

    +

    This pragma does not correspond to any panel setting. By default, this pragma is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_message.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_message.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_message.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,30 +1,30 @@ - - - - - - - message - - - - -

    message

    -

    Tells the compiler to issue a text message to the user. The message appears in the Errors & Warnings window.

    -
    Syntax
    -

    #pragma message( msg )

    -
    Parameter
    -

    msg

    -
    -

    Actual message to issue. Does not have to be a string literal.

    -
    -
    Targets
    - All platforms.
    -
    Remarks
    - This pragma does not correspond to any panel setting. -

    - - - - - + + + + + + + message + + + + +

    message

    +

    Tells the compiler to issue a text message to the user. The message appears in the Errors & Warnings window.

    +
    Syntax
    +

    #pragma message( msg )

    +
    Parameter
    +

    msg

    +
    +

    Actual message to issue. Does not have to be a string literal.

    +
    +
    Targets
    + All platforms.
    +
    Remarks
    + This pragma does not correspond to any panel setting. +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_mpwc_newline.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_mpwc_newline.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_mpwc_newline.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,29 +1,29 @@ - - - - - - - mpwc_newline - - - - -

    mpwc_newline

    -

    Controls the newline character convention.

    -
    Syntax
    -

    #pragma mpwc_newline on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler uses the MPW conventions for the '\n' and '\r' characters. Otherwise, the compiler uses the ANSI C/C++ conventions for these characters.

    -

    In MPW, '\n' is a Carriage Return (0x0D) and '\r' is a Line Feed (0x0A). In ANSI C/C++, they are reversed: '\n' is a Line Feed and '\r' is a Carriage Return.

    -

    If you enable this pragma, use ANSI C/C++ libraries that were compiled when this pragma was enabled. The file names of the 68K versions of these libraries include the letters NL (for example, MSL C.68K (NL_2i).Lib). The PowerPC versions of these libraries are marked with NL; for example, MSL C.PPC (NL).Lib.

    -

    If you enable this pragma and use the standard ANSI C/C++ libraries, you cannot read and write '\n' and '\r' properly. For example, printing '\n' brings you to the beginning of the current line instead of inserting a newline.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (mpwc_newline), described in Checking Settings. The default setting is off.

    - - - - - + + + + + + + mpwc_newline + + + + +

    mpwc_newline

    +

    Controls the newline character convention.

    +
    Syntax
    +

    #pragma mpwc_newline on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler uses the MPW conventions for the '\n' and '\r' characters. Otherwise, the compiler uses the ANSI C/C++ conventions for these characters.

    +

    In MPW, '\n' is a Carriage Return (0x0D) and '\r' is a Line Feed (0x0A). In ANSI C/C++, they are reversed: '\n' is a Line Feed and '\r' is a Carriage Return.

    +

    If you enable this pragma, use ANSI C/C++ libraries that were compiled when this pragma was enabled. The file names of the 68K versions of these libraries include the letters NL (for example, MSL C.68K (NL_2i).Lib). The PowerPC versions of these libraries are marked with NL; for example, MSL C.PPC (NL).Lib.

    +

    If you enable this pragma and use the standard ANSI C/C++ libraries, you cannot read and write '\n' and '\r' properly. For example, printing '\n' brings you to the beginning of the current line instead of inserting a newline.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (mpwc_newline), described in Checking Settings. The default setting is off.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_mpwc_relax.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_mpwc_relax.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_mpwc_relax.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,33 +1,33 @@ - - - - - - - mpwc_relax - - - - -

    mpwc_relax

    -

    Controls the compatibility of the char* and unsigned char* types.

    -
    Syntax
    -

    #pragma mpwc_relax on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler treats char* and unsigned char* as the same type. This setting is especially useful if you are using code written before the ANSI C standard. This old source code frequently used these types interchangeably.

    -

    This setting has no effect on C++ source code.

    -

    You can use this pragma to relax function pointer checking:

    -

    #pragma mpwc_relax on
    - extern void f(char *);
    - extern void(*fp1)(void *) = &f; // error but allowed
    - extern void(*fp2)(unsigned char *) = &f; // error but allowed

    -

    This pragma does not correspond to any panel setting. To check this setting, __option (mpwc_relax), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + mpwc_relax + + + + +

    mpwc_relax

    +

    Controls the compatibility of the char* and unsigned char* types.

    +
    Syntax
    +

    #pragma mpwc_relax on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler treats char* and unsigned char* as the same type. This setting is especially useful if you are using code written before the ANSI C standard. This old source code frequently used these types interchangeably.

    +

    This setting has no effect on C++ source code.

    +

    You can use this pragma to relax function pointer checking:

    +

    #pragma mpwc_relax on
    + extern void f(char *);
    + extern void(*fp1)(void *) = &f; // error but allowed
    + extern void(*fp2)(unsigned char *) = &f; // error but allowed

    +

    This pragma does not correspond to any panel setting. To check this setting, __option (mpwc_relax), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_msg_show_lineref.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_msg_show_lineref.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_msg_show_lineref.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - msg_show_lineref - - - - -

    msg_show_lineref

    -

    Controls diagnostic output by showing errors in source pointed to by #line.

    -
    Syntax
    -

    #pragma msg_show_lineref on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    - This pragma does not correspond to any panel setting. To check this setting, use __option (msg_show_lineref), described in Checking Settings. The default setting is on. -

    - - - - - + + + + + + + msg_show_lineref + + + + +

    msg_show_lineref

    +

    Controls diagnostic output by showing errors in source pointed to by #line.

    +
    Syntax
    +

    #pragma msg_show_lineref on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    + This pragma does not correspond to any panel setting. To check this setting, use __option (msg_show_lineref), described in Checking Settings. The default setting is on. +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_msg_show_realref.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_msg_show_realref.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_msg_show_realref.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - msg_show_realref - - - - -

    msg_show_realref

    -

    Controls diagnostic output showing errors in actual source where #line reference exists.

    -
    Syntax
    -

    #pragma msg_show_realref on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    - This pragma does not correspond to any panel setting. To check this setting, use __option (msg_show_realref), described in Checking Settings. The default setting is on. -

    - - - - - + + + + + + + msg_show_realref + + + + +

    msg_show_realref

    +

    Controls diagnostic output showing errors in actual source where #line reference exists.

    +
    Syntax
    +

    #pragma msg_show_realref on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    + This pragma does not correspond to any panel setting. To check this setting, use __option (msg_show_realref), described in Checking Settings. The default setting is on. +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_multibyteaware.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_multibyteaware.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_multibyteaware.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,29 +1,29 @@ - - - - - - - multibyteaware - - - - -

    multibyteaware

    -

    Controls how the Source encoding option is treated

    -
    Syntax
    -

    #pragma multibyteaware on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    This pragma has been deprecated. See the section “Multibyte and Unicode Support” and the #pragma text_encoding for more details.

    -

    When on, this pragma treats the Source encoding of “ASCII” like “Autodetect”. When off, this pragma treats a Source encoding of “Autodetect” like “ASCII” setting.

    -

    NOTE Previously, this pragma told the compiler to “look twice” at the “\” character to avoid misinterpreting the character in a multibyte character sequence.

    -

    This pragma does not correspond to any panel setting, but the replacement option Source encoding appears . To check this setting, use __option (multibyteaware), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + multibyteaware + + + + +

    multibyteaware

    +

    Controls how the Source encoding option is treated

    +
    Syntax
    +

    #pragma multibyteaware on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    This pragma has been deprecated. See the section “Multibyte and Unicode Support” and the #pragma text_encoding for more details.

    +

    When on, this pragma treats the Source encoding of “ASCII” like “Autodetect”. When off, this pragma treats a Source encoding of “Autodetect” like “ASCII” setting.

    +

    NOTE Previously, this pragma told the compiler to “look twice” at the “\” character to avoid misinterpreting the character in a multibyte character sequence.

    +

    This pragma does not correspond to any panel setting, but the replacement option Source encoding appears . To check this setting, use __option (multibyteaware), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_new_mangler.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_new_mangler.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_new_mangler.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - access_errors - - - - -

    new_mangler

    -

    Controls the inclusion or exclusion of a template instance’s function return type to the mangled name of the instance.

    -
    Syntax
    -

    #pragma new_mangler on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    The C++ standard requires that the function return type of a template instance to be included in the mangled name, which can cause incompatibilities. Enabling this pragma within a prefix file resolves those incompatibilities.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (new_mangler), described in Checking Settings. The default setting is on.

    -

    - - - - - + + + + + + + access_errors + + + + +

    new_mangler

    +

    Controls the inclusion or exclusion of a template instance’s function return type to the mangled name of the instance.

    +
    Syntax
    +

    #pragma new_mangler on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    The C++ standard requires that the function return type of a template instance to be included in the mangled name, which can cause incompatibilities. Enabling this pragma within a prefix file resolves those incompatibilities.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (new_mangler), described in Checking Settings. The default setting is on.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_no_conststringconv.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_no_conststringconv.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_no_conststringconv.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,34 +1,34 @@ - - - - - - - no_conststringconv - - - - -

    no_conststringconv

    -

    Disables the deprecated implicit const string literal conversion (ISO C++, §4.2).

    -
    Syntax
    -

    #pragma no_conststringconv on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    When enabled, the compiler generates an error when it encounters an implicit const string conversion. See example in Listing 10.27.

    -
    -

    Listing 10.27 Example of const string conversion

    -

    #pragma no_conststringconv on
    - char *cp = "Hello World"; // generates error: illegal
    - // implicit conversion from
    - // ’const char[12]’ to ’char *’

    -
    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (no_conststringconv), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + no_conststringconv + + + + +

    no_conststringconv

    +

    Disables the deprecated implicit const string literal conversion (ISO C++, §4.2).

    +
    Syntax
    +

    #pragma no_conststringconv on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    When enabled, the compiler generates an error when it encounters an implicit const string conversion. See example in Listing 10.27.

    +
    +

    Listing 10.27 Example of const string conversion

    +

    #pragma no_conststringconv on
    + char *cp = "Hello World"; // generates error: illegal
    + // implicit conversion from
    + // ’const char[12]’ to ’char *’

    +
    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (no_conststringconv), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_no_static_dtors.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_no_static_dtors.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_no_static_dtors.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - no_static_dtors - - - - -

    no_static_dtors

    -

    Controls the generation of static destructors in C++.

    -
    Syntax
    -

    #pragma no_static_dtors on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler does not generate destructor calls for static data objects. Use this pragma for smaller object code for C++ programs that never exit.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (no_static_dtors), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + no_static_dtors + + + + +

    no_static_dtors

    +

    Controls the generation of static destructors in C++.

    +
    Syntax
    +

    #pragma no_static_dtors on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler does not generate destructor calls for static data objects. Use this pragma for smaller object code for C++ programs that never exit.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (no_static_dtors), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_nosyminline.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_nosyminline.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_nosyminline.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - nosyminline - - - - -

    nosyminline

    -

    Controls whether debug information is gathered for inline/template functions.

    -
    Syntax
    -

    #pragma nosyminline on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    When on, debug information is not gathered for inline/template functions.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (nosyminline), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + nosyminline + + + + +

    nosyminline

    +

    Controls whether debug information is gathered for inline/template functions.

    +
    Syntax
    +

    #pragma nosyminline on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    When on, debug information is not gathered for inline/template functions.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (nosyminline), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_notonce.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_notonce.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_notonce.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - notonce - - - - -

    notonce

    -

    Controls whether or not the compiler lets included files be repeatedly included, even with #pragma once on.

    -
    Syntax
    -

    #pragma notonce

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, files can be repeatedly #included, even if you have enabled #pragma once on. For more information, see “once”.

    -

    This pragma does not correspond to any panel setting.

    -

    - - - - - + + + + + + + notonce + + + + +

    notonce

    +

    Controls whether or not the compiler lets included files be repeatedly included, even with #pragma once on.

    +
    Syntax
    +

    #pragma notonce

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, files can be repeatedly #included, even if you have enabled #pragma once on. For more information, see “once”.

    +

    This pragma does not correspond to any panel setting.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_objective_c.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_objective_c.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_objective_c.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,61 +1,61 @@ - - - - - - - access_errors - - - - -

    objective_c

    -

    Controls the use of Objective-C keywords.

    -
    Syntax
    -

    #pragma objective_c on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler lets you use the following additional objective C keywords:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    @class@def@encode
    @end@implementation@interface
    @private@protocol@protected
    @public@selectorbycopy
    byrefininout
    onewayout 
    -

    The @protocol forward declarations are supported

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (objective_c), described in Checking Settings.

    -

    By default, this setting is automatically enabled when a file’s extension is “.m” or “.pchm”. This setting and #pragma cplusplus on are automatically enabled when a file's extension is “.mm”, “.M”, or “.pchmm”.

    -

    - - - - - + + + + + + + access_errors + + + + +

    objective_c

    +

    Controls the use of Objective-C keywords.

    +
    Syntax
    +

    #pragma objective_c on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler lets you use the following additional objective C keywords:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    @class@def@encode
    @end@implementation@interface
    @private@protocol@protected
    @public@selectorbycopy
    byrefininout
    onewayout 
    +

    The @protocol forward declarations are supported

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (objective_c), described in Checking Settings.

    +

    By default, this setting is automatically enabled when a file’s extension is “.m” or “.pchm”. This setting and #pragma cplusplus on are automatically enabled when a file's extension is “.mm”, “.M”, or “.pchmm”.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_old_pragma_once.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_old_pragma_once.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_old_pragma_once.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,18 +1,18 @@ - - - - - - - old_pragma_once - - - - -

    old_pragma_once (not available)

    -

    This pragma is no longer available.

    - - - - - + + + + + + + old_pragma_once + + + + +

    old_pragma_once (not available)

    +

    This pragma is no longer available.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_old_vtable.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_old_vtable.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_old_vtable.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,18 +1,18 @@ - - - - - - - old_vtable - - - - -

    old_vtable (not available)

    -

    This pragma is no longer available.

    - - - - - + + + + + + + old_vtable + + + + +

    old_vtable (not available)

    +

    This pragma is no longer available.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_once.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_once.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_once.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,29 +1,29 @@ - - - - - - - once - - - - -

    once

    -

    Controls whether or not a header file can be included more than once in the same compilation unit.

    -
    Syntax
    -

    #pragma once [ on ] -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    Use this pragma to ensure that the compiler includes header files only once in a source file. This pragma is especially useful in precompiled header files.

    -

    There are two versions of this pragma: #pragma once and #pragma once on. Use #pragma once in a header file to ensure that the header file is included only once in a source file. Use #pragma once on in a header file or source file to insure that any file is included only once in a source file.

    -

    Be aware that when using #pragma once on, precompiled headers might not necessarily transfer from machine to machine and provide the same results. This is because the full paths of included files are stored to distinguish between two distinct files that have identical filenames but different paths. Use the warn_pch_portability pragma to issue a warning when #pragma once on is used in a precompiled header. For more information, see pragma warn_pch_portability.

    -

    This pragma does not correspond to any panel setting. The default setting is off.

    -

    - - - - - + + + + + + + once + + + + +

    once

    +

    Controls whether or not a header file can be included more than once in the same compilation unit.

    +
    Syntax
    +

    #pragma once [ on ] +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    Use this pragma to ensure that the compiler includes header files only once in a source file. This pragma is especially useful in precompiled header files.

    +

    There are two versions of this pragma: #pragma once and #pragma once on. Use #pragma once in a header file to ensure that the header file is included only once in a source file. Use #pragma once on in a header file or source file to insure that any file is included only once in a source file.

    +

    Be aware that when using #pragma once on, precompiled headers might not necessarily transfer from machine to machine and provide the same results. This is because the full paths of included files are stored to distinguish between two distinct files that have identical filenames but different paths. Use the warn_pch_portability pragma to issue a warning when #pragma once on is used in a precompiled header. For more information, see pragma warn_pch_portability.

    +

    This pragma does not correspond to any panel setting. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_only_std_keywords.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_only_std_keywords.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_only_std_keywords.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - only_std_keywords - - - - -

    only_std_keywords

    -

    Controls the use of ISO keywords.

    -
    Syntax
    -

    #pragma only_std_keywords on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    The C/C++ compiler recognizes additional reserved keywords. If you are writing code that must follow the ANSI standard strictly, enable the pragma only_std_keywords. For more information, see “ANSI Keywords Only”.

    -

    This pragma corresponds to the ANSI Keywords Only setting . To check this setting, use __option (only_std_keywords), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + only_std_keywords + + + + +

    only_std_keywords

    +

    Controls the use of ISO keywords.

    +
    Syntax
    +

    #pragma only_std_keywords on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    The C/C++ compiler recognizes additional reserved keywords. If you are writing code that must follow the ANSI standard strictly, enable the pragma only_std_keywords. For more information, see “ANSI Keywords Only”.

    +

    This pragma corresponds to the ANSI Keywords Only setting . To check this setting, use __option (only_std_keywords), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_classresults.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_classresults.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_classresults.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,39 +1,39 @@ - - - - - - - opt_classresults - - - - -

    opt_classresults

    -

    Controls the omission of the copy constructor call for class return types if all return statements in a function return the same local class object.

    -
    Syntax
    -

    #pragma opt_classresults on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    Example of using #pragma opt_classresults:

    -
    -

    #pragma opt_classresults on

    -

    struct X {
    - X();
    - X(const X&);
    - // ...
    - };

    -

    X f() {
    - X x; // directly constructed in function result buffer
    - // ...
    - return x; // no copy-ctor call
    - }

    -
    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (opt_classresults), described in Checking Settings. The default setting is on.

    - - - - - + + + + + + + opt_classresults + + + + +

    opt_classresults

    +

    Controls the omission of the copy constructor call for class return types if all return statements in a function return the same local class object.

    +
    Syntax
    +

    #pragma opt_classresults on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    Example of using #pragma opt_classresults:

    +
    +

    #pragma opt_classresults on

    +

    struct X {
    + X();
    + X(const X&);
    + // ...
    + };

    +

    X f() {
    + X x; // directly constructed in function result buffer
    + // ...
    + return x; // no copy-ctor call
    + }

    +
    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (opt_classresults), described in Checking Settings. The default setting is on.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_common_subs.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_common_subs.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_common_subs.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,29 +1,29 @@ - - - - - - - access_errors - - - - -

    opt_common_subs

    -

    Controls the use of common subexpression optimization.

    -
    Syntax
    -

    #pragma opt_common_subs on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler replaces similar redundant expressions with a single expression. For example, if two statements in a function both use the expression

    -

    a * b * c + 10

    -

    the compiler generates object code that computes the expression only once and applies the resulting value to both statements.

    -

    The compiler applies this optimization to its own internal representation of the object code it produces.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (opt_common_subs), this settings is related to the “global_optimizer” level.

    - - - - - + + + + + + + access_errors + + + + +

    opt_common_subs

    +

    Controls the use of common subexpression optimization.

    +
    Syntax
    +

    #pragma opt_common_subs on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler replaces similar redundant expressions with a single expression. For example, if two statements in a function both use the expression

    +

    a * b * c + 10

    +

    the compiler generates object code that computes the expression only once and applies the resulting value to both statements.

    +

    The compiler applies this optimization to its own internal representation of the object code it produces.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (opt_common_subs), this settings is related to the “global_optimizer” level.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_dead_assignments.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_dead_assignments.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_dead_assignments.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - opt_dead_assignments - - - - -

    opt_dead_assignments

    -

    Controls the use of dead store optimization.

    -
    Syntax
    -

    #pragma opt_dead_assignments on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler removes assignments to unused variables before reassigning them.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (opt_dead_assignments), this settings is related to the “global_optimizer” level.

    -

    - - - - - + + + + + + + opt_dead_assignments + + + + +

    opt_dead_assignments

    +

    Controls the use of dead store optimization.

    +
    Syntax
    +

    #pragma opt_dead_assignments on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler removes assignments to unused variables before reassigning them.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (opt_dead_assignments), this settings is related to the “global_optimizer” level.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_dead_code.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_dead_code.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_dead_code.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - opt_dead_code - - - - -

    opt_dead_code

    -

    Controls the use of dead code optimization.

    -
    Syntax
    -

    #pragma opt_dead_code on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler removes a statement that other statements never execute or call.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (opt_dead_code), this settings is related to the “global_optimizer” level.

    -

    - - - - - + + + + + + + opt_dead_code + + + + +

    opt_dead_code

    +

    Controls the use of dead code optimization.

    +
    Syntax
    +

    #pragma opt_dead_code on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler removes a statement that other statements never execute or call.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (opt_dead_code), this settings is related to the “global_optimizer” level.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_lifetimes.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_lifetimes.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_lifetimes.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - opt_lifetimes - - - - -

    opt_lifetimes

    -

    Controls the use of lifetime analysis optimization.

    -
    Syntax
    -

    #pragma opt_lifetimes on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler uses the same processor register for different variables that exist in the same routine but not in the same statement.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (opt_lifetimes), described in Checking Settings. This settings is related to the “global_optimizer” level.

    - - - - - + + + + + + + opt_lifetimes + + + + +

    opt_lifetimes

    +

    Controls the use of lifetime analysis optimization.

    +
    Syntax
    +

    #pragma opt_lifetimes on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler uses the same processor register for different variables that exist in the same routine but not in the same statement.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (opt_lifetimes), described in Checking Settings. This settings is related to the “global_optimizer” level.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_loop_invariants.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_loop_invariants.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_loop_invariants.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - opt_loop_invariants - - - - -

    opt_loop_invariants

    -

    Controls the use of loop invariant optimization.

    -
    Syntax
    -

    #pragma opt_loop_invariants on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler moves all computations that do not change inside a loop outside the loop, which then runs faster.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (opt_loop_invariants), described in Checking Settings. This settings is related to the “global_optimizer” level.

    -

    - - - - - + + + + + + + opt_loop_invariants + + + + +

    opt_loop_invariants

    +

    Controls the use of loop invariant optimization.

    +
    Syntax
    +

    #pragma opt_loop_invariants on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler moves all computations that do not change inside a loop outside the loop, which then runs faster.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (opt_loop_invariants), described in Checking Settings. This settings is related to the “global_optimizer” level.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_propagation.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_propagation.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_propagation.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - opt_propagation - - - - -

    opt_propagation

    -

    Controls the use of copy and constant propagation optimization.

    -
    Syntax
    - #pragma opt_propagation on | off | reset
    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler replaces multiple occurrences of one variable with a single occurrence.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (opt_propagation), described in Checking Settings. This settings is related to the “global_optimizer” level.

    -

    - - - - - + + + + + + + opt_propagation + + + + +

    opt_propagation

    +

    Controls the use of copy and constant propagation optimization.

    +
    Syntax
    + #pragma opt_propagation on | off | reset
    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler replaces multiple occurrences of one variable with a single occurrence.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (opt_propagation), described in Checking Settings. This settings is related to the “global_optimizer” level.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_strength_reduction.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_strength_reduction.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_strength_reduction.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - opt_strength_reduction - - - - -

    opt_strength_reduction

    -

    Controls the use of strength reduction optimization.

    -
    Syntax
    -

    #pragma opt_strength_reduction on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler replaces array element arithmetic instructions with pointer arithmetic instructions to make loops faster.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (opt_strength_reduction), described in Checking Settings. This settings is related to the “global_optimizer” level.

    -

    - - - - - + + + + + + + opt_strength_reduction + + + + +

    opt_strength_reduction

    +

    Controls the use of strength reduction optimization.

    +
    Syntax
    +

    #pragma opt_strength_reduction on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler replaces array element arithmetic instructions with pointer arithmetic instructions to make loops faster.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (opt_strength_reduction), described in Checking Settings. This settings is related to the “global_optimizer” level.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_strength_reduction_strict.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_strength_reduction_strict.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_strength_reduction_strict.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - opt_strength_reduction_strict - - - - -

    opt_strength_reduction_strict

    -

    Uses a safer variation of strength reduction optimization.

    -
    Syntax
    -

    #pragma opt_strength_reduction_strict on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    Like the pragma opt_strength_reduction, this setting replaces multiplication instructions that are inside loops with addition instructions to speed up the loops. However, unlike the regular strength reduction optimization, this variation ensures that the optimization is only applied when the array element arithmetic is not of an unsigned type that is smaller than a pointer type.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (opt_strength_reduction_strict), described in Checking Settings. The default varies according to the compiler.

    -

    - - - - - + + + + + + + opt_strength_reduction_strict + + + + +

    opt_strength_reduction_strict

    +

    Uses a safer variation of strength reduction optimization.

    +
    Syntax
    +

    #pragma opt_strength_reduction_strict on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    Like the pragma opt_strength_reduction, this setting replaces multiplication instructions that are inside loops with addition instructions to speed up the loops. However, unlike the regular strength reduction optimization, this variation ensures that the optimization is only applied when the array element arithmetic is not of an unsigned type that is smaller than a pointer type.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (opt_strength_reduction_strict), described in Checking Settings. The default varies according to the compiler.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_unroll_loops.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_unroll_loops.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_unroll_loops.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - opt_unroll_loops - - - - -

    opt_unroll_loops

    -

    Controls the use of loop unrolling optimization.

    -
    Syntax
    -

    #pragma opt_unroll_loops on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler places multiple copies of a loop’s statements inside a loop to improve its speed.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (opt_unroll_loops), described in Checking Settings. This settings is related to the “global_optimizer” level.

    - - - - - + + + + + + + opt_unroll_loops + + + + +

    opt_unroll_loops

    +

    Controls the use of loop unrolling optimization.

    +
    Syntax
    +

    #pragma opt_unroll_loops on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler places multiple copies of a loop’s statements inside a loop to improve its speed.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (opt_unroll_loops), described in Checking Settings. This settings is related to the “global_optimizer” level.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_vectorize_loops.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_vectorize_loops.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_opt_vectorize_loops.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,29 +1,29 @@ - - - - - - - opt_vectorize_loops - - - - -

    opt_vectorize_loops

    -

    Controls the use of loop vectorizing optimization.

    -
    Syntax
    -

    #pragma opt_vectorize_loops on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler improves loop performance on compilers that support loop vectorization, like the x86 compiler.

    -

    NOTE Do not confuse loop vectorizing with the vector instructions supported by some chips, like MMX/SSE on x86. For x86, processor-specific instructions and vector instruction sets must be enabled as well.

    -

    Only the x86 CodeGen settings panel has the Autovectorize loops option, it is not available as an option setting in any other panel.

    -

    To check this setting, use __option (opt_vectorize_loops), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + opt_vectorize_loops + + + + +

    opt_vectorize_loops

    +

    Controls the use of loop vectorizing optimization.

    +
    Syntax
    +

    #pragma opt_vectorize_loops on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler improves loop performance on compilers that support loop vectorization, like the x86 compiler.

    +

    NOTE Do not confuse loop vectorizing with the vector instructions supported by some chips, like MMX/SSE on x86. For x86, processor-specific instructions and vector instruction sets must be enabled as well.

    +

    Only the x86 CodeGen settings panel has the Autovectorize loops option, it is not available as an option setting in any other panel.

    +

    To check this setting, use __option (opt_vectorize_loops), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_optimization_level.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_optimization_level.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_optimization_level.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,29 +1,29 @@ - - - - - - - optimization_level - - - - -

    optimization_level

    -

    Controls global optimization.

    -
    Syntax
    -

    #pragma optimization_level 0 | 1 | 2 | 3 | 4 -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    This pragma specifies the degree of optimization that the global optimizer performs.

    -

    To select optimizations, use the pragma optimization_level with an argument from 0 to 4. The higher the argument, the more optimizations performed by the global optimizer.

    -

    For more information on the optimization the compiler performs for each optimization level, refer to the Targeting manual for your target platform.

    -

    These pragmas correspond to the settings in the Global Optimizations panel. By default, the settings corresponds to the level set in the Global Optimizations panel.

    -

    - - - - - + + + + + + + optimization_level + + + + +

    optimization_level

    +

    Controls global optimization.

    +
    Syntax
    +

    #pragma optimization_level 0 | 1 | 2 | 3 | 4 +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    This pragma specifies the degree of optimization that the global optimizer performs.

    +

    To select optimizations, use the pragma optimization_level with an argument from 0 to 4. The higher the argument, the more optimizations performed by the global optimizer.

    +

    For more information on the optimization the compiler performs for each optimization level, refer to the Targeting manual for your target platform.

    +

    These pragmas correspond to the settings in the Global Optimizations panel. By default, the settings corresponds to the level set in the Global Optimizations panel.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_optimize_for_size.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_optimize_for_size.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_optimize_for_size.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - optimize_for_size - - - - -

    optimize_for_size

    -

    Controls optimization to reduce the size of object code.

    -
    Syntax
    -

    #pragma optimize_for_size on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    This setting lets you choose what the compiler does when it must decide between creating small code or fast code. If you enable this pragma, the compiler creates smaller object code at the expense of speed. It also ignores the inline directive and generates function calls to call any function declared inline. If you disable this pragma, the compiler creates faster object code at the expense of size.

    -

    The pragma corresponds to the Optimize for Size setting in the Global Optimizations panel. To check this setting, use __option (optimize_for_size), described in Checking Settings.

    -

    - - - - - + + + + + + + optimize_for_size + + + + +

    optimize_for_size

    +

    Controls optimization to reduce the size of object code.

    +
    Syntax
    +

    #pragma optimize_for_size on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    This setting lets you choose what the compiler does when it must decide between creating small code or fast code. If you enable this pragma, the compiler creates smaller object code at the expense of speed. It also ignores the inline directive and generates function calls to call any function declared inline. If you disable this pragma, the compiler creates faster object code at the expense of size.

    +

    The pragma corresponds to the Optimize for Size setting in the Global Optimizations panel. To check this setting, use __option (optimize_for_size), described in Checking Settings.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_optimizewithasm.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_optimizewithasm.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_optimizewithasm.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,30 +1,30 @@ - - - - - - - optimizewithasm - - - - -

    optimizewithasm

    -

    Controls optimization of assembly language.

    -
    Syntax
    -

    #pragma optimizewithasm on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    This #pragma controls whether the optimizer queries the backend compiler for the effects of inline assembly instructions so it can safely perform code motion, dead code removal, and constant propagation that may affect assembly code. This #pragma should usually remain on.

    -

    Use #pragma optimizewithasm on to tell the optimizer it is safe to optimize assembly language statements in C/C++ source code. This is available in the x86 compiler.

    -

    Use #pragma optimizewithasm off to tell the optimizer to explicitly disable several optimizations in functions containing inline assembly to avoid removing or reordering code that might change the bahavior of the inline assembly.

    -

    NOTE The backend compiler may have additional options or directives to control optimization of the actual inline assembly code.

    -

    This pragma corresponds to the Inline Assembly settings in the CodeGen panel. To check this setting, use __option (optimizewithasm), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + optimizewithasm + + + + +

    optimizewithasm

    +

    Controls optimization of assembly language.

    +
    Syntax
    +

    #pragma optimizewithasm on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    This #pragma controls whether the optimizer queries the backend compiler for the effects of inline assembly instructions so it can safely perform code motion, dead code removal, and constant propagation that may affect assembly code. This #pragma should usually remain on.

    +

    Use #pragma optimizewithasm on to tell the optimizer it is safe to optimize assembly language statements in C/C++ source code. This is available in the x86 compiler.

    +

    Use #pragma optimizewithasm off to tell the optimizer to explicitly disable several optimizations in functions containing inline assembly to avoid removing or reordering code that might change the bahavior of the inline assembly.

    +

    NOTE The backend compiler may have additional options or directives to control optimization of the actual inline assembly code.

    +

    This pragma corresponds to the Inline Assembly settings in the CodeGen panel. To check this setting, use __option (optimizewithasm), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_options.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_options.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_options.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,62 +1,62 @@ - - - - - - - options - - - - -

    options

    -

    Specifies how to align struct and class data.

    -
    Syntax
    -

    #pragma options align= alignment

    -
    Parameter
    -

    alignment

    -
    -

    Specifies the boundary on which struct and class data is aligned in memory. Values for alignment range from 1 to 16, or use one of the following preset values:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    If alignment is …The compiler …
    mac68kAligns every field on a 2-byte boundaries, unless a field is only 1 byte long. This is the standard alignment for 68K Macintoshes.
    mac68k4byteAligns every field on 4-byte boundaries.
    powerAligns every field on its natural boundary. This is the standard alignment for Power Macintoshes. For example, it aligns a character on a 1-byte boundary and a 16-bit integer on a 2-byte boundary. The compiler applies this alignment recursively to structured data and arrays containing structured data. So, for example, it aligns an array of structured types containing an 4-byte floating point member on an 4-byte boundary.
    nativeAligns every field using the standard alignment. It is equivalent to using mac68k for 68K Macintoshes and power for Power Macintoshes.
    packedAligns every field on a 1-byte boundary. It is not available in any panel. This alignment causes your code to crash or run slowly on many platforms. Use it with caution.
    resetResets to the value in the previous #pragma options align statement. -

    NOTE There is a space between options and align

    -
    -
    -
    Targets
    - All platforms.
    -
    Remarks
    - This pragma corresponds to the Struct Alignment setting in the <Target> Processor or <Target> CodeGen panel. -

    - - - - - + + + + + + + options + + + + +

    options

    +

    Specifies how to align struct and class data.

    +
    Syntax
    +

    #pragma options align= alignment

    +
    Parameter
    +

    alignment

    +
    +

    Specifies the boundary on which struct and class data is aligned in memory. Values for alignment range from 1 to 16, or use one of the following preset values:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    If alignment is …The compiler …
    mac68kAligns every field on a 2-byte boundaries, unless a field is only 1 byte long. This is the standard alignment for 68K Macintoshes.
    mac68k4byteAligns every field on 4-byte boundaries.
    powerAligns every field on its natural boundary. This is the standard alignment for Power Macintoshes. For example, it aligns a character on a 1-byte boundary and a 16-bit integer on a 2-byte boundary. The compiler applies this alignment recursively to structured data and arrays containing structured data. So, for example, it aligns an array of structured types containing an 4-byte floating point member on an 4-byte boundary.
    nativeAligns every field using the standard alignment. It is equivalent to using mac68k for 68K Macintoshes and power for Power Macintoshes.
    packedAligns every field on a 1-byte boundary. It is not available in any panel. This alignment causes your code to crash or run slowly on many platforms. Use it with caution.
    resetResets to the value in the previous #pragma options align statement. +

    NOTE There is a space between options and align

    +
    +
    +
    Targets
    + All platforms.
    +
    Remarks
    + This pragma corresponds to the Struct Alignment setting in the <Target> Processor or <Target> CodeGen panel. +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_parse_func_templ.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_parse_func_templ.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_parse_func_templ.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - access_errors - - - - -

    parse_func_templ

    -

    Controls strict versus relaxed parser setttings supported by the Carbide.c++ compiler.

    -
    Syntax
    -

    #pragma parse_func_templ on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, your C++ source code is compiled using the strict version of the language parser.

    -

    This option actually corresponds to the ISO C++ Template Parser setting . To check this setting, use __option (parse_func_templ), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + access_errors + + + + +

    parse_func_templ

    +

    Controls strict versus relaxed parser setttings supported by the Carbide.c++ compiler.

    +
    Syntax
    +

    #pragma parse_func_templ on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, your C++ source code is compiled using the strict version of the language parser.

    +

    This option actually corresponds to the ISO C++ Template Parser setting . To check this setting, use __option (parse_func_templ), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_parse_mfunc_templ.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_parse_mfunc_templ.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_parse_mfunc_templ.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - parse_mfunc_templ - - - - -

    parse_mfunc_templ

    -

    Controls strict versus relaxed parser setttings for member function bodies.

    -
    Syntax
    -

    #pragma parse_mfunc_templ on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, member function bodies within your C++ source code are compiled using the strict version of the language parser.

    -

    This option actually corresponds to the ISO C++ Template Parser setting . To check this setting, use __option (parse_mfunc_templ), described in Checking Settings. The default setting is off.

    - - - - - + + + + + + + parse_mfunc_templ + + + + +

    parse_mfunc_templ

    +

    Controls strict versus relaxed parser setttings for member function bodies.

    +
    Syntax
    +

    #pragma parse_mfunc_templ on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, member function bodies within your C++ source code are compiled using the strict version of the language parser.

    +

    This option actually corresponds to the ISO C++ Template Parser setting . To check this setting, use __option (parse_mfunc_templ), described in Checking Settings. The default setting is off.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_pool_strings.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_pool_strings.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_pool_strings.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,31 +1,31 @@ - - - - - - - pool_strings - - - - -

    pool_strings

    -

    Controls how string literals are stored.

    -
    Syntax
    -

    #pragma pool_strings on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler collects all string constants into a single data object so your program needs one data section for all of them. If you disable this pragma, the compiler creates a unique data object and TOC entry for each string constant. While this decreases the number of data sections in your program, on some processors, like the PowerPC, it also makes your program bigger because it uses a less efficient method to store the address of the string.

    -

    This pragma is especially useful if your program is large and has many string constants or uses the Metrowerks Profiler.

    -

    NOTE If you enable this pragma, the compiler ignores the setting of the pragma pcrelstrings.

    -

    This pragma corresponds to the Pool Strings setting .

    -

    NOTE A compiler may override this panel setting in a processor-specific code generation panel.

    -

    To check this setting, use __option (pool_strings), described in Checking Settings.

    -

    - - - - - + + + + + + + pool_strings + + + + +

    pool_strings

    +

    Controls how string literals are stored.

    +
    Syntax
    +

    #pragma pool_strings on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler collects all string constants into a single data object so your program needs one data section for all of them. If you disable this pragma, the compiler creates a unique data object and TOC entry for each string constant. While this decreases the number of data sections in your program, on some processors, like the PowerPC, it also makes your program bigger because it uses a less efficient method to store the address of the string.

    +

    This pragma is especially useful if your program is large and has many string constants or uses the Metrowerks Profiler.

    +

    NOTE If you enable this pragma, the compiler ignores the setting of the pragma pcrelstrings.

    +

    This pragma corresponds to the Pool Strings setting .

    +

    NOTE A compiler may override this panel setting in a processor-specific code generation panel.

    +

    To check this setting, use __option (pool_strings), described in Checking Settings.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_pop_push.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_pop_push.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_pop_push.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,39 +1,39 @@ - - - - - - - pop, push - - - - -

    pop, push

    -

    Save and restore pragma settings.

    -
    Syntax
    -

    #pragma push
    - #pragma pop

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    The pragma push saves all the current pragma settings. The pragma pop restores all the pragma settings that resulted from the last push pragma. For example, see Listing 10.29.

    -
    -

    Listing 10.29 push and pop Example

    -

    #pragma far_data on
    - #pragma pointers_in_A0
    - #pragma push // push all compiler settings
    - #pragma far_data off
    - #pragma pointers_in_D0
    - // pop restores "far_data" and "pointers_in_A0"
    - #pragma pop

    -
    -

    NOTE This example uses some platform-specific pragmas for illustrative purposes only. See the Targeting manual for your platform to determine which pragmas are supported.

    -

    This pragma does not correspond to any panel setting.

    -

    TIP Pragmas that allow on | off | reset already form a stack of previous option values. It is not necessary to use #pragma pop/push with such pragmas.

    -

    - - - - - + + + + + + + pop, push + + + + +

    pop, push

    +

    Save and restore pragma settings.

    +
    Syntax
    +

    #pragma push
    + #pragma pop

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    The pragma push saves all the current pragma settings. The pragma pop restores all the pragma settings that resulted from the last push pragma. For example, see Listing 10.29.

    +
    +

    Listing 10.29 push and pop Example

    +

    #pragma far_data on
    + #pragma pointers_in_A0
    + #pragma push // push all compiler settings
    + #pragma far_data off
    + #pragma pointers_in_D0
    + // pop restores "far_data" and "pointers_in_A0"
    + #pragma pop

    +
    +

    NOTE This example uses some platform-specific pragmas for illustrative purposes only. See the Targeting manual for your platform to determine which pragmas are supported.

    +

    This pragma does not correspond to any panel setting.

    +

    TIP Pragmas that allow on | off | reset already form a stack of previous option values. It is not necessary to use #pragma pop/push with such pragmas.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_pragma_prepdump.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_pragma_prepdump.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_pragma_prepdump.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - access_errors - - - - -

    pragma_prepdump

    -

    Controls whether pragmas encountered in the source text appear in the preprocessor output.

    -
    Syntax
    -

    #pragma pragma_prepdump on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    This pragma corresponds to the Emit #pragmas option . The default setting is off.

    -

    TIP When submitting bug reports with a preprocessor dump, be sure this option is enabled.

    -

    - - - - - + + + + + + + access_errors + + + + +

    pragma_prepdump

    +

    Controls whether pragmas encountered in the source text appear in the preprocessor output.

    +
    Syntax
    +

    #pragma pragma_prepdump on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    This pragma corresponds to the Emit #pragmas option . The default setting is off.

    +

    TIP When submitting bug reports with a preprocessor dump, be sure this option is enabled.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_precompile_target.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_precompile_target.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_precompile_target.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,31 +1,31 @@ - - - - - - - precompile_target - - - - -

    precompile_target

    -

    Specifies the file name for a precompiled header file.

    -
    Syntax
    -

    #pragma precompile_target filename

    -
    Parameters
    -

    filename

    -
    -

    Filename can be a simple filename or an absolute pathname. If filename is a simple filename, the compiler saves the file in the same folder as the source file. If filename is a path name, the compiler saves the file in the specified folder.

    -
    -
    Targets
    - All platforms.
    -
    Remarks
    -

    This pragma specifies the filename for a precompiled header file. If you do not specify the filename, the compiler gives the precompiled header file the same base name as its source file minus any extension and prepended with the “#” character. For example, this_file becomes #this_file.

    -

    This pragma does not correspond to any panel setting.

    -

    - - - - - + + + + + + + precompile_target + + + + +

    precompile_target

    +

    Specifies the file name for a precompiled header file.

    +
    Syntax
    +

    #pragma precompile_target filename

    +
    Parameters
    +

    filename

    +
    +

    Filename can be a simple filename or an absolute pathname. If filename is a simple filename, the compiler saves the file in the same folder as the source file. If filename is a path name, the compiler saves the file in the specified folder.

    +
    +
    Targets
    + All platforms.
    +
    Remarks
    +

    This pragma specifies the filename for a precompiled header file. If you do not specify the filename, the compiler gives the precompiled header file the same base name as its source file minus any extension and prepended with the “#” character. For example, this_file becomes #this_file.

    +

    This pragma does not correspond to any panel setting.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_readonly_strings.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_readonly_strings.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_readonly_strings.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - access_errors - - - - -

    readonly_strings

    -

    Controls whether string objects are placed in a read-write or a read-only data section.

    -
    Syntax
    -

    #pragma readonly_strings on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, C strings used in your source code (for example, "hello") are output to the read-only data section instead of the global data section. In effect, these strings act like const char *, even though their type is really char *.

    -

    This pragma corresponds to the Make strings read-only setting in the processor x86 CodeGen panel and the Make string constants read-only setting in the processor ARM CodeGen panel. To check this setting, use __option (readonly_strings), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + access_errors + + + + +

    readonly_strings

    +

    Controls whether string objects are placed in a read-write or a read-only data section.

    +
    Syntax
    +

    #pragma readonly_strings on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, C strings used in your source code (for example, "hello") are output to the read-only data section instead of the global data section. In effect, these strings act like const char *, even though their type is really char *.

    +

    This pragma corresponds to the Make strings read-only setting in the processor x86 CodeGen panel and the Make string constants read-only setting in the processor ARM CodeGen panel. To check this setting, use __option (readonly_strings), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_require_prototypes.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_require_prototypes.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_require_prototypes.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,28 +1,28 @@ - - - - - - - require_prototypes - - - - -

    require_prototypes

    -

    Controls whether or not the compiler should expect function prototypes.

    -
    Syntax
    -

    #pragma require_prototypes on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    This pragma only affects non-static functions.

    -

    If you enable this pragma, the compiler generates an error if you use a function that does not have a prototype. This pragma helps you prevent errors that happen when you use a function before you define it or refer to it.

    -

    This pragma corresponds to the Require Function Prototypes setting . To check this setting, use __option (require_prototypes), described in Checking Settings. The default setting is processor-specific.

    -

    - - - - - + + + + + + + require_prototypes + + + + +

    require_prototypes

    +

    Controls whether or not the compiler should expect function prototypes.

    +
    Syntax
    +

    #pragma require_prototypes on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    This pragma only affects non-static functions.

    +

    If you enable this pragma, the compiler generates an error if you use a function that does not have a prototype. This pragma helps you prevent errors that happen when you use a function before you define it or refer to it.

    +

    This pragma corresponds to the Require Function Prototypes setting . To check this setting, use __option (require_prototypes), described in Checking Settings. The default setting is processor-specific.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_reverse_bitfields.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_reverse_bitfields.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_reverse_bitfields.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - reverse_bitfields - - - - -

    reverse_bitfields

    -

    Controls whether or not the compiler reverses the bitfield allocation.

    -
    Syntax
    -

    #pragma reverse_bitfields on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    This pragma reverses the bitfield allocation, so that bitfields are arranged from the opposite side of the storage unit from that ordinarily used on the target. The compiler still orders the bits within a single bitfield such that the lowest-valued bit is in the rightmost position.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (reverse_bitfields), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + reverse_bitfields + + + + +

    reverse_bitfields

    +

    Controls whether or not the compiler reverses the bitfield allocation.

    +
    Syntax
    +

    #pragma reverse_bitfields on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    This pragma reverses the bitfield allocation, so that bitfields are arranged from the opposite side of the storage unit from that ordinarily used on the target. The compiler still orders the bits within a single bitfield such that the lowest-valued bit is in the rightmost position.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (reverse_bitfields), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_rtti.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_rtti.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_rtti.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - RTTI - - - - -

    RTTI

    -

    Controls the availability of runtime type information.

    -
    Syntax
    -

    #pragma RTTI on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, you can use runtime type information (or RTTI) features such as dynamic_cast and typeid. The other RTTI expressions are available even if you disable the Enable RTTI setting. Note that *type_info::before(const type_info&) is not yet implemented.

    -

    This pragma corresponds to the Enable RTTI setting . To check this setting, use __option (RTTI), described in Checking Settings.

    -

    - - - - - + + + + + + + RTTI + + + + +

    RTTI

    +

    Controls the availability of runtime type information.

    +
    Syntax
    +

    #pragma RTTI on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, you can use runtime type information (or RTTI) features such as dynamic_cast and typeid. The other RTTI expressions are available even if you disable the Enable RTTI setting. Note that *type_info::before(const type_info&) is not yet implemented.

    +

    This pragma corresponds to the Enable RTTI setting . To check this setting, use __option (RTTI), described in Checking Settings.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_show_error_filestack.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_show_error_filestack.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_show_error_filestack.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,25 +1,25 @@ - - - - - - - show_error_filestack - - - - -

    show_error_filestack

    -

    Controls the appearance of the current #includes file stack within error messages occuring inside deeply-included files.

    -
    Syntax
    -

    #pragma show_error_filestack on | off | reset

    -
    Targets
    - All targets.
    -
    Remarks
    - This pragma does not correspond to any panel setting. The default setting is on. -

    - - - - - + + + + + + + show_error_filestack + + + + +

    show_error_filestack

    +

    Controls the appearance of the current #includes file stack within error messages occuring inside deeply-included files.

    +
    Syntax
    +

    #pragma show_error_filestack on | off | reset

    +
    Targets
    + All targets.
    +
    Remarks
    + This pragma does not correspond to any panel setting. The default setting is on. +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_showmessagenumber.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_showmessagenumber.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_showmessagenumber.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - access_errors - - - - -

    showmessagenumber

    -

    Controls the appearance of warning or error numbers in displayed messages. -

    Syntax
    - -

    #pragma showmessagenumber on | off | reset

    -
    Targets
    - All targets.
    -
    Remarks
    -

    When enabled, this pragma causes messages to appear with their numbers visible. You can then use the warning pragma with a warning number to suppress the appearance of specific warning messages.

    -

    This pragma does not correspond to any panel setting. To check this pragma use __option (showmessagenumber), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + access_errors + + + + +

    showmessagenumber

    +

    Controls the appearance of warning or error numbers in displayed messages. +

    Syntax
    + +

    #pragma showmessagenumber on | off | reset

    +
    Targets
    + All targets.
    +
    Remarks
    +

    When enabled, this pragma causes messages to appear with their numbers visible. You can then use the warning pragma with a warning number to suppress the appearance of specific warning messages.

    +

    This pragma does not correspond to any panel setting. To check this pragma use __option (showmessagenumber), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_simple_prepdump.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_simple_prepdump.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_simple_prepdump.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - simple_prepdump - - - - -

    simple_prepdump

    -

    Controls the suppression of comments in preprocessor dumps.

    -
    Syntax
    -

    #pragma simple_prepdump on | off | reset

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    By default, the preprocessor adds comments about the current include file being processed in its output. Enabling this pragma disables these comments.

    -

    This pragma corresponds to the Emit file changes option . To check this setting, use __option (simple_prepdump), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + simple_prepdump + + + + +

    simple_prepdump

    +

    Controls the suppression of comments in preprocessor dumps.

    +
    Syntax
    +

    #pragma simple_prepdump on | off | reset

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    By default, the preprocessor adds comments about the current include file being processed in its output. Enabling this pragma disables these comments.

    +

    This pragma corresponds to the Emit file changes option . To check this setting, use __option (simple_prepdump), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_space_prepdump.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_space_prepdump.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_space_prepdump.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - space_prepdump - - - - -

    space_prepdump

    -

    Controls whether whitespace is stripped out or copied into the output.

    -
    Syntax
    -

    #pragma space_prepdump on | off | reset

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    This pragma is useful for keeping the starting column aligned with the original source, though the compiler attempts to preserve space within the line. This doesn’t apply when macros are expanded.

    -

    This pragma corresponds to the Keep whitespace option . The default setting is off.

    -

    - - - - - + + + + + + + space_prepdump + + + + +

    space_prepdump

    +

    Controls whether whitespace is stripped out or copied into the output.

    +
    Syntax
    +

    #pragma space_prepdump on | off | reset

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    This pragma is useful for keeping the starting column aligned with the original source, though the compiler attempts to preserve space within the line. This doesn’t apply when macros are expanded.

    +

    This pragma corresponds to the Keep whitespace option . The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_srcrelincludes.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_srcrelincludes.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_srcrelincludes.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - srcrelincludes - - - - -

    srcrelincludes

    -

    Controls the lookup of #include files.

    -
    Syntax
    -

    #pragma srcrelincludes on | off | reset

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    When on, this IDE looks for #include files relative to the previously #include file (not just the source file). This is useful when multiple files use the same filename and are intended to be picked up by another header in that directory. This is a common occurrence in UNIX.

    -

    This pragma corresponds to the Source relative includes option in the Access Paths panel. The default setting is off.

    -

    - - - - - + + + + + + + srcrelincludes + + + + +

    srcrelincludes

    +

    Controls the lookup of #include files.

    +
    Syntax
    +

    #pragma srcrelincludes on | off | reset

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    When on, this IDE looks for #include files relative to the previously #include file (not just the source file). This is useful when multiple files use the same filename and are intended to be picked up by another header in that directory. This is a common occurrence in UNIX.

    +

    This pragma corresponds to the Source relative includes option in the Access Paths panel. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_store_object_files.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_store_object_files.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_store_object_files.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - store_object_files - - - - -

    store_object_files

    -

    Controls the storage location of object data, either in the target data driectory or as a separate file.

    -
    Syntax
    -

    #pragma store_object_files on | off | reset

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    By default, the IDE writes object data to the project’s target data directory. When this pragma is on, the object data is written to a separate object file.

    -

    NOTE For some targets, the object file emitted may not be recognized as actual object data.

    -

    This pragma does not correspond to any panel setting. The default setting is off.

    - - - - - + + + + + + + store_object_files + + + + +

    store_object_files

    +

    Controls the storage location of object data, either in the target data driectory or as a separate file.

    +
    Syntax
    +

    #pragma store_object_files on | off | reset

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    By default, the IDE writes object data to the project’s target data directory. When this pragma is on, the object data is written to a separate object file.

    +

    NOTE For some targets, the object file emitted may not be recognized as actual object data.

    +

    This pragma does not correspond to any panel setting. The default setting is off.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_strictheaderchecking.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_strictheaderchecking.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_strictheaderchecking.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - strictheaderchecking - - - - -

    strictheaderchecking

    -

    Controls how strictly the compiler checks headers for standard C library functions.

    -
    Syntax
    -

    #pragma strictheaderchecking on | off | reset

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    The 3.2 version compiler recognizes standard C library functions. If the correct prototype is used, and, in C++, if the function appears in the “std” or root namespace, the compiler recognizes the function, and is able to optimize calls to it based on its documented effects.

    -

    When this pragma is on, in addition to having the correct prototype, the declaration must also appear in the proper standard header file (and not in a user header or source file).

    -

    This pragma does not correspond to any panel setting. The default setting is on.

    -

    - - - - - + + + + + + + strictheaderchecking + + + + +

    strictheaderchecking

    +

    Controls how strictly the compiler checks headers for standard C library functions.

    +
    Syntax
    +

    #pragma strictheaderchecking on | off | reset

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    The 3.2 version compiler recognizes standard C library functions. If the correct prototype is used, and, in C++, if the function appears in the “std” or root namespace, the compiler recognizes the function, and is able to optimize calls to it based on its documented effects.

    +

    When this pragma is on, in addition to having the correct prototype, the declaration must also appear in the proper standard header file (and not in a user header or source file).

    +

    This pragma does not correspond to any panel setting. The default setting is on.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_suppress_init_code.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_suppress_init_code.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_suppress_init_code.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - suppress_init_code - - - - -

    suppress_init_code

    -

    Controls the suppression of static initialization object code.

    -
    Syntax
    -

    #pragma suppress_init_code on | off | reset

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler does not generate any code for static data initialization such as C++ constructors.

    -

    WARNING! Beware when using this pragma because it can produce erratic or unpredictable behavior in your program.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (suppress_init_code), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + suppress_init_code + + + + +

    suppress_init_code

    +

    Controls the suppression of static initialization object code.

    +
    Syntax
    +

    #pragma suppress_init_code on | off | reset

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler does not generate any code for static data initialization such as C++ constructors.

    +

    WARNING! Beware when using this pragma because it can produce erratic or unpredictable behavior in your program.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (suppress_init_code), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_suppress_warnings.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_suppress_warnings.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_suppress_warnings.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - suppress_warnings - - - - -

    suppress_warnings

    -

    Controls the issuing of warnings.

    -
    Syntax
    -

    #pragma suppress_warnings on | off | reset

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler does not generate warnings, including those that are enabled.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (suppress_warnings), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + suppress_warnings + + + + +

    suppress_warnings

    +

    Controls the issuing of warnings.

    +
    Syntax
    +

    #pragma suppress_warnings on | off | reset

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler does not generate warnings, including those that are enabled.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (suppress_warnings), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_sym.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_sym.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_sym.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - sym - - - - -

    sym

    -

    Controls the generation of debugger symbol information.

    -
    Syntax
    -

    #pragma sym on | off | reset | [no]scope

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    The compiler pays attention to this pragma only if you enable the debug marker for a file in the IDE project window. If you disable this pragma, the compiler does not put debugging information into the source file debugger symbol file (SYM or DWARF) for the functions that follow. Enables the emit local scopes feature by default. Use -sym noscopes to disable.

    -

    The compiler always generates a debugger symbol file for a source file that has a debug diamond next to it in the project window. This pragma changes only which functions have information in that symbol file.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (sym), described in Checking Settings. The default setting is on.

    - - - - - + + + + + + + sym + + + + +

    sym

    +

    Controls the generation of debugger symbol information.

    +
    Syntax
    +

    #pragma sym on | off | reset | [no]scope

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    The compiler pays attention to this pragma only if you enable the debug marker for a file in the IDE project window. If you disable this pragma, the compiler does not put debugging information into the source file debugger symbol file (SYM or DWARF) for the functions that follow. Enables the emit local scopes feature by default. Use -sym noscopes to disable.

    +

    The compiler always generates a debugger symbol file for a source file that has a debug diamond next to it in the project window. This pragma changes only which functions have information in that symbol file.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (sym), described in Checking Settings. The default setting is on.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_syspath_once.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_syspath_once.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_syspath_once.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - syspath_once - - - - -

    syspath_once

    -

    Controls how include files are treated when #pragma once is enabled.

    -
    Syntax
    -

    #pragma syspath_once on | off | reset

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, files called in #include <> and #include "" directives are treated as distinct, even if they refer to the same file.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (syspath_once), described in Checking Settings. The default setting is on.

    -

    - - - - - + + + + + + + syspath_once + + + + +

    syspath_once

    +

    Controls how include files are treated when #pragma once is enabled.

    +
    Syntax
    +

    #pragma syspath_once on | off | reset

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, files called in #include <> and #include "" directives are treated as distinct, even if they refer to the same file.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (syspath_once), described in Checking Settings. The default setting is on.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_template_depth.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_template_depth.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_template_depth.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - template_depth - - - - -

    template_depth

    -

    Controls how many nested or recursive class templates you can instantiate.

    -
    Syntax
    -

    #pragma template_depth(n)

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    This pragma lets you increase the number of nested or recursive class template instantiations allowed. By default, n equals 64; it can be set from 1 to 30000. You should always use the default value unless you receive the error message template too complex or recursive.

    -

    This pragma does not correspond to any panel setting.

    -

    - - - - - + + + + + + + template_depth + + + + +

    template_depth

    +

    Controls how many nested or recursive class templates you can instantiate.

    +
    Syntax
    +

    #pragma template_depth(n)

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    This pragma lets you increase the number of nested or recursive class template instantiations allowed. By default, n equals 64; it can be set from 1 to 30000. You should always use the default value unless you receive the error message template too complex or recursive.

    +

    This pragma does not correspond to any panel setting.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_text_encoding.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_text_encoding.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_text_encoding.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,43 +1,43 @@ - - - - - - - text_encoding - - - - -

    text_encoding

    -

    Identifies the files source text encoding format to the compiler.

    -
    Syntax
    -

    #pragma text_encoding ( "name" | unknown | reset [, global] )

    -
    Parameters
    -

    name

    -
    -

    The IANA or MIME encoding name or an OS-specific string that identifies the text encoding. The compiler recognizes these names and maps them to its internal decoders:

    -

    system US-ASCII ASCII ANSI_X3.4-1968
    - ANSI_X3.4 UTF-8 UTF8 ISO-2022-JP
    - CSISO2022JP ISO2022JP CSSHIFTJIS SHIFT-JIS
    - SHIFT_JIS SJIS EUC-JP EUCJP UCS-2 UCS-2BE
    - UCS-2LE UCS2 UCS2BE UCS2LE UTF-16 UTF-16BE
    - UTF-16LE UTF16 UTF16BE UTF16LE UCS-4 UCS-4BE
    - UCS-4LE UCS4 UCS4BE UCS4LE 10646-1:1993
    - ISO-10646-1 ISO-10646 unicode

    -
    -

    global

    -
    -

    Tells the compiler that the current and all subsequent files use the same text encoding. By default, text encoding is effective only to the end of the file.

    -
    -
    Targets
    - All platforms.
    -
    Remarks
    -

    By default, #pragma text_encoding is only effective through the end of the file. To affect the default text encoding assumed for the current and all subsequent files, supply the “global” modifier.

    -

    This pragma corresponds to the Source Encoding option . The default setting is ASCII.

    -

    - - - - - + + + + + + + text_encoding + + + + +

    text_encoding

    +

    Identifies the files source text encoding format to the compiler.

    +
    Syntax
    +

    #pragma text_encoding ( "name" | unknown | reset [, global] )

    +
    Parameters
    +

    name

    +
    +

    The IANA or MIME encoding name or an OS-specific string that identifies the text encoding. The compiler recognizes these names and maps them to its internal decoders:

    +

    system US-ASCII ASCII ANSI_X3.4-1968
    + ANSI_X3.4 UTF-8 UTF8 ISO-2022-JP
    + CSISO2022JP ISO2022JP CSSHIFTJIS SHIFT-JIS
    + SHIFT_JIS SJIS EUC-JP EUCJP UCS-2 UCS-2BE
    + UCS-2LE UCS2 UCS2BE UCS2LE UTF-16 UTF-16BE
    + UTF-16LE UTF16 UTF16BE UTF16LE UCS-4 UCS-4BE
    + UCS-4LE UCS4 UCS4BE UCS4LE 10646-1:1993
    + ISO-10646-1 ISO-10646 unicode

    +
    +

    global

    +
    +

    Tells the compiler that the current and all subsequent files use the same text encoding. By default, text encoding is effective only to the end of the file.

    +
    +
    Targets
    + All platforms.
    +
    Remarks
    +

    By default, #pragma text_encoding is only effective through the end of the file. To affect the default text encoding assumed for the current and all subsequent files, supply the “global” modifier.

    +

    This pragma corresponds to the Source Encoding option . The default setting is ASCII.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_thread_safe_int.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_thread_safe_int.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_thread_safe_int.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,40 +1,40 @@ - - - - - - - thread_safe_init - - - - -

    thread_safe_init

    -

    Controls the addition of extra code in the binary to ensure that multiple threads cannot enter a static local initialization at the same time.

    -
    Syntax
    -

    #pragma thread_safe_init on | off | reset

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    When C++ programs use static local initializations, like this:

    -

    int func() {
    - static int countdown = 20;
    - return countdown--;
    - }

    -

    the static locals are initialized the first time the function is executed. As such, if multiple threads are running at the same time, and two of them happen to enter the function at the same time, there will be contention over which one initializes the variable.

    -

    When this pragma is on, the compiler inserts a mutex around the initialization to avoid this problem as shown below:

    -

    NOTE This requires runtime support which may not be implemented on all platforms, due to the possible need for operating system support.

    -

    #pragma thread_safe_init on
    - void thread_heavy_func()
    - {
    - // multiple routines cannot enter at the same time
    - static std::string localstring = thread_unsafe_func();
    -}

    -

    NOTE When an exception is thrown from a static local initializer, the initializer is retried by the next client that enters the scope of the local.

    -

    This pragma does not correspond to any panel setting. The default setting is off.

    -

    - - - - - + + + + + + + thread_safe_init + + + + +

    thread_safe_init

    +

    Controls the addition of extra code in the binary to ensure that multiple threads cannot enter a static local initialization at the same time.

    +
    Syntax
    +

    #pragma thread_safe_init on | off | reset

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    When C++ programs use static local initializations, like this:

    +

    int func() {
    + static int countdown = 20;
    + return countdown--;
    + }

    +

    the static locals are initialized the first time the function is executed. As such, if multiple threads are running at the same time, and two of them happen to enter the function at the same time, there will be contention over which one initializes the variable.

    +

    When this pragma is on, the compiler inserts a mutex around the initialization to avoid this problem as shown below:

    +

    NOTE This requires runtime support which may not be implemented on all platforms, due to the possible need for operating system support.

    +

    #pragma thread_safe_init on
    + void thread_heavy_func()
    + {
    + // multiple routines cannot enter at the same time
    + static std::string localstring = thread_unsafe_func();
    +}

    +

    NOTE When an exception is thrown from a static local initializer, the initializer is retried by the next client that enters the scope of the local.

    +

    This pragma does not correspond to any panel setting. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_trigraphs.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_trigraphs.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_trigraphs.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,70 +1,70 @@ - - - - - - - trigraphs - - - - -

    trigraphs

    -

    Controls the use of ISO trigraph sequences.

    -
    Syntax
    -

    #pragma trigraphs on | off | reset

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you are writing code that must strictly adhere to the ANSI standard, enable this pragma. Listing 10.31 shows an example of a trigraph.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Trigraph
    Character
    ??=
    #
    ??/
    ^
    ??(
    [
    ??)
    ]
    ??!
    |
    ??<
    {
    ??>
    }
    ??-
    ~
    -

    NOTE Use of this pragma may cause a portability issue for some targets.

    -
    -

    Listing 10.31 Example of Pragma trigraphs

    -

    char c = '????'; // ERROR: Trigraph sequence expands to '??^
    - char d = '\?\?\?\?'; // OK

    -
    -

    This pragma corresponds to the Expand Trigraphs setting . To check this setting, use __option (trigraphs), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + trigraphs + + + + +

    trigraphs

    +

    Controls the use of ISO trigraph sequences.

    +
    Syntax
    +

    #pragma trigraphs on | off | reset

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you are writing code that must strictly adhere to the ANSI standard, enable this pragma. Listing 10.31 shows an example of a trigraph.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Trigraph
    Character
    ??=
    #
    ??/
    ^
    ??(
    [
    ??)
    ]
    ??!
    |
    ??<
    {
    ??>
    }
    ??-
    ~
    +

    NOTE Use of this pragma may cause a portability issue for some targets.

    +
    +

    Listing 10.31 Example of Pragma trigraphs

    +

    char c = '????'; // ERROR: Trigraph sequence expands to '??^
    + char d = '\?\?\?\?'; // OK

    +
    +

    This pragma corresponds to the Expand Trigraphs setting . To check this setting, use __option (trigraphs), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_unsigned_char.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_unsigned_char.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_unsigned_char.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - access_errors - - - - -

    unsigned_char

    -

    Controls whether or not declarations of type char are treated as unsigned char.

    -
    Syntax
    -

    #pragma unsigned_char on | off | reset

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler treats a char declaration as if it were an unsigned char declaration.

    -

    NOTE If you enable this pragma, your code might not be compatible with libraries that were compiled when the pragma was disabled. In particular, your code might not work with the ANSI libraries included with Carbide.

    -

    This pragma corresponds to the Use Unsigned Chars setting . To check this setting, use __option (unsigned_char), described in Checking Settings. The default setting is processor-specific.

    - - - - - + + + + + + + access_errors + + + + +

    unsigned_char

    +

    Controls whether or not declarations of type char are treated as unsigned char.

    +
    Syntax
    +

    #pragma unsigned_char on | off | reset

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler treats a char declaration as if it were an unsigned char declaration.

    +

    NOTE If you enable this pragma, your code might not be compatible with libraries that were compiled when the pragma was disabled. In particular, your code might not work with the ANSI libraries included with Carbide.

    +

    This pragma corresponds to the Use Unsigned Chars setting . To check this setting, use __option (unsigned_char), described in Checking Settings. The default setting is processor-specific.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_unused.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_unused.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_unused.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,48 +1,48 @@ - - - - - - - unused - - - - -

    unused

    -

    Controls the suppression of warnings for variables and parameters that are not referenced in a function.

    -
    Syntax
    -

    #pragma unused ( var_name [, var_name ]... )

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    This pragma suppresses the compile time warnings for the unused variables and parameters specified in its argument list as shown in Listing 10.32 and Listing 10.33. You can use this pragma only within a function body, and the listed variables must be within the scope of the function. You cannot use this pragma with functions defined within a class definition or with template functions.

    -
    -

    Listing 10.32 Example of Pragma unused() in C

    -

    #pragma warn_unusedvar on
    - #pragma warn_unusedarg on

    -

    static void ff(int a)
    - {
    - int b;
    - #pragma unused(a,b) // Compiler does not warn
    - // that a and b are unused
    - // . . .
    - }

    -
    -
    -

    Listing 10.33 Example of Pragma unused() in C++

    -

    #pragma warn_unusedvar on
    - #pragma warn_unusedarg on

    -

    static void ff(int /* No warning */)
    - {
    - int b;
    - #pragma unused(b) // Compiler does not warn that b is not used.
    - // . . .
    - }

    -
    -

    This pragma does not correspond to any panel setting.

    - - - - - + + + + + + + unused + + + + +

    unused

    +

    Controls the suppression of warnings for variables and parameters that are not referenced in a function.

    +
    Syntax
    +

    #pragma unused ( var_name [, var_name ]... )

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    This pragma suppresses the compile time warnings for the unused variables and parameters specified in its argument list as shown in Listing 10.32 and Listing 10.33. You can use this pragma only within a function body, and the listed variables must be within the scope of the function. You cannot use this pragma with functions defined within a class definition or with template functions.

    +
    +

    Listing 10.32 Example of Pragma unused() in C

    +

    #pragma warn_unusedvar on
    + #pragma warn_unusedarg on

    +

    static void ff(int a)
    + {
    + int b;
    + #pragma unused(a,b) // Compiler does not warn
    + // that a and b are unused
    + // . . .
    + }

    +
    +
    +

    Listing 10.33 Example of Pragma unused() in C++

    +

    #pragma warn_unusedvar on
    + #pragma warn_unusedarg on

    +

    static void ff(int /* No warning */)
    + {
    + int b;
    + #pragma unused(b) // Compiler does not warn that b is not used.
    + // . . .
    + }

    +
    +

    This pragma does not correspond to any panel setting.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_any_ptr_int_conv.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_any_ptr_int_conv.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_any_ptr_int_conv.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,42 +1,42 @@ - - - - - - - warn_any_ptr_int_conv - - - - -

    warn_any_ptr_int_conv

    -

    Controls if the compiler generates a warning when an integral type is explicitly converted to a pointer type or vice versa.

    -
    Syntax
    -

    #pragma warn_any_ptr_int_conv on | off | reset -

    -
    Targets
    - All targets.
    -
    Remarks
    -

    This pragma is useful to identify potential 64-bit pointer portability issues. An example is shown in Listing 10.34.

    -
    -

    Listing 10.34 Example of warn_any_ptr_int_conv

    -

    #pragma warn_ptr_int_conv on

    -

    short i, *ip

    -

    void foo() {
    - i = (short)ip; // WARNING: integral type is not
    - // large enough to hold pointer
    - }

    -

    #pragma warn_any_ptr_int_conv on

    -

    void bar() {
    - i = (int)ip; // WARNING: pointer to integral conversion
    - ip = (short *)i; // WARNING: integral to pointer conversion
    - }

    -
    -
    Remarks
    -

    See also pragma warn_ptr_int_conv.

    -

    This pragma corresponds to the Pointer/Integral Conversions setting . To check this setting, use __option (warn_any_ptr_int_conv), described in Checking Settings. The default setting is off.

    - - - - - + + + + + + + warn_any_ptr_int_conv + + + + +

    warn_any_ptr_int_conv

    +

    Controls if the compiler generates a warning when an integral type is explicitly converted to a pointer type or vice versa.

    +
    Syntax
    +

    #pragma warn_any_ptr_int_conv on | off | reset +

    +
    Targets
    + All targets.
    +
    Remarks
    +

    This pragma is useful to identify potential 64-bit pointer portability issues. An example is shown in Listing 10.34.

    +
    +

    Listing 10.34 Example of warn_any_ptr_int_conv

    +

    #pragma warn_ptr_int_conv on

    +

    short i, *ip

    +

    void foo() {
    + i = (short)ip; // WARNING: integral type is not
    + // large enough to hold pointer
    + }

    +

    #pragma warn_any_ptr_int_conv on

    +

    void bar() {
    + i = (int)ip; // WARNING: pointer to integral conversion
    + ip = (short *)i; // WARNING: integral to pointer conversion
    + }

    +
    +
    Remarks
    +

    See also pragma warn_ptr_int_conv.

    +

    This pragma corresponds to the Pointer/Integral Conversions setting . To check this setting, use __option (warn_any_ptr_int_conv), described in Checking Settings. The default setting is off.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_emptydecl.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_emptydecl.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_emptydecl.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,38 +1,38 @@ - - - - - - - access_errors - - - - -

    warn_emptydecl

    -

    Controls the recognition of declarations without variables.

    -
    Syntax
    -

    #pragma warn_emptydecl on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler displays a warning when it encounters a declaration with no variables as shown in Listing 10.35.

    -
    -

    Listing 10.35 Examples of Pragma warn_emptydecl

    -

    int ; // WARNING
    - int i; // OK
    - ...
    - long j;; // WARNING
    - long j; // OK
    - ...
    - extern "C" {
    - ...
    - }; // WARNING

    -
    -

    This pragma corresponds to the Empty Declarations setting . To check this setting, use __option (warn_emptydecl), described in Checking Settings. The default setting is off.

    - - - - - + + + + + + + access_errors + + + + +

    warn_emptydecl

    +

    Controls the recognition of declarations without variables.

    +
    Syntax
    +

    #pragma warn_emptydecl on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler displays a warning when it encounters a declaration with no variables as shown in Listing 10.35.

    +
    +

    Listing 10.35 Examples of Pragma warn_emptydecl

    +

    int ; // WARNING
    + int i; // OK
    + ...
    + long j;; // WARNING
    + long j; // OK
    + ...
    + extern "C" {
    + ...
    + }; // WARNING

    +
    +

    This pragma corresponds to the Empty Declarations setting . To check this setting, use __option (warn_emptydecl), described in Checking Settings. The default setting is off.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_extracomma.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_extracomma.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_extracomma.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - warn_extracomma - - - - -

    warn_extracomma

    -

    Controls the recognition of superfluous commas.

    -
    Syntax
    -

    #pragma warn_extracomma on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler issues a warning when it encounters an extra comma. For more information about this warning, see “Extra Commas”.

    -

    This pragma corresponds to the Extra Commas setting . To check this setting, use __option (warn_extracomma), described in Checking Settings. The default setting is off.

    - - - - - + + + + + + + warn_extracomma + + + + +

    warn_extracomma

    +

    Controls the recognition of superfluous commas.

    +
    Syntax
    +

    #pragma warn_extracomma on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler issues a warning when it encounters an extra comma. For more information about this warning, see “Extra Commas”.

    +

    This pragma corresponds to the Extra Commas setting . To check this setting, use __option (warn_extracomma), described in Checking Settings. The default setting is off.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_filenamecaps.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_filenamecaps.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_filenamecaps.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,30 +1,30 @@ - - - - - - - warn_filenamecaps - - - - -

    warn_filenamecaps

    -

    Controls the recognition of conflicts involving case-sensitive filenames within user includes.

    -
    Syntax
    -

    #pragma warn_filenamecaps on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler issues a warning when an include directive capitalizes a filename within a user include differently from the way the filename appears on a disk. It also detects use of 8.3 DOS filenames in Windows when a long filename is available. This pragma helps avoid porting problems to operating systems with case-sensitive filenames.

    -

    By default, this pragma only checks the spelling of user includes such as the following:

    -

    #include "file"

    -

    For more information on checking system includes, see pragma warn_filenamecaps_system.

    -

    This pragma corresponds to the Include File Capitalization setting . To check this setting, use __option (warn_filenamecaps), described in Checking Settings. The default setting is off.
    -

    - - - - - + + + + + + + warn_filenamecaps + + + + +

    warn_filenamecaps

    +

    Controls the recognition of conflicts involving case-sensitive filenames within user includes.

    +
    Syntax
    +

    #pragma warn_filenamecaps on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler issues a warning when an include directive capitalizes a filename within a user include differently from the way the filename appears on a disk. It also detects use of 8.3 DOS filenames in Windows when a long filename is available. This pragma helps avoid porting problems to operating systems with case-sensitive filenames.

    +

    By default, this pragma only checks the spelling of user includes such as the following:

    +

    #include "file"

    +

    For more information on checking system includes, see pragma warn_filenamecaps_system.

    +

    This pragma corresponds to the Include File Capitalization setting . To check this setting, use __option (warn_filenamecaps), described in Checking Settings. The default setting is off.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_filenamecaps_system.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_filenamecaps_system.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_filenamecaps_system.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,30 +1,30 @@ - - - - - - - warn_filenamecaps_system - - - - -

    warn_filenamecaps_system

    -

    Controls the recognition of conflicts involving case-sensitive filenames within system includes.

    -
    Syntax
    -

    #pragma warn_filenamecaps_system on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma along with warn_filenamecaps, the compiler issues a warning when an include directive capitalizes a filename within a system include differently from the way the filename appears on a disk. It also detects use of 8.3 DOS filenames in Windows when a long filename is available. This pragma helps avoid porting problems to operating systems with case-sensitive filenames.

    -

    To check the spelling of system includes such as the following:

    -

    #include <file>

    -

    use this pragma along with the warn_filenamecaps pragma.

    -

    This pragma corresponds to the Check System Includes setting . To check this setting, use __option (warn_filenamecaps_system), described in Checking Settings. The default setting is off.

    -

    NOTE Some SDKs use “colorful” capitalization, so this pragma may issue a lot of unwanted messages.

    - - - - - + + + + + + + warn_filenamecaps_system + + + + +

    warn_filenamecaps_system

    +

    Controls the recognition of conflicts involving case-sensitive filenames within system includes.

    +
    Syntax
    +

    #pragma warn_filenamecaps_system on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma along with warn_filenamecaps, the compiler issues a warning when an include directive capitalizes a filename within a system include differently from the way the filename appears on a disk. It also detects use of 8.3 DOS filenames in Windows when a long filename is available. This pragma helps avoid porting problems to operating systems with case-sensitive filenames.

    +

    To check the spelling of system includes such as the following:

    +

    #include <file>

    +

    use this pragma along with the warn_filenamecaps pragma.

    +

    This pragma corresponds to the Check System Includes setting . To check this setting, use __option (warn_filenamecaps_system), described in Checking Settings. The default setting is off.

    +

    NOTE Some SDKs use “colorful” capitalization, so this pragma may issue a lot of unwanted messages.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_hiddenlocals.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_hiddenlocals.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_hiddenlocals.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,37 +1,37 @@ - - - - - - - warn_hiddenlocals - - - - -

    warn_hiddenlocals

    -

    Controls the recognition of a local variable that hides another local variable.

    -
    Syntax
    -

    #pragma warn_hiddenlocals on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    When on, the compiler issues a warning when it encounters a local variable that hides another local variable. An example appears in Listing 10.36.

    -
    -

    Listing 10.36 Example of hidden local variables warning

    -

    #pragma warn_hiddenlocals on

    -

    void foo(int a)
    - {
    - {
    - int a;
    - }
    - } // generates a warning: object ’a’ hidden by
    - // local declaration

    -
    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (warn_hiddenlocals), described in Checking Settings. The default setting is off.

    - - - - - + + + + + + + warn_hiddenlocals + + + + +

    warn_hiddenlocals

    +

    Controls the recognition of a local variable that hides another local variable.

    +
    Syntax
    +

    #pragma warn_hiddenlocals on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    When on, the compiler issues a warning when it encounters a local variable that hides another local variable. An example appears in Listing 10.36.

    +
    +

    Listing 10.36 Example of hidden local variables warning

    +

    #pragma warn_hiddenlocals on

    +

    void foo(int a)
    + {
    + {
    + int a;
    + }
    + } // generates a warning: object ’a’ hidden by
    + // local declaration

    +
    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (warn_hiddenlocals), described in Checking Settings. The default setting is off.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_hidevirtual.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_hidevirtual.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_hidevirtual.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,28 +1,28 @@ - - - - - - - warn_hidevirtual - - - - -

    warn_hidevirtual

    -

    Controls the recognition of a non-virtual member function that hides a virtual function in a superclass.

    -
    Syntax
    -

    #pragma warn_hidevirtual on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler issues a warning if you declare a non-virtual member function that hides a virtual function in a superclass. For more information about this warning, see “Hidden Virtual Functions”. The ISO C++ Standard does not require this pragma.

    -

    NOTE A warning normally indicates that the pragma name is not recognized, but an error indicates either a syntax problem or that the pragma is not valid in the given context.

    -

    This pragma corresponds to the Hidden Virtual Functions setting . To check this setting, use __option (warn_hidevirtual). The default settings is off.
    -

    - - - - - + + + + + + + warn_hidevirtual + + + + +

    warn_hidevirtual

    +

    Controls the recognition of a non-virtual member function that hides a virtual function in a superclass.

    +
    Syntax
    +

    #pragma warn_hidevirtual on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler issues a warning if you declare a non-virtual member function that hides a virtual function in a superclass. For more information about this warning, see “Hidden Virtual Functions”. The ISO C++ Standard does not require this pragma.

    +

    NOTE A warning normally indicates that the pragma name is not recognized, but an error indicates either a syntax problem or that the pragma is not valid in the given context.

    +

    This pragma corresponds to the Hidden Virtual Functions setting . To check this setting, use __option (warn_hidevirtual). The default settings is off.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_illpragma.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_illpragma.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_illpragma.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - warn_illpragma - - - - -

    warn_illpragma

    -

    Controls the recognition of illegal pragma directives.

    -
    Syntax
    -

    #pragma warn_illpragma on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler displays a warning when it encounters a pragma it does not recognize. For more information about this warning, see “Illegal Pragmas”.

    -

    This pragma corresponds to the Illegal Pragmas setting . To check this setting, use __option (warn_illpragma), described in Checking Settings. The default setting is off.

    - - - - - + + + + + + + warn_illpragma + + + + +

    warn_illpragma

    +

    Controls the recognition of illegal pragma directives.

    +
    Syntax
    +

    #pragma warn_illpragma on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler displays a warning when it encounters a pragma it does not recognize. For more information about this warning, see “Illegal Pragmas”.

    +

    This pragma corresponds to the Illegal Pragmas setting . To check this setting, use __option (warn_illpragma), described in Checking Settings. The default setting is off.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_illtokenpasting.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_illtokenpasting.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_illtokenpasting.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,29 +1,29 @@ - - - - - - - warn_illtokenpasting - - - - -

    warn_illtokenpasting

    -

    Controls whether a warning is issued with illegal token pasting.

    -
    Syntax
    -

    #pragma warn_illtokenpasting on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    An example of this is shown below:

    -

    #define PTR(x) x##* / PTR(foo)

    -

    Token pasting is used to create a single token. In this example, foo and x cannot be combined. Often the warning indicates the macro uses “##” unnecessarilly.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (warn_illtokenpasting), described in Checking Settings. The default setting is on.

    -

    - - - - - + + + + + + + warn_illtokenpasting + + + + +

    warn_illtokenpasting

    +

    Controls whether a warning is issued with illegal token pasting.

    +
    Syntax
    +

    #pragma warn_illtokenpasting on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    An example of this is shown below:

    +

    #define PTR(x) x##* / PTR(foo)

    +

    Token pasting is used to create a single token. In this example, foo and x cannot be combined. Often the warning indicates the macro uses “##” unnecessarilly.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (warn_illtokenpasting), described in Checking Settings. The default setting is on.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_illunionmembers.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_illunionmembers.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_illunionmembers.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - access_errors - - - - -

    warn_illunionmembers

    -

    Controls whether a warning is issued when illegal union members are made, such as unions with reference or non-trivial class members.

    -
    Syntax
    -

    #pragma warn_illunionmembers on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    - This pragma does not correspond to any panel setting. To check this setting, use __option (warn_illunionmembers), described in Checking Settings. The default setting is on. -

    - - - - - + + + + + + + access_errors + + + + +

    warn_illunionmembers

    +

    Controls whether a warning is issued when illegal union members are made, such as unions with reference or non-trivial class members.

    +
    Syntax
    +

    #pragma warn_illunionmembers on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    + This pragma does not correspond to any panel setting. To check this setting, use __option (warn_illunionmembers), described in Checking Settings. The default setting is on. +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_impl_f2i_conv.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_impl_f2i_conv.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_impl_f2i_conv.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,41 +1,41 @@ - - - - - - - warn_impl_f2i_conv - - - - -

    warn_impl_f2i_conv

    -

    Controls the issuing of warnings for implicit float-to-int conversions.

    -
    Syntax
    -

    #pragma warn_impl_f2i_conv on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler issues a warning for implicitly converting floating-point values to integral values. Listing 10.37 provides an example.

    -
    -

    Listing 10.37 Example of Implicit float-to-int Conversion

    -

    #pragma warn_implicitconv on // required to enable warnings
    - #pragma warn_impl_f2i_conv on // enable conversion warning

    -

    float f1, f2;
    - signed int si1, si2;

    -

    int main()
    - {
    - si1 = f1; // WARNING
    - #pragma warn_impl_f2i_conv off // disable conversion warning
    - si2 = f2; // OK
    - }

    -
    -

    This pragma corresponds to the Float to Integer setting . To check this setting, use __option (warn_impl_f2i_conv), described in Checking Settings. The default setting is off.

    -

    NOTE The setting of this pragma is ignored unless warn_implicitconv is on.

    -

    - - - - - + + + + + + + warn_impl_f2i_conv + + + + +

    warn_impl_f2i_conv

    +

    Controls the issuing of warnings for implicit float-to-int conversions.

    +
    Syntax
    +

    #pragma warn_impl_f2i_conv on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler issues a warning for implicitly converting floating-point values to integral values. Listing 10.37 provides an example.

    +
    +

    Listing 10.37 Example of Implicit float-to-int Conversion

    +

    #pragma warn_implicitconv on // required to enable warnings
    + #pragma warn_impl_f2i_conv on // enable conversion warning

    +

    float f1, f2;
    + signed int si1, si2;

    +

    int main()
    + {
    + si1 = f1; // WARNING
    + #pragma warn_impl_f2i_conv off // disable conversion warning
    + si2 = f2; // OK
    + }

    +
    +

    This pragma corresponds to the Float to Integer setting . To check this setting, use __option (warn_impl_f2i_conv), described in Checking Settings. The default setting is off.

    +

    NOTE The setting of this pragma is ignored unless warn_implicitconv is on.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_impl_i2f_conv.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_impl_i2f_conv.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_impl_i2f_conv.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,41 +1,41 @@ - - - - - - - warn_impl_i2f_conv - - - - -

    warn_impl_i2f_conv

    -

    Controls the issuing of warnings for implicit int-to-float conversions.

    -
    Syntax
    -

    #pragma warn_impl_i2f_conv on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler issues a warning for implicitly converting integral values to floating-point values. Listing 10.38 provides an example.

    -
    -

    Listing 10.38 Example of Implicit int-to-float Conversion

    -

    #pragma warn_implicitconv on // required to enable warnings
    - #pragma warn_impl_i2f_conv on // enable conversion warning

    -

    float f1, f2;
    - signed int si1, si2;

    -

    int main()
    - {
    - f1 = si1; // WARNING

    -

    #pragma warn_impl_i2f_conv off // disable conversion warning
    - f2 = si2; // OK
    - }

    -
    -

    This pragma corresponds to the Integer to Float setting . To check this setting, use __option (warn_impl_i2f_conv), described in Checking Settings. The default setting is off.

    -

    NOTE The setting of this pragma is ignored unless warn_implicitconv is on.

    -

    - - - - - + + + + + + + warn_impl_i2f_conv + + + + +

    warn_impl_i2f_conv

    +

    Controls the issuing of warnings for implicit int-to-float conversions.

    +
    Syntax
    +

    #pragma warn_impl_i2f_conv on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler issues a warning for implicitly converting integral values to floating-point values. Listing 10.38 provides an example.

    +
    +

    Listing 10.38 Example of Implicit int-to-float Conversion

    +

    #pragma warn_implicitconv on // required to enable warnings
    + #pragma warn_impl_i2f_conv on // enable conversion warning

    +

    float f1, f2;
    + signed int si1, si2;

    +

    int main()
    + {
    + f1 = si1; // WARNING

    +

    #pragma warn_impl_i2f_conv off // disable conversion warning
    + f2 = si2; // OK
    + }

    +
    +

    This pragma corresponds to the Integer to Float setting . To check this setting, use __option (warn_impl_i2f_conv), described in Checking Settings. The default setting is off.

    +

    NOTE The setting of this pragma is ignored unless warn_implicitconv is on.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_impl_s2u_conv.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_impl_s2u_conv.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_impl_s2u_conv.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,41 +1,41 @@ - - - - - - - warn_impl_s2u_conv - - - - -

    warn_impl_s2u_conv

    -

    Controls the issuing of warnings for implicit conversions between the signed int and unsigned int data types.

    -
    Syntax
    -

    #pragma warn_impl_s2u_conv on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler issues a warning for implicitly converting either from signed int to unsigned int or vice versa. Listing 10.39 provides an example.

    -
    -

    Listing 10.39 Example of Implicit Conversions Between Signed int and unsigned int

    -

    #pragma warn_implicitconv on // required to enable warnings
    - #pragma warn_impl_s2u_conv on // enable conversion warningsigned int si;
    - unsigned int ui;

    -

    int main()
    - {
    - ui = si; // WARNING
    - si = ui; // WARNING

    -

    #pragma warn_impl_s2u_conv off // disable conversion warning
    - ui = si; // OK
    - si = ui; // OK
    - }

    -
    -

    This pragma corresponds to the Signed / Unsigned setting . To check this setting, use __option (warn_impl_s2u_conv), described in Checking Settings. The default setting is off.

    -

    NOTE The setting of this pragma is ignored unless warn_implicitconv is on.

    - - - - - + + + + + + + warn_impl_s2u_conv + + + + +

    warn_impl_s2u_conv

    +

    Controls the issuing of warnings for implicit conversions between the signed int and unsigned int data types.

    +
    Syntax
    +

    #pragma warn_impl_s2u_conv on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler issues a warning for implicitly converting either from signed int to unsigned int or vice versa. Listing 10.39 provides an example.

    +
    +

    Listing 10.39 Example of Implicit Conversions Between Signed int and unsigned int

    +

    #pragma warn_implicitconv on // required to enable warnings
    + #pragma warn_impl_s2u_conv on // enable conversion warningsigned int si;
    + unsigned int ui;

    +

    int main()
    + {
    + ui = si; // WARNING
    + si = ui; // WARNING

    +

    #pragma warn_impl_s2u_conv off // disable conversion warning
    + ui = si; // OK
    + si = ui; // OK
    + }

    +
    +

    This pragma corresponds to the Signed / Unsigned setting . To check this setting, use __option (warn_impl_s2u_conv), described in Checking Settings. The default setting is off.

    +

    NOTE The setting of this pragma is ignored unless warn_implicitconv is on.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_implicitconv.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_implicitconv.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_implicitconv.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,46 +1,46 @@ - - - - - - - warn_implicitconv - - - - -

    warn_implicitconv

    -

    Controls the issuing of warnings for all implicit arithmetic conversions.

    -
    Syntax
    -

    #pragma warn_implicitconv on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler issues a warning for all implicit arithmetic conversions when the destination type might not represent the source value. Listing 10.40 provides an example.

    -
    -

    Listing 10.40 Example of Implicit Conversion

    -

    #pragma warn_implicitconv on // required to enable warnings
    - #pragma warn_impl_f2i_conv on // enable conversion warning
    - #pragma warn_impl_i2f_conv on // enable conversion warning
    - #pragma warn_impl_s2u_conv on // enable conversion warning

    -

    float f;
    - signed int si;
    - unsigned int ui;

    -

    int main()
    - {
    - f = si; // WARNING
    - si = f; // WARNING
    - ui = si; // WARNING
    - si = ui; // WARNING
    - }

    -
    -

    For more information about this warning, see “Implicit Arithmetic Conversions”.

    -

    NOTE This option “opens the gate” for the checking of implicit conversions. The sub-pragmas warn_impl_f2i_conv, warn_impl_i2f_conv, and warn_impl_s2u_conv control the classes of conversions checked.

    -

    This pragma corresponds to the Implicit Arithmetic Conversions setting . To check this setting, use __option (warn_implicitconv), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + warn_implicitconv + + + + +

    warn_implicitconv

    +

    Controls the issuing of warnings for all implicit arithmetic conversions.

    +
    Syntax
    +

    #pragma warn_implicitconv on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler issues a warning for all implicit arithmetic conversions when the destination type might not represent the source value. Listing 10.40 provides an example.

    +
    +

    Listing 10.40 Example of Implicit Conversion

    +

    #pragma warn_implicitconv on // required to enable warnings
    + #pragma warn_impl_f2i_conv on // enable conversion warning
    + #pragma warn_impl_i2f_conv on // enable conversion warning
    + #pragma warn_impl_s2u_conv on // enable conversion warning

    +

    float f;
    + signed int si;
    + unsigned int ui;

    +

    int main()
    + {
    + f = si; // WARNING
    + si = f; // WARNING
    + ui = si; // WARNING
    + si = ui; // WARNING
    + }

    +
    +

    For more information about this warning, see “Implicit Arithmetic Conversions”.

    +

    NOTE This option “opens the gate” for the checking of implicit conversions. The sub-pragmas warn_impl_f2i_conv, warn_impl_i2f_conv, and warn_impl_s2u_conv control the classes of conversions checked.

    +

    This pragma corresponds to the Implicit Arithmetic Conversions setting . To check this setting, use __option (warn_implicitconv), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_largeargs.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_largeargs.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_largeargs.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - warn_largeargs - - - - -

    warn_largeargs

    -

    Controls the issuing of warnings for passing non-“int” numeric values to unprototyped functions.

    -
    Syntax
    -

    #pragma warn_largeargs on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler issues a warning if you attempt to pass a non-integer numeric value, such as a float or long long, to an unprototyped function when the require_prototypes pragma is disabled.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (warn_largeargs), described in Checking Settings. The default setting is off.

    - - - - - + + + + + + + warn_largeargs + + + + +

    warn_largeargs

    +

    Controls the issuing of warnings for passing non-“int” numeric values to unprototyped functions.

    +
    Syntax
    +

    #pragma warn_largeargs on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler issues a warning if you attempt to pass a non-integer numeric value, such as a float or long long, to an unprototyped function when the require_prototypes pragma is disabled.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (warn_largeargs), described in Checking Settings. The default setting is off.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_missingreturn.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_missingreturn.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_missingreturn.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,36 +1,36 @@ - - - - - - - warn_missingreturn - - - - -

    warn_missingreturn

    -

    Controls whether the compiler generates a warning when a function that returns a value is missing a return statement.

    -
    Syntax
    -

    #pragma warn_missingreturn on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    An example is shown in Listing 10.41.

    -
    -

    Listing 10.41 Example of warn_missingreturn pragma

    -

    #pragma warn_missingreturn on

    -

    int foo()
    - {
    - // no return statement in foo()
    - } // generates a warning: return value expected

    -
    -

    This pragma corresponds to the Missing ‘return’ Statements option . To check this setting, use __option (warn_missingreturn), described in Checking Settings. The default setting is off.
    -

    -

    - - - - - + + + + + + + warn_missingreturn + + + + +

    warn_missingreturn

    +

    Controls whether the compiler generates a warning when a function that returns a value is missing a return statement.

    +
    Syntax
    +

    #pragma warn_missingreturn on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    An example is shown in Listing 10.41.

    +
    +

    Listing 10.41 Example of warn_missingreturn pragma

    +

    #pragma warn_missingreturn on

    +

    int foo()
    + {
    + // no return statement in foo()
    + } // generates a warning: return value expected

    +
    +

    This pragma corresponds to the Missing ‘return’ Statements option . To check this setting, use __option (warn_missingreturn), described in Checking Settings. The default setting is off.
    +

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_no_explicit_virtual.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_no_explicit_virtual.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_no_explicit_virtual.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,40 +1,40 @@ - - - - - - - warn_no_explicit_virtual - - - - -

    warn_no_explicit_virtual

    -

    Controls the issuing of warnings if an overriding function is not declared with a virtual keyword.

    -
    Syntax
    -

    #pragma warn_no_explicit_virtual on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    Listing 10.42 shows an example.

    -
    -

    Listing 10.42 Example of warn_no_explicit_virtual pragma

    -

    #pragma warn_no_explicit_virtual on

    -

    struct A {
    - virtual void f();
    - };

    -

    struct B {
    - void f(); // WARNING: override ‘B::f()’ is declared
    - // without ’virtual’ keyword
    - }
    -

    -
    -

    TIP This warning is not required by the ISO C++ standard, but can help you track down unwanted overrides.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (warn_no_explicit_virtual), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + warn_no_explicit_virtual + + + + +

    warn_no_explicit_virtual

    +

    Controls the issuing of warnings if an overriding function is not declared with a virtual keyword.

    +
    Syntax
    +

    #pragma warn_no_explicit_virtual on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    Listing 10.42 shows an example.

    +
    +

    Listing 10.42 Example of warn_no_explicit_virtual pragma

    +

    #pragma warn_no_explicit_virtual on

    +

    struct A {
    + virtual void f();
    + };

    +

    struct B {
    + void f(); // WARNING: override ‘B::f()’ is declared
    + // without ’virtual’ keyword
    + }
    +

    +
    +

    TIP This warning is not required by the ISO C++ standard, but can help you track down unwanted overrides.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (warn_no_explicit_virtual), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_no_side_effect.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_no_side_effect.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_no_side_effect.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,37 +1,37 @@ - - - - - - - warn_no_side_effect - - - - -

    warn_no_side_effect

    -

    Controls the issuing of warnings for redundant statements.

    -
    Syntax
    -

    #pragma warn_no_side_effect on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler issues a warning when it encounters a statement that produces no side effect. To suppress this warning, cast the statement with (void). Listing 10.43 provides an example

    -
    -

    Listing 10.43 Example of Pragma warn_no_side_effect

    -

    #pragma warn_no_side_effect on
    - void foo(int a,int b)
    - {
    - a+b; // WARNING: expression has no side effect
    - (void)(a+b); // void cast suppresses warning
    - }

    -
    -

    For more information about this warning, see “Redundant Statements”.

    -

    This pragma corresponds to the Expression Has No Side Effect panel setting . To check this setting, use __option (warn_no_side_effect), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + warn_no_side_effect + + + + +

    warn_no_side_effect

    +

    Controls the issuing of warnings for redundant statements.

    +
    Syntax
    +

    #pragma warn_no_side_effect on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler issues a warning when it encounters a statement that produces no side effect. To suppress this warning, cast the statement with (void). Listing 10.43 provides an example

    +
    +

    Listing 10.43 Example of Pragma warn_no_side_effect

    +

    #pragma warn_no_side_effect on
    + void foo(int a,int b)
    + {
    + a+b; // WARNING: expression has no side effect
    + (void)(a+b); // void cast suppresses warning
    + }

    +
    +

    For more information about this warning, see “Redundant Statements”.

    +

    This pragma corresponds to the Expression Has No Side Effect panel setting . To check this setting, use __option (warn_no_side_effect), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_no_typename.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_no_typename.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_no_typename.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - warn_no_typename - - - - -

    warn_no_typename

    -

    Controls the issuing of warnings for missing typenames.

    -
    Syntax
    -

    #pragma warn_no_typename on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    The compiler issues a warning if a typenames required by the C++ standard is missing but can still be determined by the compiler based on the context of the surrounding C++ syntax.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (warn_no_typename), described in Checking Settings. This pragma is enabled by the ISO C++ Template Parser. The default settings is off.

    -

    - - - - - + + + + + + + warn_no_typename + + + + +

    warn_no_typename

    +

    Controls the issuing of warnings for missing typenames.

    +
    Syntax
    +

    #pragma warn_no_typename on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    The compiler issues a warning if a typenames required by the C++ standard is missing but can still be determined by the compiler based on the context of the surrounding C++ syntax.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (warn_no_typename), described in Checking Settings. This pragma is enabled by the ISO C++ Template Parser. The default settings is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_notinlined.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_notinlined.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_notinlined.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - warn_notinlined - - - - -

    warn_notinlined

    -

    Controls the issuing of warnings for functions the compiler cannot inline.

    -
    Syntax
    -

    #pragma warn_notinlined on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    An inline function is indicated by the inline keyword or is implicitly inline because it is defined, rather than just declared, within its class definition. If you enable this pragma, the compiler issues a warning for non-inlined inline function calls. For more information about this warning, see “inline Functions That Are Not Inlined”.

    -

    This pragma corresponds to the Non-Inlined Functions setting . To check this setting, use __option (warn_notinlined), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + warn_notinlined + + + + +

    warn_notinlined

    +

    Controls the issuing of warnings for functions the compiler cannot inline.

    +
    Syntax
    +

    #pragma warn_notinlined on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    An inline function is indicated by the inline keyword or is implicitly inline because it is defined, rather than just declared, within its class definition. If you enable this pragma, the compiler issues a warning for non-inlined inline function calls. For more information about this warning, see “inline Functions That Are Not Inlined”.

    +

    This pragma corresponds to the Non-Inlined Functions setting . To check this setting, use __option (warn_notinlined), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_padding.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_padding.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_padding.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - - - warn_padding - - - - -

    warn_padding

    -

    Controls the issuing of warnings for data structure padding.

    -
    Syntax
    -

    #pragma warn_padding on | off | reset -

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler warns about any bytes that were implicitly added after an ANSI C struct member to improve memory alignment. Refer to the appropriate Targeting manual for more information on how the compiler pads data structures for a particular processor or operating system. For more information about this warning, see “Realigned Data Structures”.

    -

    This pragma corresponds to the Pad Bytes Added setting . To check this setting, use __option (warn_padding), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + warn_padding + + + + +

    warn_padding

    +

    Controls the issuing of warnings for data structure padding.

    +
    Syntax
    +

    #pragma warn_padding on | off | reset +

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler warns about any bytes that were implicitly added after an ANSI C struct member to improve memory alignment. Refer to the appropriate Targeting manual for more information on how the compiler pads data structures for a particular processor or operating system. For more information about this warning, see “Realigned Data Structures”.

    +

    This pragma corresponds to the Pad Bytes Added setting . To check this setting, use __option (warn_padding), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_pch_portability.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_pch_portability.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_pch_portability.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - warn_pch_portability - - - - -

    warn_pch_portability

    -

    Controls whether or not to issue a warning when #pragma once on is used in a precompiled header.

    -
    Syntax
    -

    #pragma warn_pch_portability on | off | reset

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler issues a warning when you use #pragma once on in a precompiled header. This helps you avoid situations in which transferring a precompiled header from machine to machine causes the precompiled header to produce different results. For more information, see pragma once.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (warn_pch_portability), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + warn_pch_portability + + + + +

    warn_pch_portability

    +

    Controls whether or not to issue a warning when #pragma once on is used in a precompiled header.

    +
    Syntax
    +

    #pragma warn_pch_portability on | off | reset

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler issues a warning when you use #pragma once on in a precompiled header. This helps you avoid situations in which transferring a precompiled header from machine to machine causes the precompiled header to produce different results. For more information, see pragma once.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (warn_pch_portability), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_possunwant.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_possunwant.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_possunwant.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - warn_possunwant - - - - -

    warn_possunwant

    -

    Controls the recognition of possible unintentional logical errors.

    -
    Syntax
    -

    #pragma warn_possunwant on | off | reset

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler checks for common errors that are legal C/C++ but might produce unexpected results, such as putting in unintended semicolons or confusing = and ==. For more information about this warning, see “Common Errors”.

    -

    This pragma corresponds to the Possible Errors setting . To check this setting, use __option (warn_possunwant), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + warn_possunwant + + + + +

    warn_possunwant

    +

    Controls the recognition of possible unintentional logical errors.

    +
    Syntax
    +

    #pragma warn_possunwant on | off | reset

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler checks for common errors that are legal C/C++ but might produce unexpected results, such as putting in unintended semicolons or confusing = and ==. For more information about this warning, see “Common Errors”.

    +

    This pragma corresponds to the Possible Errors setting . To check this setting, use __option (warn_possunwant), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_ptr_int_conv.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_ptr_int_conv.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_ptr_int_conv.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,34 +1,34 @@ - - - - - - - warn_ptr_int_conv - - - - -

    warn_ptr_int_conv

    -

    Controls the recognition of the conversion of pointer values to incorrectly-sized integral values.

    -
    Syntax
    -

    #pragma warn_ptr_int_conv on | off | reset

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler issues a warning if an expression attempts to convert a pointer value to an integral type that is not large enough to hold the pointer value.

    -
    -

    Listing 10.44 Example for #pragma warn_ptr_int_conv

    -

    #pragma warn_ptr_int_conv on

    -

    char *my_ptr;
    - char too_small = (char)my_ptr; // WARNING: char is too small

    -
    -

    See also pragma warn_any_ptr_int_conv.

    -

    For more information about this warning, see “Common Errors”.

    -

    This pragma corresponds to the Pointer / Integral Conversions setting . To check this setting, use __option (warn_ptr_int_conv), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + warn_ptr_int_conv + + + + +

    warn_ptr_int_conv

    +

    Controls the recognition of the conversion of pointer values to incorrectly-sized integral values.

    +
    Syntax
    +

    #pragma warn_ptr_int_conv on | off | reset

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler issues a warning if an expression attempts to convert a pointer value to an integral type that is not large enough to hold the pointer value.

    +
    +

    Listing 10.44 Example for #pragma warn_ptr_int_conv

    +

    #pragma warn_ptr_int_conv on

    +

    char *my_ptr;
    + char too_small = (char)my_ptr; // WARNING: char is too small

    +
    +

    See also pragma warn_any_ptr_int_conv.

    +

    For more information about this warning, see “Common Errors”.

    +

    This pragma corresponds to the Pointer / Integral Conversions setting . To check this setting, use __option (warn_ptr_int_conv), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_resultnotused.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_resultnotused.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_resultnotused.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,37 +1,37 @@ - - - - - - - warn_resultnotused - - - - -

    warn_resultnotused

    -

    Controls the issuing of warnings when function results are ignored.

    -
    Syntax
    -

    #pragma warn_resultnotused on | off | reset

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler issues a warning when it encounters a statement that calls a function without using its result. To prevent this, cast the statement with (void). Listing 10.45 provides an example.

    -
    -

    Listing 10.45 Example of Function Calls with Unused Results

    -

    #pragma warn_resultnotused on

    -

    extern int bar();
    - void foo()
    - {
    - bar(); // WARNING: result of function call is not used
    - (void)bar(); // ‘void’ cast suppresses warning
    - }

    -
    -

    For more information about this warning, see Ignored Function Results.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (warn_resultnotused), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + warn_resultnotused + + + + +

    warn_resultnotused

    +

    Controls the issuing of warnings when function results are ignored.

    +
    Syntax
    +

    #pragma warn_resultnotused on | off | reset

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler issues a warning when it encounters a statement that calls a function without using its result. To prevent this, cast the statement with (void). Listing 10.45 provides an example.

    +
    +

    Listing 10.45 Example of Function Calls with Unused Results

    +

    #pragma warn_resultnotused on

    +

    extern int bar();
    + void foo()
    + {
    + bar(); // WARNING: result of function call is not used
    + (void)bar(); // ‘void’ cast suppresses warning
    + }

    +
    +

    For more information about this warning, see Ignored Function Results.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (warn_resultnotused), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_structclass.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_structclass.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_structclass.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - warn_structclass - - - - -

    warn_structclass

    -

    Controls the issuing of warnings for the inconsistent use of the class and struct keywords.

    -
    Syntax
    -

    #pragma warn_structclass on | off | reset

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler issues a warning if you use the class and struct keywords in the definition and declaration of the same identifier. For more information about this warning, see Mixed Use of ‘class’ and ‘struct’ Keywords.

    -

    This pragma corresponds to the Inconsistent ‘class’ / ‘struct’ Usage setting . To check this setting, use __option (warn_structclass), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + warn_structclass + + + + +

    warn_structclass

    +

    Controls the issuing of warnings for the inconsistent use of the class and struct keywords.

    +
    Syntax
    +

    #pragma warn_structclass on | off | reset

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler issues a warning if you use the class and struct keywords in the definition and declaration of the same identifier. For more information about this warning, see Mixed Use of ‘class’ and ‘struct’ Keywords.

    +

    This pragma corresponds to the Inconsistent ‘class’ / ‘struct’ Usage setting . To check this setting, use __option (warn_structclass), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_undefmacro.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_undefmacro.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_undefmacro.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,35 +1,35 @@ - - - - - - - warn_undefmacro - - - - -

    warn_undefmacro

    -

    Controls the detection of undefined macros in #if/#elif conditionals.

    -
    Syntax
    -

    #pragma warn_undefmacro on | off | reset

    -
    Target
    -

    All targets.

    -
    Remarks
    -

    Listing 10.46 provides an example.

    -
    -

    Listing 10.46 Example of Undefined Macro

    -

    #if UNDEFINEDMACRO == 4 // WARNING: undefined macro
    - // ’UNDEFINEDMACRO’ used in
    - // #if/#elif conditional

    -
    -

    Use this pragma to detect the use of undefined macros (especially expressions) where the default value 0 is used. To suppress this warning, check if the macro is defined before using it in a #if or #elif conditional.

    -

    NOTE A warning is only issued when a macro is evaluated. A short-circuited “&&” or “||” test or unevaluated “?:” will not produce a warning.

    -

    This pragma corresponds to the Undefined Macro in #if setting . To check this setting, use __option (warn_undefmacro), described in Checking Settings. The default setting is off.

    -

    -

    - - - - - + + + + + + + warn_undefmacro + + + + +

    warn_undefmacro

    +

    Controls the detection of undefined macros in #if/#elif conditionals.

    +
    Syntax
    +

    #pragma warn_undefmacro on | off | reset

    +
    Target
    +

    All targets.

    +
    Remarks
    +

    Listing 10.46 provides an example.

    +
    +

    Listing 10.46 Example of Undefined Macro

    +

    #if UNDEFINEDMACRO == 4 // WARNING: undefined macro
    + // ’UNDEFINEDMACRO’ used in
    + // #if/#elif conditional

    +
    +

    Use this pragma to detect the use of undefined macros (especially expressions) where the default value 0 is used. To suppress this warning, check if the macro is defined before using it in a #if or #elif conditional.

    +

    NOTE A warning is only issued when a macro is evaluated. A short-circuited “&&” or “||” test or unevaluated “?:” will not produce a warning.

    +

    This pragma corresponds to the Undefined Macro in #if setting . To check this setting, use __option (warn_undefmacro), described in Checking Settings. The default setting is off.

    +

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_unitializedvar.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_unitializedvar.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_unitializedvar.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,25 +1,25 @@ - - - - - - - warn_uninitializedvar - - - - -

    warn_uninitializedvar

    -

    Controls the issuing of warnings whenever local variables are initialized before being used.

    -
    Syntax
    -

    #pragma warn_uninitializedvar on | off | reset

    -
    Targets
    - All platforms.
    -
    Remarks
    - This pragma corresponds to the Unused Variables setting . To check this setting, use __option (warn_uninitializedvar), described in Checking Settings. The default setting is off. -

    - - - - - + + + + + + + warn_uninitializedvar + + + + +

    warn_uninitializedvar

    +

    Controls the issuing of warnings whenever local variables are initialized before being used.

    +
    Syntax
    +

    #pragma warn_uninitializedvar on | off | reset

    +
    Targets
    + All platforms.
    +
    Remarks
    + This pragma corresponds to the Unused Variables setting . To check this setting, use __option (warn_uninitializedvar), described in Checking Settings. The default setting is off. +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_unusedarg.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_unusedarg.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warn_unusedarg.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - warn_unusedarg - - - - -

    warn_unusedarg

    -

    Controls the recognition of unreferenced arguments.

    -
    Syntax
    -

    #pragma warn_unusedarg on | off | reset

    -
    Targets
    - All platforms.
    -
    Remarks
    -

    If you enable this pragma, the compiler issues a warning when it encounters an argument you declare but do not use. For more information about this warning, see “Unused Arguments”. To suppress this warning in C++ source code, leave an argument identifier out of the function parameter list. Listing 10.33 shows an example.

    -

    This pragma corresponds to the Unused Arguments setting . To check this setting, use __option (warn_unusedarg), described in Checking Settings. The default setting is off.

    -

    - - - - - + + + + + + + warn_unusedarg + + + + +

    warn_unusedarg

    +

    Controls the recognition of unreferenced arguments.

    +
    Syntax
    +

    #pragma warn_unusedarg on | off | reset

    +
    Targets
    + All platforms.
    +
    Remarks
    +

    If you enable this pragma, the compiler issues a warning when it encounters an argument you declare but do not use. For more information about this warning, see “Unused Arguments”. To suppress this warning in C++ source code, leave an argument identifier out of the function parameter list. Listing 10.33 shows an example.

    +

    This pragma corresponds to the Unused Arguments setting . To check this setting, use __option (warn_unusedarg), described in Checking Settings. The default setting is off.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warning.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warning.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warning.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,43 +1,43 @@ - - - - - - - access_errors - - - - -

    warning

    -

    Controls which warning numbers are displayed during compiling. -

    Syntax
    -

    #pragma warning on | off | reset (num [, ...])

    -

    This alternate syntax is allowed but ignored (message numbers don’t match):

    -

    #pragma warning(warning_type : warning_num_list)

    -
    Parameters
    - -

    num

    -
    -

    The number of the warning message to show or suppress.

    -
    -

    warning_type

    -
    -

    Specifies the warning type. Included for Microsoft compatability but ignored.

    -
    -

    warning_num_list

    -
    -

    The warning_num_list is a list of warning numbers separated by spaces. Included for Microsoft compatability but ignored.

    -
    -
    Targets
    - All targets.
    -
    Remarks
    -

    Use the pragma showmessagenumber to display warning messages with their warning numbers on a Windows-based system.
    - The alternative syntax applies to x86 programming only. Included for compatibility with Microsoft code but not implemented.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (warning), described in Checking Settings. The default setting is on.

    -

    - - - - - + + + + + + + access_errors + + + + +

    warning

    +

    Controls which warning numbers are displayed during compiling. +

    Syntax
    +

    #pragma warning on | off | reset (num [, ...])

    +

    This alternate syntax is allowed but ignored (message numbers don’t match):

    +

    #pragma warning(warning_type : warning_num_list)

    +
    Parameters
    + +

    num

    +
    +

    The number of the warning message to show or suppress.

    +
    +

    warning_type

    +
    +

    Specifies the warning type. Included for Microsoft compatability but ignored.

    +
    +

    warning_num_list

    +
    +

    The warning_num_list is a list of warning numbers separated by spaces. Included for Microsoft compatability but ignored.

    +
    +
    Targets
    + All targets.
    +
    Remarks
    +

    Use the pragma showmessagenumber to display warning messages with their warning numbers on a Windows-based system.
    + The alternative syntax applies to x86 programming only. Included for compatibility with Microsoft code but not implemented.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (warning), described in Checking Settings. The default setting is on.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warning_errors.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warning_errors.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_warning_errors.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - - - access_errors - - - - -

    warning_errors

    -

    Controls whether or not warnings are treated as errors.

    -
    Syntax
    -

    #pragma warning_errors on | off | reset

    -
    Targets
    - All platforms.
    -
    Remarks
    - If you enable this pragma, the compiler treats all warnings as though they were errors and does not translate your file until you resolve them.
    - This pragma corresponds to the Treat All Warnings As Errors setting in the C/C++ Warnings panel. To check this setting, use __option (warning_errors), described in Checking Settings. -

    - - - - - + + + + + + + access_errors + + + + +

    warning_errors

    +

    Controls whether or not warnings are treated as errors.

    +
    Syntax
    +

    #pragma warning_errors on | off | reset

    +
    Targets
    + All platforms.
    +
    Remarks
    + If you enable this pragma, the compiler treats all warnings as though they were errors and does not translate your file until you resolve them.
    + This pragma corresponds to the Treat All Warnings As Errors setting in the C/C++ Warnings panel. To check this setting, use __option (warning_errors), described in Checking Settings. +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_wchar_type.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_wchar_type.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/p_wchar_type.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,28 +1,28 @@ - - - - - - - access_errors - - - - -

    wchar_type

    -

    Controls the size and format of the wchar_t type. -

    Syntax
    -

    #pragma wchar_type on | off | reset

    -
    Targets
    - All platforms. -
    Remarks
    -

    If you enable this pragma, wchar_t is treated as a built-in type.

    -

    This pragma corresponds to the Enable wchar_t Support setting . To check this setting, use __option (.*), described in Checking Settings. The default setting is on. -

    -

    -

    - - - - - + + + + + + + access_errors + + + + +

    wchar_type

    +

    Controls the size and format of the wchar_t type. +

    Syntax
    +

    #pragma wchar_type on | off | reset

    +
    Targets
    + All platforms. +
    Remarks
    +

    If you enable this pragma, wchar_t is treated as a built-in type.

    +

    This pragma corresponds to the Enable wchar_t Support setting . To check this setting, use __option (.*), described in Checking Settings. The default setting is on. +

    +

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/pragma_reference.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/pragma_reference.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/pragma_reference.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,37 +1,37 @@ - - - - - - - Pragma Scope - - - - -

    Common Pragma Reference

    -

    The common pragmas include:

    - - - - - - - - - - - -
    A-FG-MN-Z
      
    -

    - - - - - + + + + + + + Pragma Scope + + + + +

    Common Pragma Reference

    +

    The common pragmas include:

    + + + + + + + + + + + +
    A-FG-MN-Z
      
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/pragma_scope.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/pragma_scope.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/pragma_scope.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,25 +1,25 @@ - - - - - - - Pragma Syntax - - - - -

    Pragma Scope

    -

    The scope of a pragma setting is usually limited to a single compilation unit.

    -

    As discussed in Pragma Syntax, you should use on or off after the name of the pragma to change its setting to the desired condition. All code after that point is compiled with that setting until either:

    - -

    At the beginning of each file, the compiler reverts to the target or default settings.

    -

    - - - - - + + + + + + + Pragma Syntax + + + + +

    Pragma Scope

    +

    The scope of a pragma setting is usually limited to a single compilation unit.

    +

    As discussed in Pragma Syntax, you should use on or off after the name of the pragma to change its setting to the desired condition. All code after that point is compiled with that setting until either:

    + +

    At the beginning of each file, the compiler reverts to the target or default settings.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/pragma_syntax.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/pragma_syntax.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/pragma_syntax.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,46 +1,46 @@ - - - - - - - Pragma Syntax - - - - -

    Pragma Syntax

    -

    Most pragmas have this syntax:

    -

    #pragma setting-name on | off | reset

    -
    Parameters
    -

    off

    -
    -

    Enables the pragma for any functions that follow.

    -
    -

    on

    -
    -

    Disables the pragma for any functions that follow.

    -
    -

    reset

    -
    -

    Restores the pragma to its original setting.

    -
    -

    An exampe of this is shown below:

    -
    -

    #pragma profile off

    -

    // If the Generate Profiler Calls setting is on, turns it off for these functions.

    -

    #include <smallfuncs.h>

    -

    #pragma profile reset

    -

    // If the Generate Profiler Calls setting was originally on, turns it back on.
    - // - Otherwise, the setting remains off

    -
    -

    Suppose that you use #pragma profile on instead of #pragma profile reset. If you later disable Generate Profiler Calls from the Preference dialog box, that pragma turns it on. Using reset ensures that you do not inadvertently change the settings in the Project Settings dialog box.

    -

    TIP To catch pragmas that the Carbide x86 compiler does not recognize, use the pragma warn_illpragma. See also Illegal Pragmas.

    -

    NOTE The default setting of a pragma is based on the command-line default setting. These default settings used in project stationery may differ across target devices when creating a specific project. For example, a pragma for an x86 target may default to off while the same setting for an ARM target may default to on.

    -

    - - - - - + + + + + + + Pragma Syntax + + + + +

    Pragma Syntax

    +

    Most pragmas have this syntax:

    +

    #pragma setting-name on | off | reset

    +
    Parameters
    +

    off

    +
    +

    Enables the pragma for any functions that follow.

    +
    +

    on

    +
    +

    Disables the pragma for any functions that follow.

    +
    +

    reset

    +
    +

    Restores the pragma to its original setting.

    +
    +

    An exampe of this is shown below:

    +
    +

    #pragma profile off

    +

    // If the Generate Profiler Calls setting is on, turns it off for these functions.

    +

    #include <smallfuncs.h>

    +

    #pragma profile reset

    +

    // If the Generate Profiler Calls setting was originally on, turns it back on.
    + // + Otherwise, the setting remains off

    +
    +

    Suppose that you use #pragma profile on instead of #pragma profile reset. If you later disable Generate Profiler Calls from the Preference dialog box, that pragma turns it on. Using reset ensures that you do not inadvertently change the settings in the Project Settings dialog box.

    +

    TIP To catch pragmas that the Carbide x86 compiler does not recognize, use the pragma warn_illpragma. See also Illegal Pragmas.

    +

    NOTE The default setting of a pragma is based on the command-line default setting. These default settings used in project stationery may differ across target devices when creating a specific project. For example, a pragma for an x86 target may default to off while the same setting for an ARM target may default to on.

    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/pragmas.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/pragmas.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas/pragmas.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,28 +1,28 @@ - - - - - - - Common Pragmas - - - - -

    Common Pragmas

    -

    -You configure the compiler for a project by changing the appropriate pragmas.

    -

    Many of the pragmas correspond to settings and the settings panels for processors and operating systems.

    -

    Typically, you use these panels to select the settings for most of your code and use pragmas to change settings for special cases. For example, within the Global Optimizations panel, you can set code generation to a specific optimization level and then use a pragma to re-enable an optimization only for the code that benefits from the optimization. The targeting manual for the target processor or device may have details on enabling or disabling specific optimizations. When in doubt, just use the preset options.

    -

    The sections includee:

    - -

    TIP If you use the command-line tools, such as those for UNIX, see Command-Line Tools for information on how to duplicate the effect of #pragma statements using command-line tool options.

    - - - - - + + + + + + + Common Pragmas + + + + +

    Common Pragmas

    +

    +You configure the compiler for a project by changing the appropriate pragmas.

    +

    Many of the pragmas correspond to settings and the settings panels for processors and operating systems.

    +

    Typically, you use these panels to select the settings for most of your code and use pragmas to change settings for special cases. For example, within the Global Optimizations panel, you can set code generation to a specific optimization level and then use a pragma to re-enable an optimization only for the code that benefits from the optimization. The targeting manual for the target processor or device may have details on enabling or disabling specific optimizations. When in doubt, just use the preset options.

    +

    The sections includee:

    + +

    TIP If you use the command-line tools, such as those for UNIX, see Command-Line Tools for information on how to duplicate the effect of #pragma statements using command-line tool options.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_asm_fixup_dllimports.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_asm_fixup_dllimports.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_asm_fixup_dllimports.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,25 +1,25 @@ - - - - - -asm_fixup_dllimports - - - -

    asm_fixup_dllimports

    -

    Instructs the compiler to correct inline assembly that incorrectly accesses global variables from a DLL.

    -
    Syntax
    -

    #pragma asm_fixup_dllimports on | off | reset

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    In the Win32 DLL model, variables must be addressed indirectly through the symbol __imp_<symbol> and replaced with the normal link-time symbol _<symbol>. The compiler detects references to _<symbol> and replaces them with the correct sequence of code.

    -

    NOTE This transformation may not always be possible and an “illegal operand” error is reported when the compiler can’t make the substitution.

    -

    This pragma does not correspond to any panel setting. To check this setting, use the __option (asm_fixup_dllimports). The default setting is off.
    -

    - - - - - + + + + + +asm_fixup_dllimports + + + +

    asm_fixup_dllimports

    +

    Instructs the compiler to correct inline assembly that incorrectly accesses global variables from a DLL.

    +
    Syntax
    +

    #pragma asm_fixup_dllimports on | off | reset

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    In the Win32 DLL model, variables must be addressed indirectly through the symbol __imp_<symbol> and replaced with the normal link-time symbol _<symbol>. The compiler detects references to _<symbol> and replaces them with the correct sequence of code.

    +

    NOTE This transformation may not always be possible and an “illegal operand” error is reported when the compiler can’t make the substitution.

    +

    This pragma does not correspond to any panel setting. To check this setting, use the __option (asm_fixup_dllimports). The default setting is off.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_avoid_ebp.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_avoid_ebp.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_avoid_ebp.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,24 +1,24 @@ - - - - - -avoid_ebp - - - -

    avoid_ebp

    -

    Disables the EBP as a temporary register to ensure that the base pointer is valid even when full optimizations are enabled.

    -
    Syntax
    -

    #pragma avoid_ebp on | off

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    Disabling the use of the EBP register with #pragma avoid_ebp on ensures that the stack chains are coherent, even if they do not include every called function, so code that relies on the stack chain (i.e. crash recovery tools and structured exception handling) will work more consistently. Note that this can have an effect on performance (only 6 internal registers are available instead of 7) so do not use it in speed-critical code.

    -

    This #pragma is recommended for programs using _set_se_translator() under the zero-overhead exceptions model. The SEH handler chain and the zero-overhead exception stack are independent of each other, unlike the MS exceptions model where both share the same chain, so the zero-overhead exceptions model needs more help reconciling the fact that exceptions can be thrown from anywhere in the program.
    -

    - - - - - + + + + + +avoid_ebp + + + +

    avoid_ebp

    +

    Disables the EBP as a temporary register to ensure that the base pointer is valid even when full optimizations are enabled.

    +
    Syntax
    +

    #pragma avoid_ebp on | off

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    Disabling the use of the EBP register with #pragma avoid_ebp on ensures that the stack chains are coherent, even if they do not include every called function, so code that relies on the stack chain (i.e. crash recovery tools and structured exception handling) will work more consistently. Note that this can have an effect on performance (only 6 internal registers are available instead of 7) so do not use it in speed-critical code.

    +

    This #pragma is recommended for programs using _set_se_translator() under the zero-overhead exceptions model. The SEH handler chain and the zero-overhead exception stack are independent of each other, unlike the MS exceptions model where both share the same chain, so the zero-overhead exceptions model needs more help reconciling the fact that exceptions can be thrown from anywhere in the program.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_code_seg.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_code_seg.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_code_seg.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,23 +1,23 @@ - - - - - -code_seg - - - -

    code_seg

    -

    Specifies the segment into which code is placed.

    -
    Syntax
    -

    #pragma code_seg(name)

    -
    Targets
    - Intel x86
    -
    Remarks
    - This pragma designates the segment into which compiled code is placed. The name is a string specifying the name of the code segment. For example, the pragma - #pragma code_seg(".code")places all subsequent code into a segment named .code.
    - - - - - + + + + + +code_seg + + + +

    code_seg

    +

    Specifies the segment into which code is placed.

    +
    Syntax
    +

    #pragma code_seg(name)

    +
    Targets
    + Intel x86
    +
    Remarks
    + This pragma designates the segment into which compiled code is placed. The name is a string specifying the name of the code segment. For example, the pragma + #pragma code_seg(".code")places all subsequent code into a segment named .code.
    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_codeviewpro9compatible.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_codeviewpro9compatible.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_codeviewpro9compatible.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,33 +1,33 @@ - - - - - -codeviewpro9compatible - - - -

    codeviewpro9compatible

    -

    Controls the emission of CodeView 5.0 formatted debug files compatible with MSVC 6 or MSVC .NET 2003. The default is on.

    -
    Syntax
    -

    #pragma codeviewpro9compatible on | off | reset

    -
    Parameters
    -

    on

    -
    -

    Format debug files for MSVC 6 and CodeWarrior Professional 9. This is the equivilent of Symbian’s command-line option -sym codeview.

    -
    -

    off

    -
    -

    Format debug files for MSVC .NET 2003. This is the equivalent of Symbian’s command-line option -sym codeview_new.

    -

    NOTE If you normally use the command line option "-g" to enable debug information and wish to use "-sym codeview_new", note that "-g" also implies "-sym fullpath", so specify either "-g -sym codeview_new" or "-sym fullpath,codeview_new" to retain full paths in the debug information.

    -
    -
    Targets
    - Intel x86
    -
    Remarks
    -

    NOTE The Carbide linker can accept object files or libraries using both the old and the new Codeview formats and generates an executable using a mixture of formats. The Carbide debugger will accept such mixed-format information. MSVC 6 and .NET 2003, however, only accept one format, erroneously interpreting the non-favored format. You may need to rebuild all your libraries and DLLs if you wish to debug fully under those debuggers.
    -

    - - - - - + + + + + +codeviewpro9compatible + + + +

    codeviewpro9compatible

    +

    Controls the emission of CodeView 5.0 formatted debug files compatible with MSVC 6 or MSVC .NET 2003. The default is on.

    +
    Syntax
    +

    #pragma codeviewpro9compatible on | off | reset

    +
    Parameters
    +

    on

    +
    +

    Format debug files for MSVC 6 and CodeWarrior Professional 9. This is the equivilent of Symbian’s command-line option -sym codeview.

    +
    +

    off

    +
    +

    Format debug files for MSVC .NET 2003. This is the equivalent of Symbian’s command-line option -sym codeview_new.

    +

    NOTE If you normally use the command line option "-g" to enable debug information and wish to use "-sym codeview_new", note that "-g" also implies "-sym fullpath", so specify either "-g -sym codeview_new" or "-sym fullpath,codeview_new" to retain full paths in the debug information.

    +
    +
    Targets
    + Intel x86
    +
    Remarks
    +

    NOTE The Carbide linker can accept object files or libraries using both the old and the new Codeview formats and generates an executable using a mixture of formats. The Carbide debugger will accept such mixed-format information. MSVC 6 and .NET 2003, however, only accept one format, erroneously interpreting the non-favored format. You may need to rebuild all your libraries and DLLs if you wish to debug fully under those debuggers.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_comment.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_comment.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_comment.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,59 +1,59 @@ - - - - - -comment - - - -

    comment

    -

    Embeds information into the object code for the linker.

    -
    Syntax
    -

    #pragma comment(type [ “value”])

    -
    Parameters
    -

    type

    -
    -

    Set type to: lib, exestr, linker, user, or compiler.

    -
    -

    value

    -
    -

    Name of file without extension to embed into the object code.

    -
    -
    Targets
    - Intel x86
    -
    Remarks
    -

    Embeds information into the object code. The linker searches for the library file using the access paths in the IDE or the MWLibraries environment variable in the command line tool and include it after any explicitly-specified files on the command line. See Table 11.1 for a list of comment usage examples.

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    ExampleDescription
    comment(lib, “library”)Instructs the linker to automatically link against library[.lib] file when the Link with default libraries setting is enabled.
    comment(linker, “directive”) Embed a linker directive using the Linker Command File (.cmd) syntax.
    comment(user, “string”)Embed a comment into the object file.
    comment(exestr, “string”)Embed a string into the executable.
    comment(compiler)Embed compiler version into object file. Normally ignored for compatability.
    -

    This pragma does not correspond to any panel setting. To check this setting, use the __option (comment).
    -

    - - - - - + + + + + +comment + + + +

    comment

    +

    Embeds information into the object code for the linker.

    +
    Syntax
    +

    #pragma comment(type [ “value”])

    +
    Parameters
    +

    type

    +
    +

    Set type to: lib, exestr, linker, user, or compiler.

    +
    +

    value

    +
    +

    Name of file without extension to embed into the object code.

    +
    +
    Targets
    + Intel x86
    +
    Remarks
    +

    Embeds information into the object code. The linker searches for the library file using the access paths in the IDE or the MWLibraries environment variable in the command line tool and include it after any explicitly-specified files on the command line. See Table 11.1 for a list of comment usage examples.

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    ExampleDescription
    comment(lib, “library”)Instructs the linker to automatically link against library[.lib] file when the Link with default libraries setting is enabled.
    comment(linker, “directive”) Embed a linker directive using the Linker Command File (.cmd) syntax.
    comment(user, “string”)Embed a comment into the object file.
    comment(exestr, “string”)Embed a string into the executable.
    comment(compiler)Embed compiler version into object file. Normally ignored for compatability.
    +

    This pragma does not correspond to any panel setting. To check this setting, use the __option (comment).
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_disable_stackalloc.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_disable_stackalloc.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_disable_stackalloc.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,29 +1,29 @@ - - - - - -disable_stackalloc - - - -

    disable_stackalloc

    -

    Controls the compiler method used to grow the size of the stack.

    -
    Syntax
    -

    #pragma disable_stackalloc on | off | reset

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    The compiler controls how stack space is grown as follows:

    - -

    NOTE Use of this pragma is required for Win32 code.

    -

    This pragma does not correspond to any panel setting. To check this setting, use the __option (disable_stackalloc). The default setting for Win32 targets is off.
    -

    - - - - - + + + + + +disable_stackalloc + + + +

    disable_stackalloc

    +

    Controls the compiler method used to grow the size of the stack.

    +
    Syntax
    +

    #pragma disable_stackalloc on | off | reset

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    The compiler controls how stack space is grown as follows:

    + +

    NOTE Use of this pragma is required for Win32 code.

    +

    This pragma does not correspond to any panel setting. To check this setting, use the __option (disable_stackalloc). The default setting for Win32 targets is off.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_disableopts.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_disableopts.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_disableopts.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,31 +1,31 @@ - - - - - -disableopts - - - -

    disableopts

    -

    Use to make the debugging of optimized code easier while having no effect on non-optimized code.

    -
    Syntax
    -

    #pragma disableopts on | off | reset

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    To make debugging opimized code easier disableopts on:

    - -

    This pragma does not correspond to any panel setting. To check this setting, use the __option (disableopts). The default setting is off.
    -

    - - - - - + + + + + +disableopts + + + +

    disableopts

    +

    Use to make the debugging of optimized code easier while having no effect on non-optimized code.

    +
    Syntax
    +

    #pragma disableopts on | off | reset

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    To make debugging opimized code easier disableopts on:

    + +

    This pragma does not correspond to any panel setting. To check this setting, use the __option (disableopts). The default setting is off.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_emit_local_scopes.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_emit_local_scopes.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_emit_local_scopes.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,24 +1,24 @@ - - - - - -emit_local_scopes - - - -

    emit_local_scopes

    -

    Instructs the compiler to emit the scopes of local variables into debugger information.

    -
    Syntax
    -

    #pragma emit_local_scopes on | off | reset

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    This pragma enables debuggers to decide, among several variables using the same name, which one is actually used at the current program counter. This only effects debugging information generated for Codeview.

    -

    This pragma does not correspond to any panel setting. To check this setting, use the __option (emit_local_scopes). The default setting is on.
    -

    - - - - - + + + + + +emit_local_scopes + + + +

    emit_local_scopes

    +

    Instructs the compiler to emit the scopes of local variables into debugger information.

    +
    Syntax
    +

    #pragma emit_local_scopes on | off | reset

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    This pragma enables debuggers to decide, among several variables using the same name, which one is actually used at the current program counter. This only effects debugging information generated for Codeview.

    +

    This pragma does not correspond to any panel setting. To check this setting, use the __option (emit_local_scopes). The default setting is on.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_exceptions.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_exceptions.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_exceptions.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,24 +1,24 @@ - - - - - -exceptions - - - -

    exceptions

    -

    Set exception handling to use Microsoft-compatible exceptions or Carbide zero-overhead exceptions (default). Implies the use of pragma# -cpp_exceptions on.

    -
    Syntax
    -

    #pragma exc[eptions] mw | ms | sync | async

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    This pragma emulates the /EHS option of MSVC. In this model, Win32 structured exception handling (SEH) is not caught by C++ catch(...) blocks.

    -

    This pragma corresponds to the C++ exception handling setting in the Microsoft Compatability group of the x86 CodeGen panel. To check this setting, use __option (exceptions), described in Checking Settings. By default, this pragma is on.
    -

    - - - - - + + + + + +exceptions + + + +

    exceptions

    +

    Set exception handling to use Microsoft-compatible exceptions or Carbide zero-overhead exceptions (default). Implies the use of pragma# -cpp_exceptions on.

    +
    Syntax
    +

    #pragma exc[eptions] mw | ms | sync | async

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    This pragma emulates the /EHS option of MSVC. In this model, Win32 structured exception handling (SEH) is not caught by C++ catch(...) blocks.

    +

    This pragma corresponds to the C++ exception handling setting in the Microsoft Compatability group of the x86 CodeGen panel. To check this setting, use __option (exceptions), described in Checking Settings. By default, this pragma is on.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_exceptions_synchronous.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_exceptions_synchronous.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_exceptions_synchronous.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,30 +1,30 @@ - - - - - -exceptions_synchronous - - - -

    exceptions_synchronous

    -

    Set exception handling to use Microsoft-compatible exceptions. The default is off.

    -
    Syntax
    -

    #pragma exceptions_synchronous on | off | reset

    -
    Parameters
    -

    on

    -
    -

    Ignore C++ catch(...) blocks for Win32 exceptions when using Structured Exception Handling (SEH). For Microsoft-compatible mode only. Equivilent to #pragma exc sync.

    -
    -

    off

    -
    -

    Let C++ catch(...) blocks trap Win32 exceptions when using SEH. For Microsoft-compatible mode only. Equivilent to #pragma exc async. This is the default.

    -
    -
    Targets
    -

    Intel x86

    -

    NOTE To translate Win32 exceptions into C++ exceptions, use the routine set_se_translator() found in the header <eh.h>.

    - - - - - + + + + + +exceptions_synchronous + + + +

    exceptions_synchronous

    +

    Set exception handling to use Microsoft-compatible exceptions. The default is off.

    +
    Syntax
    +

    #pragma exceptions_synchronous on | off | reset

    +
    Parameters
    +

    on

    +
    +

    Ignore C++ catch(...) blocks for Win32 exceptions when using Structured Exception Handling (SEH). For Microsoft-compatible mode only. Equivilent to #pragma exc sync.

    +
    +

    off

    +
    +

    Let C++ catch(...) blocks trap Win32 exceptions when using SEH. For Microsoft-compatible mode only. Equivilent to #pragma exc async. This is the default.

    +
    +
    Targets
    +

    Intel x86

    +

    NOTE To translate Win32 exceptions into C++ exceptions, use the routine set_se_translator() found in the header <eh.h>.

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_fill_stack.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_fill_stack.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_fill_stack.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,24 +1,24 @@ - - - - - -fill_stack - - - -

    fill_stack

    -

    Instructs the compiler to initialize locals to a fixed bit pattern (0xCC) upon entry to a function.

    -
    Syntax
    -

    #pragma fill_stack on | off | reset

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    Use of this pragma helps to diagnose program failures or crashes caused by the use of uninitialized variables. I.e., a bit pattern of 0xCC is not a normally-encountered integer or floating-point value, and 0xCCCCCCCC is almost never a valide pointer value. If the program counter does point to such a variable, it will be “executed” as an int3 breakpoint.

    -

    This pragma does not correspond to any panel setting. To check this setting, use the __option (fill_stack). The default setting for is off at optimization level 0.
    -

    - - - - - + + + + + +fill_stack + + + +

    fill_stack

    +

    Instructs the compiler to initialize locals to a fixed bit pattern (0xCC) upon entry to a function.

    +
    Syntax
    +

    #pragma fill_stack on | off | reset

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    Use of this pragma helps to diagnose program failures or crashes caused by the use of uninitialized variables. I.e., a bit pattern of 0xCC is not a normally-encountered integer or floating-point value, and 0xCCCCCCCC is almost never a valide pointer value. If the program counter does point to such a variable, it will be “executed” as an int3 breakpoint.

    +

    This pragma does not correspond to any panel setting. To check this setting, use the __option (fill_stack). The default setting for is off at optimization level 0.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_function.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_function.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_function.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,22 +1,22 @@ - - - - - -function - - - -

    function

    -

    Ignored but included for compatibility with Microsoft compilers.

    -
    Syntax
    -

    #pragma function( funcname1, funcname2, ... )

    -
    Targets
    - Intel x86
    -
    Remarks
    - Ignored. Included for compatibility with Microsoft compilers.
    - - - - - + + + + + +function + + + +

    function

    +

    Ignored but included for compatibility with Microsoft compilers.

    +
    Syntax
    +

    #pragma function( funcname1, funcname2, ... )

    +
    Targets
    + Intel x86
    +
    Remarks
    + Ignored. Included for compatibility with Microsoft compilers.
    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_ieeefp.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_ieeefp.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_ieeefp.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,39 +1,39 @@ - - - - - -ieeefp - - - -

    ieeefp

    -

    Controls whether floating point comparisons and some other optimizations are performed as per the IEEE standard. The default is off.

    -
    Syntax
    -

    #pragma ieeefp on | off

    -

    Parameters

    -

    on

    -
    -

    Floating-point comparisons are done using these conditions:

    - -
    -

    off

    -
    -

    Floating-point comparisons are done using IEEE standards.

    -
    -
    Targets
    - Intel x86
    -
    Remarks
    -

    Use #pragma ieeefp on to reduce floating-point accuracy and increase calculation speed. The same effect can be achieved in the command-line using -opt ieeefp or -fast_math off commands.

    -

    Use #pragma ieeefp off to maximize floating-point accuracy and decrease calculation speed. The same effect can be achieved in the command-line using -opt noieeefp or -fast_math on commands.

    -

    This pragma corresponds to the Relax IEEE floating point setting in the processor-specific CodeGen panel. To check this setting, use __option (ieeefp), described in Checking Settings. By default, this setting is on.
    -

    - - - - - + + + + + +ieeefp + + + +

    ieeefp

    +

    Controls whether floating point comparisons and some other optimizations are performed as per the IEEE standard. The default is off.

    +
    Syntax
    +

    #pragma ieeefp on | off

    +

    Parameters

    +

    on

    +
    +

    Floating-point comparisons are done using these conditions:

    + +
    +

    off

    +
    +

    Floating-point comparisons are done using IEEE standards.

    +
    +
    Targets
    + Intel x86
    +
    Remarks
    +

    Use #pragma ieeefp on to reduce floating-point accuracy and increase calculation speed. The same effect can be achieved in the command-line using -opt ieeefp or -fast_math off commands.

    +

    Use #pragma ieeefp off to maximize floating-point accuracy and decrease calculation speed. The same effect can be achieved in the command-line using -opt noieeefp or -fast_math on commands.

    +

    This pragma corresponds to the Relax IEEE floating point setting in the processor-specific CodeGen panel. To check this setting, use __option (ieeefp), described in Checking Settings. By default, this setting is on.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_init_seg.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_init_seg.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_init_seg.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,30 +1,30 @@ - - - - - -init_seg - - - -

    init_seg

    -

    Controls the order in which initialization code is executed.

    -
    Syntax
    -

    pragma init_seg( compiler | lib | user | "name")

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    This pragma controls the order in which initialization code is executed. The initialization code for a C++ compiled module calls constructors for any statically declared objects. For C, no initialization code is generated.

    -

    The order of initialization is:

    - -

    If you specify the name of a segment, a pointer to the initialization code is placed in the designated segment. In this case, the initialization code is not called automatically; you must call it explicitly.
    -

    - - - - - + + + + + +init_seg + + + +

    init_seg

    +

    Controls the order in which initialization code is executed.

    +
    Syntax
    +

    pragma init_seg( compiler | lib | user | "name")

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    This pragma controls the order in which initialization code is executed. The initialization code for a C++ compiled module calls constructors for any statically declared objects. For C, no initialization code is generated.

    +

    The order of initialization is:

    + +

    If you specify the name of a segment, a pointer to the initialization code is placed in the designated segment. In this case, the initialization code is not called automatically; you must call it explicitly.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_intrinsics_regabi.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_intrinsics_regabi.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_intrinsics_regabi.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,21 +1,21 @@ - - - - - -intrinsics_regabi - - - -

    intrinsics_regabi

    -

    Controls whether __m64 arguments and __m128{i,d,f} arguments are passed on the stack or via the MMX and SSE registers respectively. The default setting is off.

    -
    Syntax
    -

    #pragma intrinsics_regabi on | off | reset

    -
    Targets
    -

    Intel x86
    -

    - - - - - + + + + + +intrinsics_regabi + + + +

    intrinsics_regabi

    +

    Controls whether __m64 arguments and __m128{i,d,f} arguments are passed on the stack or via the MMX and SSE registers respectively. The default setting is off.

    +
    Syntax
    +

    #pragma intrinsics_regabi on | off | reset

    +
    Targets
    +

    Intel x86
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_k63d.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_k63d.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_k63d.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - -k63d - - - -

    k63d

    -

    Controls special code generation for AMD K6 3D extensions.

    -
    Syntax
    -

    #pragma k63d on | off | reset

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    This pragma tells the x86 compiler to generate code specifically for processors that have the circuitry needed to execute specialized 3D instructions, such as AMD K6 3D extensions.

    -

    NOTE When enabled, the autovectorize loops option (#pragma opt_vectorize_loops on) will use these instructions if possible.
    - This pragma corresponds to the K6 3D Favored setting in the Extended Instruction Set menu of the x86 CodeGen panel.

    -

    NOTE This pragma generates code that is not compatible with the Intel Pentium class of microprocessors.

    -

    To check this setting, use __option (k63d).
    -

    - - - - - + + + + + +k63d + + + +

    k63d

    +

    Controls special code generation for AMD K6 3D extensions.

    +
    Syntax
    +

    #pragma k63d on | off | reset

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    This pragma tells the x86 compiler to generate code specifically for processors that have the circuitry needed to execute specialized 3D instructions, such as AMD K6 3D extensions.

    +

    NOTE When enabled, the autovectorize loops option (#pragma opt_vectorize_loops on) will use these instructions if possible.
    + This pragma corresponds to the K6 3D Favored setting in the Extended Instruction Set menu of the x86 CodeGen panel.

    +

    NOTE This pragma generates code that is not compatible with the Intel Pentium class of microprocessors.

    +

    To check this setting, use __option (k63d).
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_line_trace.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_line_trace.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_line_trace.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,27 +1,27 @@ - - - - - -line_trace - - - -

    line_trace

    -

    Instructs the compiler to emit a call to an external function on each transition to a new source line.

    -
    Syntax
    -

    #pragma line_trace on | off | reset

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    Use this pragma to output a log of all executed source lines to enable you to track down difficult errors or act as a statement-level profiler on a line-by-line level.

    -

    To make line_trace work you need to write an external function to output the line information. The function should have this signature:

    -

    extern "C" void __stdcall _LineTrace( const char *function, int line );

    -

    and must save and restore any registers it uses. For example, pushad and popad work for saving and restoring integer registers.

    -

    To check this setting, use __option (line_trace). The default setting is off.
    -

    - - - - - + + + + + +line_trace + + + +

    line_trace

    +

    Instructs the compiler to emit a call to an external function on each transition to a new source line.

    +
    Syntax
    +

    #pragma line_trace on | off | reset

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    Use this pragma to output a log of all executed source lines to enable you to track down difficult errors or act as a statement-level profiler on a line-by-line level.

    +

    To make line_trace work you need to write an external function to output the line information. The function should have this signature:

    +

    extern "C" void __stdcall _LineTrace( const char *function, int line );

    +

    and must save and restore any registers it uses. For example, pushad and popad work for saving and restoring integer registers.

    +

    To check this setting, use __option (line_trace). The default setting is off.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_microsoft_exceptions.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_microsoft_exceptions.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_microsoft_exceptions.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,24 +1,24 @@ - - - - - -microsoft_exceptions - - - -

    microsoft_exceptions

    -

    Controls the use of Microsoft C++ exception handling.

    -
    Syntax
    -

    #pragma microsoft_exceptions on | off | reset

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    This pragma tells the x86 compiler to generate exception handling code that is compatible with Microsoft C++ exception handling code.

    -

    To check this setting, use __option (microsoft_exceptions).
    -

    - - - - - + + + + + +microsoft_exceptions + + + +

    microsoft_exceptions

    +

    Controls the use of Microsoft C++ exception handling.

    +
    Syntax
    +

    #pragma microsoft_exceptions on | off | reset

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    This pragma tells the x86 compiler to generate exception handling code that is compatible with Microsoft C++ exception handling code.

    +

    To check this setting, use __option (microsoft_exceptions).
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_mmcalls.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_mmcalls.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_mmcalls.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,25 +1,25 @@ - - - - - -mmcalls - - - -

    mmcalls

    -

    Instructs the compiler to optimize arithmetic and function calling code for use of MMX registers (AMD K6 + 3DNow! instruction set) or SSE registers (Intel SSE or SSE-2 instruction sets) when the related pragmas or options are enabled.

    -
    Syntax
    -

    #pragma mmcalls on | off | reset

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    This pragma corresponds to the Use multimedia calling convention setting in the the x86 CodeGen panel.

    -

    NOTE This pragma generates code that is not compatible with the Intel Pentium class of microprocessors.

    -

    To check this setting, use __option (mmcalls).
    -

    - - - - - + + + + + +mmcalls + + + +

    mmcalls

    +

    Instructs the compiler to optimize arithmetic and function calling code for use of MMX registers (AMD K6 + 3DNow! instruction set) or SSE registers (Intel SSE or SSE-2 instruction sets) when the related pragmas or options are enabled.

    +
    Syntax
    +

    #pragma mmcalls on | off | reset

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    This pragma corresponds to the Use multimedia calling convention setting in the the x86 CodeGen panel.

    +

    NOTE This pragma generates code that is not compatible with the Intel Pentium class of microprocessors.

    +

    To check this setting, use __option (mmcalls).
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_mmx.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_mmx.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_mmx.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,25 +1,25 @@ - - - - - -mmx - - - -

    mmx

    -

    Controls special code generation Intel MMX extensions.

    -
    Syntax
    -

    #pragma mmx on | off | reset

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    This pragma tells the x86 compiler to generate Intel MMX extension code that only runs on processors that have with the circuitry needed to execute the more than 50 specialized MMX instructions.

    -

    NOTE When enabled, the autovectorize loops option (#pragma opt_vectorize_loops on) will use these instructions if possible.

    -

    This pragma corresponds to the MMX setting in the Extended Instruction Set menu of the x86 CodeGen panel. To check this setting, use __option (mmx), described in Checking Settings.
    -

    - - - - - + + + + + +mmx + + + +

    mmx

    +

    Controls special code generation Intel MMX extensions.

    +
    Syntax
    +

    #pragma mmx on | off | reset

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    This pragma tells the x86 compiler to generate Intel MMX extension code that only runs on processors that have with the circuitry needed to execute the more than 50 specialized MMX instructions.

    +

    NOTE When enabled, the autovectorize loops option (#pragma opt_vectorize_loops on) will use these instructions if possible.

    +

    This pragma corresponds to the MMX setting in the Extended Instruction Set menu of the x86 CodeGen panel. To check this setting, use __option (mmx), described in Checking Settings.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_overlap_locals.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_overlap_locals.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_overlap_locals.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,25 +1,25 @@ - - - - - -overlap_locals - - - -

    overlap_locals

    -

    Instructs the compiler to analyze the lifetimes of variables on the stack and use the same storage location for variables with non-overlapping lifetimes.

    -
    Syntax
    -

    #pragma overlap_locals on | off | reset

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    The compiler can analyze the lifetime of variables on the stack, either those too large for register storage or those forced on the stack by register spilling, or being marked as volatile, and use the same storage location for variables with non-overlapping lifetimes.

    -

    This can dramatically reduce the stack size.

    -

    The default setting is on for optimization levels 2 and above.
    -

    - - - - - + + + + + +overlap_locals + + + +

    overlap_locals

    +

    Instructs the compiler to analyze the lifetimes of variables on the stack and use the same storage location for variables with non-overlapping lifetimes.

    +
    Syntax
    +

    #pragma overlap_locals on | off | reset

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    The compiler can analyze the lifetime of variables on the stack, either those too large for register storage or those forced on the stack by register spilling, or being marked as volatile, and use the same storage location for variables with non-overlapping lifetimes.

    +

    This can dramatically reduce the stack size.

    +

    The default setting is on for optimization levels 2 and above.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_pack.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_pack.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_pack.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,46 +1,46 @@ - - - - - -pack - - - -

    pack

    -

    Controls the alignment of data structures.

    -
    Syntax
    -

    #pragma pack( [n | push, n | pop] )

    -
    Targets
    - Intel x86, MIPS
    -
    Remarks
    -

    Sets the packing alignment for data structures. It affects all data structures declared after this pragma until you change it again with another pack pragma.

    - - - - - - - - - - - - - - - - - - - - - -
    This pragma…Does this…
    #pragma pack(n)Sets the alignment modulus to n, where n can be 1, 2, 4, 8, or 16. For MIPS compilers, if n is 0, structure alignment is reset to the default setting.
    #pragma pack(push, n)Pushes the current alignment modulus on a stack, then sets it to n, where n can be 1, 2, 4, 8, or 16. Use push and pop when you need a specific modulus for some declaration or set of declarations, but do not want to disturb the default setting. MIPS compilers do not support this form.
    #pragma pack(pop)Pops a previously pushed alignment modulus from the stack. MIPS compilers do not support this form.
    #pragma pack()For x86 compilers, resets alignment modulus to the value specified in the x86 CodeGen panel. For MIPS compilers, resets structure alignment to the default setting.
    -

    This pragma corresponds to the Byte Alignment setting in the x86 CodeGen panel.
    -

    - - - - - + + + + + +pack + + + +

    pack

    +

    Controls the alignment of data structures.

    +
    Syntax
    +

    #pragma pack( [n | push, n | pop] )

    +
    Targets
    + Intel x86, MIPS
    +
    Remarks
    +

    Sets the packing alignment for data structures. It affects all data structures declared after this pragma until you change it again with another pack pragma.

    + + + + + + + + + + + + + + + + + + + + + +
    This pragma…Does this…
    #pragma pack(n)Sets the alignment modulus to n, where n can be 1, 2, 4, 8, or 16. For MIPS compilers, if n is 0, structure alignment is reset to the default setting.
    #pragma pack(push, n)Pushes the current alignment modulus on a stack, then sets it to n, where n can be 1, 2, 4, 8, or 16. Use push and pop when you need a specific modulus for some declaration or set of declarations, but do not want to disturb the default setting. MIPS compilers do not support this form.
    #pragma pack(pop)Pops a previously pushed alignment modulus from the stack. MIPS compilers do not support this form.
    #pragma pack()For x86 compilers, resets alignment modulus to the value specified in the x86 CodeGen panel. For MIPS compilers, resets structure alignment to the default setting.
    +

    This pragma corresponds to the Byte Alignment setting in the x86 CodeGen panel.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_peephole.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_peephole.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_peephole.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,24 +1,24 @@ - - - - - -peephole - - - -

    peephole

    -

    Controls the use peephole optimization.

    -
    Syntax
    -

    #pragma peephole on | off | reset

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    If you enable this pragma, the compiler performs peephole optimizations, which are small, local optimizations that eliminate some compare instructions and improve branch sequences.

    -

    This pragma corresponds to the Peephole Optimizer setting in the PPC Processor panel. To check this setting, use __option (peephole). This settings is on at optimization level 1 and above.
    -

    - - - - - + + + + + +peephole + + + +

    peephole

    +

    Controls the use peephole optimization.

    +
    Syntax
    +

    #pragma peephole on | off | reset

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    If you enable this pragma, the compiler performs peephole optimizations, which are small, local optimizations that eliminate some compare instructions and improve branch sequences.

    +

    This pragma corresponds to the Peephole Optimizer setting in the PPC Processor panel. To check this setting, use __option (peephole). This settings is on at optimization level 1 and above.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_register_coloring.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_register_coloring.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_register_coloring.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,25 +1,25 @@ - - - - - -register_coloring - - - -

    register_coloring

    -

    Controls the use of register coloring.

    -
    Syntax
    -

    #pragma register_coloring on | off | reset

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    If you enable this pragma, the compiler uses a single register to hold the values of multiple variables that are never used in the same statement. This improves program performance.

    -

    TIP Disable this setting when debugging a program.

    -

    This pragma does not correspond to any panel setting. To check this setting, use __option (register_coloring). This settings is on at optimization level 2 and above
    -

    - - - - - + + + + + +register_coloring + + + +

    register_coloring

    +

    Controls the use of register coloring.

    +
    Syntax
    +

    #pragma register_coloring on | off | reset

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    If you enable this pragma, the compiler uses a single register to hold the values of multiple variables that are never used in the same statement. This improves program performance.

    +

    TIP Disable this setting when debugging a program.

    +

    This pragma does not correspond to any panel setting. To check this setting, use __option (register_coloring). This settings is on at optimization level 2 and above
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_scheduling.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_scheduling.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_scheduling.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,25 +1,25 @@ - - - - - -scheduling - - - -

    scheduling

    -

    Specifies the use of instruction scheduling optimization.

    -
    Syntax
    -

    #pragma scheduling on | off

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    This pragma lets you choose how the compiler rearranges instructions to increase speed. Some instructions, such as a memory load, take more than one processor cycle. By moving an unrelated instruction between the load and the instruction that uses the loaded item, the compiler saves a cycle when executing the program.

    -

    NOTE When enabled, the relationship between the source and object code is not guaranteed to be one-to-one. This may cause the “current source line” cursor to jump around unpredictably in editor windows showing the scheduled code. The worst of this can be avoided by enabling the Disable opimizations for debug setting in the x86 CodeGen panel.

    -

    This pragma correspondes to the x86 CodeGen panel setting.
    -

    - - - - - + + + + + +scheduling + + + +

    scheduling

    +

    Specifies the use of instruction scheduling optimization.

    +
    Syntax
    +

    #pragma scheduling on | off

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    This pragma lets you choose how the compiler rearranges instructions to increase speed. Some instructions, such as a memory load, take more than one processor cycle. By moving an unrelated instruction between the load and the instruction that uses the loaded item, the compiler saves a cycle when executing the program.

    +

    NOTE When enabled, the relationship between the source and object code is not guaranteed to be one-to-one. This may cause the “current source line” cursor to jump around unpredictably in editor windows showing the scheduled code. The worst of this can be avoided by enabling the Disable opimizations for debug setting in the x86 CodeGen panel.

    +

    This pragma correspondes to the x86 CodeGen panel setting.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_sse.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_sse.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_sse.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,24 +1,24 @@ - - - - - -sse - - - -

    sse

    -

    Controls the generation of SSE instructions for single-precision floating point operations.

    -
    Syntax
    -

    #pragma sse on | off | reset

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    NOTE When enabled, the autovectorize loops option (#pragma opt_vectorize_loops on) will use these instructions if possible.

    -

    This pragma corresponds to the Use extended instructions setting in the x86 CodeGen panel setting or #pragma use_extinst on. The default settings is off.
    -

    - - - - - + + + + + +sse + + + +

    sse

    +

    Controls the generation of SSE instructions for single-precision floating point operations.

    +
    Syntax
    +

    #pragma sse on | off | reset

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    NOTE When enabled, the autovectorize loops option (#pragma opt_vectorize_loops on) will use these instructions if possible.

    +

    This pragma corresponds to the Use extended instructions setting in the x86 CodeGen panel setting or #pragma use_extinst on. The default settings is off.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_sse2.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_sse2.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_sse2.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,24 +1,24 @@ - - - - - -sse2 - - - -

    sse2

    -

    Controls the generation of SSE-2 instructions for single and double-precision floating point and 16-byte integer vector operations.

    -
    Syntax
    -

    #pragma sse2 on | off | reset

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    NOTE When enabled, the autovectorize loops option (#pragma opt_vectorize_loops on) will use these instructions if possible.

    -

    This pragma corresponds to the Use extended instructions setting in the x86 CodeGen panel setting or #pragma use_extinst on. The default settings is off.
    -

    - - - - - + + + + + +sse2 + + + +

    sse2

    +

    Controls the generation of SSE-2 instructions for single and double-precision floating point and 16-byte integer vector operations.

    +
    Syntax
    +

    #pragma sse2 on | off | reset

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    NOTE When enabled, the autovectorize loops option (#pragma opt_vectorize_loops on) will use these instructions if possible.

    +

    This pragma corresponds to the Use extended instructions setting in the x86 CodeGen panel setting or #pragma use_extinst on. The default settings is off.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_stack_alignment.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_stack_alignment.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_stack_alignment.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,31 +1,31 @@ - - - - - -stack_alignment - - - -

    stack_alignment

    -

    Recommends the minimum stack alignment size based on a power of 2.

    -
    Syntax
    -

    #pragma stack_alignment( power )

    -
    Parameters
    -

    power

    -
    -

    Stack alignment value based on a power of 2.

    -
    -
    Targets
    - Intel x86
    -
    Remarks
    -

    By default, the global stack alignment is 4 as per the Win32 ABI. When doubles are accessed in a function, the alignment is bumped to 8 for that function. Spills of SSE registers (e.g. in autovectorized code or code using SSE intrinsics) bump alignment to 16 bytes.

    -

    Finally, the GCC-style __attribute__((aligned(xxx))) on a local variable declaration can be used to align specific variables, which in turn aligns the stack while use of #pragma disablopts off turns off stack alignment.

    -

    This pragma recommends a minimum alignment. When one of the above situations occurs, the actual alignment may be greater.
    - In some functions, in order to guarantee alignment, the EBX register is used as a surrogate local base pointer. This happens in functions which have indeterminate control flow (i.e., jump through a pointer), which are involved in exception handling, or which use alloca(). Use of EBX to access locals is not possible if Microsoft C++ exception handling is used in the function, so alignment is disabled for such functions. You can use #pragma warn_stack_alignment to check for such cases.
    -

    - - - - - + + + + + +stack_alignment + + + +

    stack_alignment

    +

    Recommends the minimum stack alignment size based on a power of 2.

    +
    Syntax
    +

    #pragma stack_alignment( power )

    +
    Parameters
    +

    power

    +
    +

    Stack alignment value based on a power of 2.

    +
    +
    Targets
    + Intel x86
    +
    Remarks
    +

    By default, the global stack alignment is 4 as per the Win32 ABI. When doubles are accessed in a function, the alignment is bumped to 8 for that function. Spills of SSE registers (e.g. in autovectorized code or code using SSE intrinsics) bump alignment to 16 bytes.

    +

    Finally, the GCC-style __attribute__((aligned(xxx))) on a local variable declaration can be used to align specific variables, which in turn aligns the stack while use of #pragma disablopts off turns off stack alignment.

    +

    This pragma recommends a minimum alignment. When one of the above situations occurs, the actual alignment may be greater.
    + In some functions, in order to guarantee alignment, the EBX register is used as a surrogate local base pointer. This happens in functions which have indeterminate control flow (i.e., jump through a pointer), which are involved in exception handling, or which use alloca(). Use of EBX to access locals is not possible if Microsoft C++ exception handling is used in the function, so alignment is disabled for such functions. You can use #pragma warn_stack_alignment to check for such cases.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_struct_reg_return.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_struct_reg_return.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_struct_reg_return.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,28 +1,28 @@ - - - - - -struct_reg_return - - - -

    struct_reg_return

    -

    Controls how small structs are returned from a function.

    -
    Syntax
    -

    #pragma struct_reg_return on | off | reset

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    structs are returned as follows:

    - -

    The default setting is on.
    -

    - - - - - + + + + + +struct_reg_return + + + +

    struct_reg_return

    +

    Controls how small structs are returned from a function.

    +
    Syntax
    +

    #pragma struct_reg_return on | off | reset

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    structs are returned as follows:

    + +

    The default setting is on.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_symbian.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_symbian.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_symbian.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,22 +1,22 @@ - - - - - -symbian - - - -

    symbian

    -

    Switch to maintain binary compatability with the 2.4.7 compiler. Implicitly enabled whenever mwccsym2 is run.

    -
    Syntax
    -

    #pragma symbian

    -
    Targets
    - Intel x86
    -
    Remarks
    - This pragma restores C++ name mangling, struct layout, struct/argument alignment, and bitfield layout semantics to that of the 2.4.7 compiler.
    - - - - - + + + + + +symbian + + + +

    symbian

    +

    Switch to maintain binary compatability with the 2.4.7 compiler. Implicitly enabled whenever mwccsym2 is run.

    +
    Syntax
    +

    #pragma symbian

    +
    Targets
    + Intel x86
    +
    Remarks
    + This pragma restores C++ name mangling, struct layout, struct/argument alignment, and bitfield layout semantics to that of the 2.4.7 compiler.
    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_ten_byte_long_double.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_ten_byte_long_double.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_ten_byte_long_double.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,25 +1,25 @@ - - - - - -ten_byte_long_double - - - -

    ten_byte_long_double

    -

    Changes the size of the long double to 80-bits (10 bytes) allowing the full precision and range of extended precision or temporary real format used in x86 floating point registers.

    -
    Syntax
    -

    #pragma ten_byte_long_double on | off | reset

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    The range is approximately 3.632^10-4932 to 1.190^10+4932.

    -

    Note there is no indication in the object code about what long double size was used to create it, thus the linker cannot warn on mismatches. To ensure a match, all libraries and programs exchanging long double must be rebuilt.

    -

    The default setting is off, where both long double and double are both 64-bits.
    -

    - - - - - + + + + + +ten_byte_long_double + + + +

    ten_byte_long_double

    +

    Changes the size of the long double to 80-bits (10 bytes) allowing the full precision and range of extended precision or temporary real format used in x86 floating point registers.

    +
    Syntax
    +

    #pragma ten_byte_long_double on | off | reset

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    The range is approximately 3.632^10-4932 to 1.190^10+4932.

    +

    Note there is no indication in the object code about what long double size was used to create it, thus the linker cannot warn on mismatches. To ensure a match, all libraries and programs exchanging long double must be rebuilt.

    +

    The default setting is off, where both long double and double are both 64-bits.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_use_cmov.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_use_cmov.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_use_cmov.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,24 +1,24 @@ - - - - - -use_cmov - - - -

    use_cmov

    -

    Instructs the compiler to use the CMOV instruction to perform conditional integer assignments.

    -
    Syntax
    -

    #pragma use_cmov on | off | reset

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    Use this pragma to reduce code size and improve speed in certain loops. This is only available for Pentium Pro, Athlon, and newer target processors.

    -

    The default setting is off.
    -

    - - - - - + + + + + +use_cmov + + + +

    use_cmov

    +

    Instructs the compiler to use the CMOV instruction to perform conditional integer assignments.

    +
    Syntax
    +

    #pragma use_cmov on | off | reset

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    Use this pragma to reduce code size and improve speed in certain loops. This is only available for Pentium Pro, Athlon, and newer target processors.

    +

    The default setting is off.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_use_extinst.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_use_extinst.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_use_extinst.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,25 +1,25 @@ - - - - - -use_extinst - - - -

    use_extinst

    -

    Controls the code generator’s use of processor-specific instructions.

    -
    Syntax
    -

    #pragma use_extinst on | off | reset

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    When off, all compiler generated code is targeted to run on a 486 processor with the exception of any inline assembly which may explicitly use newer instructions.

    -

    When on, the compiler uses instructions corresponding to the target processor whenever possible.

    -

    NOTE Some instruction subsets, like AMD 3DNow!, Intel’s MMX, and Intel’s SSE and SSE-2 instruction sets are generated only when additional options are activated.
    -

    - - - - - + + + + + +use_extinst + + + +

    use_extinst

    +

    Controls the code generator’s use of processor-specific instructions.

    +
    Syntax
    +

    #pragma use_extinst on | off | reset

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    When off, all compiler generated code is targeted to run on a 486 processor with the exception of any inline assembly which may explicitly use newer instructions.

    +

    When on, the compiler uses instructions corresponding to the target processor whenever possible.

    +

    NOTE Some instruction subsets, like AMD 3DNow!, Intel’s MMX, and Intel’s SSE and SSE-2 instruction sets are generated only when additional options are activated.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_use_fcmov.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_use_fcmov.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_use_fcmov.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,24 +1,24 @@ - - - - - -use_fcmov - - - -

    use_fcmov

    -

    Instructs the compiler to use the FCMOV instruction to perform conditional float assignments.

    -
    Syntax
    -

    #pragma use_fcmov on | off | reset

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    Use this pragma to reduce code size and improve speed in certain loops. This is only available for Pentium Pro, Athlon, and newer target processors.

    -

    The default setting is off.
    -

    - - - - - + + + + + +use_fcmov + + + +

    use_fcmov

    +

    Instructs the compiler to use the FCMOV instruction to perform conditional float assignments.

    +
    Syntax
    +

    #pragma use_fcmov on | off | reset

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    Use this pragma to reduce code size and improve speed in certain loops. This is only available for Pentium Pro, Athlon, and newer target processors.

    +

    The default setting is off.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_use_frame.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_use_frame.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_use_frame.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,24 +1,24 @@ - - - - - -use_frame - - - -

    use_frame

    -

    Controls the use of the BP register for stack frames.

    -
    Syntax
    -

    #pragma use_frame on | off | reset

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    If you enable this pragma, the compiler uses the BP register to point to the start of the stack frame.

    -

    To check this setting, use __option (use_frame), described in Checking Settings.
    -

    - - - - - + + + + + +use_frame + + + +

    use_frame

    +

    Controls the use of the BP register for stack frames.

    +
    Syntax
    +

    #pragma use_frame on | off | reset

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    If you enable this pragma, the compiler uses the BP register to point to the start of the stack frame.

    +

    To check this setting, use __option (use_frame), described in Checking Settings.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_volatile_asm.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_volatile_asm.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_volatile_asm.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,24 +1,24 @@ - - - - - -volatile_asm - - - -

    volatile_asm

    -

    Controls the compiler’s optimization of inline assembly

    -
    Syntax
    -

    #pragma volatile_asm on | off | reset

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    When on, the compiler allows these optimizations to occur inside inline assembly code: peepholing, scheduling, and constant propagation.

    -

    This settting is controls by the Optimize inline assembly setting in the CodeGen panel. The default setting is off.
    -

    - - - - - + + + + + +volatile_asm + + + +

    volatile_asm

    +

    Controls the compiler’s optimization of inline assembly

    +
    Syntax
    +

    #pragma volatile_asm on | off | reset

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    When on, the compiler allows these optimizations to occur inside inline assembly code: peepholing, scheduling, and constant propagation.

    +

    This settting is controls by the Optimize inline assembly setting in the CodeGen panel. The default setting is off.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_warn_illegal_instructions.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_warn_illegal_instructions.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_warn_illegal_instructions.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,24 +1,24 @@ - - - - - -warn_illegal_instructions - - - -

    warn_illegal_instructions

    -

    Controls the recognition of assembly instructions not available to an Intel x86 processor.

    -
    Syntax
    -

    #pragma warn_illegal_instructions on | off | reset

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    If you enable this pragma, the compiler displays a warning when it encounters an assembly language instruction that is not available on the Intel x86 processor for which the compiler is generating object code.

    -

    To check this setting, use __option (warn_illegal_instructions), described in Checking Settings.
    -

    - - - - - + + + + + +warn_illegal_instructions + + + +

    warn_illegal_instructions

    +

    Controls the recognition of assembly instructions not available to an Intel x86 processor.

    +
    Syntax
    +

    #pragma warn_illegal_instructions on | off | reset

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    If you enable this pragma, the compiler displays a warning when it encounters an assembly language instruction that is not available on the Intel x86 processor for which the compiler is generating object code.

    +

    To check this setting, use __option (warn_illegal_instructions), described in Checking Settings.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_x86_processor.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_x86_processor.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/p_x86_processor.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,86 +1,86 @@ - - - - - -x86_processor - - - -

    x86_processor

    -

    Specifies the scheduling model used for instruction scheduling optimization.

    -
    Syntax
    -

    #pragma x86_processor generic | pentium | pentiumpro | pentiumII | pentiumIII | pentiumIV | k6 | k7 | athlon | athlonIV | AthlonXP

    -
    Targets
    - Intel x86
    -
    Remarks
    -

    The processor options include:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    This option…ValueDoes this…
    generic
    500
    Generic x86 instructions. This is the default.
    pentium
    500
    Use Pentium instruction set.
    pentiumpro
    600
    Use Pentium Pro instruction set.
    pentiumII
    650
    Use Pentium II instruction set.
    pentiumIII
    655
    Use Pentium III instruction set.
    pentiumIV
    660
    Use Pentium IV instruction set.
    k6
    550
    Use AMD K6 instruction set.
    k7
    700
    Use AMD K7 instruction set.
    athlon
    700
    Use Athlon instruction set.
    athlonIV
    700
     
    athlonXP
    700
    Use Athlon XP instruction set.
    -

    You can test for a specific processor using the _M_IX86 macro using the values shown in Table 11.3.
    -

    - - - - - + + + + + +x86_processor + + + +

    x86_processor

    +

    Specifies the scheduling model used for instruction scheduling optimization.

    +
    Syntax
    +

    #pragma x86_processor generic | pentium | pentiumpro | pentiumII | pentiumIII | pentiumIV | k6 | k7 | athlon | athlonIV | AthlonXP

    +
    Targets
    + Intel x86
    +
    Remarks
    +

    The processor options include:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    This option…ValueDoes this…
    generic
    500
    Generic x86 instructions. This is the default.
    pentium
    500
    Use Pentium instruction set.
    pentiumpro
    600
    Use Pentium Pro instruction set.
    pentiumII
    650
    Use Pentium II instruction set.
    pentiumIII
    655
    Use Pentium III instruction set.
    pentiumIV
    660
    Use Pentium IV instruction set.
    k6
    550
    Use AMD K6 instruction set.
    k7
    700
    Use AMD K7 instruction set.
    athlon
    700
    Use Athlon instruction set.
    athlonIV
    700
     
    athlonXP
    700
    Use Athlon XP instruction set.
    +

    You can test for a specific processor using the _M_IX86 macro using the values shown in Table 11.3.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/pragmas_x86.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/pragmas_x86.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/pragmas_x86.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,26 +1,26 @@ - - - - - -Intel x86 Pragmas - - - -

    Intel x86 Pragmas

    -

    This section provides information on Intel x86 specific pragmas. You configure the compiler for a project by changing the settings in the <Target> CodeGen panel. You can also control compiler behavior in your code by including the appropriate pragmas. -

    -

    Many of the pragmas correspond to option settings in the settings panels for processors and operating systems. Topics include: -

    - -

    NOTE See your target documentation for information on any pragmas you use in your programs. If your target documentation covers any of the pragmas listed in this section, the information provided by your target documentation always takes precedence.
    -

    - - - - - + + + + + +Intel x86 Pragmas + + + +

    Intel x86 Pragmas

    +

    This section provides information on Intel x86 specific pragmas. You configure the compiler for a project by changing the settings in the <Target> CodeGen panel. You can also control compiler behavior in your code by including the appropriate pragmas. +

    +

    Many of the pragmas correspond to option settings in the settings panels for processors and operating systems. Topics include: +

    + +

    NOTE See your target documentation for information on any pragmas you use in your programs. If your target documentation covers any of the pragmas listed in this section, the information provided by your target documentation always takes precedence.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/pragmas_x86_ref.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/pragmas_x86_ref.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/pragmas_x86/pragmas_x86_ref.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,18 +1,18 @@ - - - - - -x86 Pragma Reference - - - -

    x86 Pragma Reference

    -

    The following pragmas apply to the x86 compiler:

    -


    -

    - - - - - + + + + + +x86 Pragma Reference + + + +

    x86 Pragma Reference

    +

    The following pragmas apply to the x86 compiler:

    +


    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/symbols/sym_ansi.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/symbols/sym_ansi.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/symbols/sym_ansi.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,66 +1,66 @@ - - - - - -ANSI Predefined Symbols - - - -

    ANSI Predefined Symbols

    -

    Table 1 lists the symbols required by the ANSI/ISO C standard.

    -
    Table 1. ANSI Predefined Symbols
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    This symbol…is…
    __DATE__The date the file is compiled; for example, "Jul 14, 1995". This symbol is a predefined macro.
    __FILE__The name of the file being compiled; for example "prog.c". This symbol is a predefined macro.
    __func__The name of the function currently being compiled. This predefined identifier is only available under the emerging ANSI/ISO C99 standard.
    __LINE__The number of the line being compiled (before including any header files). This symbol is a predefined macro.
    __TIME__The time the file is compiled in 24-hour format; for example, "13:01:45". This symbol is a predefined macro.
    __STDC__Defined as 1 if compiling C source code; undefined when compiling C++ source code. This macro lets you know that Carbide C implements the ANSI C standard.
    -
    -
    Listing 1 shows a small program that uses the ANSI predefined symbols.
    -

    Listing 1. Using ANSI Predefined Symbols
    - #include <stdio.h>

    -

    void main(void)
    - {
    - printf("Hello World!\n");
    -
    - printf("%s, %s\n", __DATE__, __TIME__);
    - printf("%s, line: %d\n", __FILE__, __LINE__);
    - }

    -

    /* The program prints something like the following:
    - Hello World!
    - Oct 31 2005, 18:53:50
    - main.ANSI.c, line: 10
    - */
    -

    -
    -

    - - - - - + + + + + +ANSI Predefined Symbols + + + +

    ANSI Predefined Symbols

    +

    Table 1 lists the symbols required by the ANSI/ISO C standard.

    +
    Table 1. ANSI Predefined Symbols
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    This symbol…is…
    __DATE__The date the file is compiled; for example, "Jul 14, 1995". This symbol is a predefined macro.
    __FILE__The name of the file being compiled; for example "prog.c". This symbol is a predefined macro.
    __func__The name of the function currently being compiled. This predefined identifier is only available under the emerging ANSI/ISO C99 standard.
    __LINE__The number of the line being compiled (before including any header files). This symbol is a predefined macro.
    __TIME__The time the file is compiled in 24-hour format; for example, "13:01:45". This symbol is a predefined macro.
    __STDC__Defined as 1 if compiling C source code; undefined when compiling C++ source code. This macro lets you know that Carbide C implements the ANSI C standard.
    +
    +
    Listing 1 shows a small program that uses the ANSI predefined symbols.
    +

    Listing 1. Using ANSI Predefined Symbols
    + #include <stdio.h>

    +

    void main(void)
    + {
    + printf("Hello World!\n");
    +
    + printf("%s, %s\n", __DATE__, __TIME__);
    + printf("%s, line: %d\n", __FILE__, __LINE__);
    + }

    +

    /* The program prints something like the following:
    + Hello World!
    + Oct 31 2005, 18:53:50
    + main.ANSI.c, line: 10
    + */
    +

    +
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/symbols/sym_carbide.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/symbols/sym_carbide.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/symbols/sym_carbide.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,129 +1,129 @@ - - - - - -Carbide.c++ Predefined Symbols - - - - -

    Carbide.c++ Predefined Symbols

    -

    Table 1 lists additional symbols provided by Carbide C/C++ but not defined as part of the ANSI/ISO C/C++ standards.

    -

    NOTE The Carbide C compiler was formerly known as the Metrowerks C compiler. For Symbian development, only the x86 based features are supported. All references to other processor architectures are for historical purposes only.

    -
    Table 1. Predefined Symbols for Carbide C/C++ compilers
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    This symbol…is…
    __A5__ Defined as 1 if data is A5-relative, 0 if data is A4-relative. This symbol is defined for 68K compilers and undefined for other target platforms.
    __ALTIVEC__Currently defined as 100000000 when you enable PowerPC AltiVec™ features using pragma altivec_model.
    __cplusplusDefined as 199711L if you are compiling this file as a C++ file; undefined if you are compiling this file as a C file. The value 199711L indicates conformance with the ANSI/ISO C++ specification.
    __EMU_SYMBIAN_OS__Defined as 1 .
    __embedded_cplusplus Defined as 1 if EC++ is activated; undefined if EC++ is not activated.
    __embedded__Defined as 1 if you are compiling code for an embedded target.
    __FUNCTION__Defined by the compiler as the name of the function currently being compiled. This symbol is a predefined identifier for GCC compatibility.
    __fourbyteints__Defined as 1 if you enable the 4-byte Ints setting in the 68K Processor panel; 0 if you disable that setting. This symbol is defined for 68K compilers and undefined for other platforms.
    __ide_target("target_name")Returns 1 if target_name is the same as the active build target in the Carbide IDE’s active project. Returns 0 otherwise.
    __IEEEdoubles__Defined as 1 if you enable the 8-Byte Doubles setting in the 68K Processor panel; 0 if you disable that setting. This symbol is defined for 68K compilers and undefined for all other target platforms.
    __INTEL__Defined as 1 if you are compiling this code with the x86 compiler; undefined for all other target platforms.
    __MC68K__Defined as 1 if you are compiling this code with the 68K compiler; undefined for all other target platforms.
    __MC68020__Defined as 1 if you enable the 68020 Codegen setting in the Processor panel; 0 if you disable it. This symbol is defined for 68K compilers and undefined for all other target platforms.
    __MC68881__Defined as 1 if you enable the 68881 Codegen setting in the 68K Processor panel; 0 if you disable it. This symbol is defined for 68K compilers and undefined for all other target platforms.
    __MIPS__Defined as 1 for MIPS compilers; undefined for other target platforms.
    __MIPS_ISA2__Defined as 1 if the compiler’s target platform is MIPS and you select the ISA II checkbox in the MIPS Processor panel. Undefined if you deselect the ISA II checkbox. It is always undefined for other target platforms.
    __MIPS_ISA3__Defined as 1 if the compiler’s target platform is MIPS and you select the ISA III checkbox in the MIPS Processor panel. Undefined if you deselect the ISA III checkbox. It is always undefined for other target platforms.
    __MIPS_ISA4__Defined as 1 if the compiler’s target platform is MIPS and you select the ISA IV checkbox in the MIPS Processor panel. Undefined if you deselect the ISA IV checkbox. It is always undefined for other target platforms.
    __MWBROWSER__Defined as 1 if the Carbide browser is parsing your code; 0 if not.
    __MWERKS__Defined as the version number of the Carbide C/C++ compiler. For example, with the Carbide C/C++ compiler version 2.2, the value of __MWERKS__ is 0x2200. This macro is defined as 1 if the compiler was released in 1995 or earlier.
    __PRETTY_FUNCTION__Defined by the compiler as the name of the qualified (“unmangled”) C++ function currently being compiled. This predefined identifier is only defined when the C++ compiler is active. See C++ Compiler for related information.
    __profile__Defined as 1 if you enable the Generate Profiler Calls setting in the Processor panel; 0 if you disable it.
    __POWERPC__Defined as 1 if you are compiling this code with the PowerPC compiler; 0 if not.
    __VEC__Defined as the version of Motorola’s AltiVec ™ Technology Programming Interface Manual to which the compiler conforms. This value takes the form vrrnn which corresponds to the version number (v.rr.nn) of the Programming Interface Manual. Otherwise, this macro is undefined.
    macintoshDefined as 1 if you are compiling this code with the 68K or PowerPC compilers for Mac OS; 0 if not.
    - - - - - + + + + + +Carbide.c++ Predefined Symbols + + + + +

    Carbide.c++ Predefined Symbols

    +

    Table 1 lists additional symbols provided by Carbide C/C++ but not defined as part of the ANSI/ISO C/C++ standards.

    +

    NOTE The Carbide C compiler was formerly known as the Metrowerks C compiler. For Symbian development, only the x86 based features are supported. All references to other processor architectures are for historical purposes only.

    +
    Table 1. Predefined Symbols for Carbide C/C++ compilers
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    This symbol…is…
    __A5__ Defined as 1 if data is A5-relative, 0 if data is A4-relative. This symbol is defined for 68K compilers and undefined for other target platforms.
    __ALTIVEC__Currently defined as 100000000 when you enable PowerPC AltiVec™ features using pragma altivec_model.
    __cplusplusDefined as 199711L if you are compiling this file as a C++ file; undefined if you are compiling this file as a C file. The value 199711L indicates conformance with the ANSI/ISO C++ specification.
    __EMU_SYMBIAN_OS__Defined as 1 .
    __embedded_cplusplus Defined as 1 if EC++ is activated; undefined if EC++ is not activated.
    __embedded__Defined as 1 if you are compiling code for an embedded target.
    __FUNCTION__Defined by the compiler as the name of the function currently being compiled. This symbol is a predefined identifier for GCC compatibility.
    __fourbyteints__Defined as 1 if you enable the 4-byte Ints setting in the 68K Processor panel; 0 if you disable that setting. This symbol is defined for 68K compilers and undefined for other platforms.
    __ide_target("target_name")Returns 1 if target_name is the same as the active build target in the Carbide IDE’s active project. Returns 0 otherwise.
    __IEEEdoubles__Defined as 1 if you enable the 8-Byte Doubles setting in the 68K Processor panel; 0 if you disable that setting. This symbol is defined for 68K compilers and undefined for all other target platforms.
    __INTEL__Defined as 1 if you are compiling this code with the x86 compiler; undefined for all other target platforms.
    __MC68K__Defined as 1 if you are compiling this code with the 68K compiler; undefined for all other target platforms.
    __MC68020__Defined as 1 if you enable the 68020 Codegen setting in the Processor panel; 0 if you disable it. This symbol is defined for 68K compilers and undefined for all other target platforms.
    __MC68881__Defined as 1 if you enable the 68881 Codegen setting in the 68K Processor panel; 0 if you disable it. This symbol is defined for 68K compilers and undefined for all other target platforms.
    __MIPS__Defined as 1 for MIPS compilers; undefined for other target platforms.
    __MIPS_ISA2__Defined as 1 if the compiler’s target platform is MIPS and you select the ISA II checkbox in the MIPS Processor panel. Undefined if you deselect the ISA II checkbox. It is always undefined for other target platforms.
    __MIPS_ISA3__Defined as 1 if the compiler’s target platform is MIPS and you select the ISA III checkbox in the MIPS Processor panel. Undefined if you deselect the ISA III checkbox. It is always undefined for other target platforms.
    __MIPS_ISA4__Defined as 1 if the compiler’s target platform is MIPS and you select the ISA IV checkbox in the MIPS Processor panel. Undefined if you deselect the ISA IV checkbox. It is always undefined for other target platforms.
    __MWBROWSER__Defined as 1 if the Carbide browser is parsing your code; 0 if not.
    __MWERKS__Defined as the version number of the Carbide C/C++ compiler. For example, with the Carbide C/C++ compiler version 2.2, the value of __MWERKS__ is 0x2200. This macro is defined as 1 if the compiler was released in 1995 or earlier.
    __PRETTY_FUNCTION__Defined by the compiler as the name of the qualified (“unmangled”) C++ function currently being compiled. This predefined identifier is only defined when the C++ compiler is active. See C++ Compiler for related information.
    __profile__Defined as 1 if you enable the Generate Profiler Calls setting in the Processor panel; 0 if you disable it.
    __POWERPC__Defined as 1 if you are compiling this code with the PowerPC compiler; 0 if not.
    __VEC__Defined as the version of Motorola’s AltiVec ™ Technology Programming Interface Manual to which the compiler conforms. This value takes the form vrrnn which corresponds to the version number (v.rr.nn) of the Programming Interface Manual. Otherwise, this macro is undefined.
    macintoshDefined as 1 if you are compiling this code with the 68K or PowerPC compilers for Mac OS; 0 if not.
    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/symbols/sym_settings.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/symbols/sym_settings.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/symbols/sym_settings.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,643 +1,643 @@ - - - - - -Checking Settings - - - -

    Checking Settings

    -

    The preprocessor function __option() lets you check pragmas and other settings that control the C/C++ compiler and code generation. You typically modify these settings using various panels in the Project Settings window.

    -

    The syntax for this preprocessor function is as follows:

    -

    __option(setting-name)

    -

    If the specified setting is enabled, __option() returns 1; otherwise it returns 0.

    -

    To determine if a setting-name is invalid, see Warnings as Errors.

    -

    Use this function when you want one source file to contain code that uses different settings. The example below shows how to compile one series of lines if you are compiling for machines with the MC68881 floating-point unit and another series if you are compiling for machines without it:

    -

    #if __option (code68881) // Code for 68K chip with FPU
    - #else
    - // Code for any 68K processor
    - #endif

    -

    Table 1 lists all the setting names you can use in the preprocessor function __option().

    -
    Table 1. Preprocessor Setting Names for __option()
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    This argument...Corresponds to the…
    a6framesPragma a6frames.
    align_array_membersPragma align_array_members.
    altivec_codegenPragma altivec_codegen.
    altivec_modelPragma altivec_model.
    altivec_vrsavePragma altivec_vrsave.
    always_inlinePragma always_inline.
    ANSI_strictANSI Strict setting and pragma ANSI_strict.
    arg_dep_lookupPragma arg_dep_lookup.
    ARM_conformPragma ARM_conform.
    array_new_deletePragma array_new_delete
    auto_inlineAuto-Inline setting of the Inlining menu and pragma auto_inline.
    boolEnable bool Support setting and pragma bool.
    check_header_flagsPragma check_header_flags.
    code68020Pragma code68020.
    code68881Pragma code68881.
    const_multiplyPragma const_multiply.
    const_stringsPragma const_strings.
    cplusplusForce C++ Compilation setting , the pragma cplusplus, and the macro cplusplus. Indicates whether the compiler is compiling this file as a C++ file.
    cpp_extensionsPragma cpp_extensions.
    d0_pointersPragmas pointers_in_D0 and pointers_in_A0.
    def_inheritedPragma def_inherited.
    defer_codegenPragma defer_codegen.
    defer_defarg_parsingPragma defer_defarg_parsing
    direct_destructionNo longer available
    direct_to_SOMPragma direct_to_SOM.
    disable_registersPragma disable_registers.
    dollar_identifiersPragma dollar_identifiers.
    dont_inlineDon’t Inline setting and pragma dont_inline.
    dont_reuse_stringsReuse Strings setting and pragma dont_reuse_strings.
    ecplusplusPragma ecplusplus.
    EIPC_EIPSWPragma EIPC_EIPSW.
    enumsalwaysintEnums Always Int setting and pragma enumsalwaysint.
    exceptionsEnable C++ Exceptions setting and pragma exceptions.
    exportPragma export.
    extended_errorcheckExtended Error Checking setting and pragma extended_errorcheck.
    far_dataPragma far_data.
    far_stringsPragma far_strings.
    far_vtablesPragma far_vtables.
    faster_pch_genPragma faster_pch_gen.
    float_constantsPragma float_constants.
    force_activePragma force_active.
    fourbyteintsPragma fourbyteints.
    fp_contractPragma fp_contract.
    fullpath_prepdumpPragma fullpath_prepdump.
    function_alignPragma function_align.
    gcc_extensionsPragma gcc_extensions.
    IEEEdoublesPragma IEEEdoubles.
    ignore_oldstylePragma ignore_oldstyle.
    importPragma import.
    inline_bottom_upPragma inline_bottom_up.
    inline_bottom_up_oncePragma inline_bottom_up_once
    inline_intrinsicsPragma inline_intrinsics.
    inline_max_auto_sizePragma inline_max_auto_size
    inline_max_sizePragma inline_max_size
    inline_max_total_sizePragma inline_max_total_size
    internalPragma internal.
    interruptPragma interrupt.
    k63dK6 3D Favored setting in the Extended Instruction Set menu of the x86 CodeGen panel and pragma k63d.
    k63d_calls MMX + K6 3D setting in the Extended Instruction Set menu of the x86 CodeGen panel and pragma k63d_calls.
    lib_exportPragma lib_export.
    line_prepdumpPragma line_prepdump.
    little_endianNo option. Defined as 1 if you are compiling for a little endian target (such as x86); 0 if you are compiling for a big endian target (such as PowerPC).
    longlongPragma longlong.
    longlong_enumsPragma longlong_enums.
    longlong_prepevalPragma longlong_prepeval.
    macsbugPragma macsbug.
    max_errorsPragma max_errors
    microsoft_exceptionsPragma microsoft_exceptions.
    microsoft_RTTIPragma microsoft_RTTI.
    mmxMMX setting in the Extended Instruction Set menu of the x86 CodeGen panel and pragma mmx.
    mmx_callPragma mmx_call.
    mpwcPragma mpwc.
    mpwc_newlinePragma mpwc_newline.
    mpwc_relaxPragma mpwc_relax.
    msg_show_linerefPragma msg_show_lineref
    msg_show_realrefPragma msg_show_realref
    multibyteaware_ preserve_literalsPragma multibyteaware_ -preserve_literals
    no_conststringconvPragma no_conststringconv
    no_register_coloringPragma no_register_coloring.
    no_static_dtorsPragma no_static_dtors.
    no_conststringconvPragma no_conststringconv
    oldstyle_symbolsPragma oldstyle_symbols.
    only_std_keywordsANSI Keywords Only setting and pragma only_std_keywords.
    opt_classresultsPragma opt_classresults
    opt_common_subsPragma opt_common_subs.
    opt_dead_assignmentsPragma opt_dead_assignments.
    opt_dead_codePragma opt_dead_code.
    opt_lifetimesPragma opt_lifetimes.
    opt_loop_invariantsPragma opt_loop_invariants.
    opt_propagationPragma opt_propagation.
    opt_strength_reductionPragma opt_strength_reduction.
    opt_strength_reduction_strictPragma opt_strength_reduction_strict.
    opt_unroll_loopsPragma opt_unroll_loops.
    opt_vectorize_loopsPragma opt_vectorize_loops.
    optimize_for_sizePragma optimize_for_size.
    optimizewithasmPragma optimizewithasm.
    pool_dataPragma pool_data.
    pool_stringsPool Strings setting and pragma pool_strings.
    ppc_unroll_speculativePragma ppc_unroll_speculative.
    precompileWhether or not the file is precompiled.
    preprocessWhether or not the file is preprocessed.
    profilePragma profile.
    readonly_stringsPragma readonly_strings.
    register_coloringPragma register_coloring.
    require_prototypesRequire Function Prototypes setting and pragma require_prototypes.
    RTTIEnable RTTI setting and pragma RTTI.
    showmessagenumberPragma showmessagenumber
    side_effectsPragma side_effects.
    simple_prepdumpPragma simple_prepdump.
    SOMCallOptimizationPragma SOMCallOptimization.
    SOMCheckEnvironmentPragma SOMCheckEnvironment.
    stack_cleanupPragma stack_cleanup.
    suppress_init_codePragma suppress_init_code.
    suppress_warningsPragma suppress_warnings.
    symMarker in the project window debug column and pragma sym.
    syspath_oncePragma syspath_once.
    text_encodingPragma text_encoding
    toc_dataPragma toc_data.
    tracebackPragma traceback.
    trigraphsExpand Trigraphs setting and pragma trigraphs.
    unsigned_charUse Unsigned Chars setting and pragma unsigned_char.
    use_fp_instructionsPragma use_fp_instructions.
    use_framePragma use_frame.
    use_mask_registersPragma use_mask_registers.
    warningPragma warning
    warn_any_ptr_int_convPragma warn_any_ptr_int_conv
    warn_emptydeclEmpty Declarations setting and pragma warn_emptydecl.
    warn_extracommaExtra Commas setting and pragma warn_extracomma.
    warn_hiddenlocalsPragma warn_hiddenlocals
    warn_hidevirtualHidden virtual functions setting and pragma warn_hidevirtual.
    warn_illegal_instructions Pragma warn_illegal_instructions.
    warn_illpragmaIllegal Pragmas setting and pragma warn_illpragma.
    warn_illtokenpastingPragma warn_illtokenpasting
    warn_illunionmembersPragma warn_illunionmembers
    warn_impl_f2i_convPragma warn_impl_f2i_conv.
    warn_impl_i2f_convPragma warn_impl_i2f_conv.
    warn_impl_s2u_convPragma warn_impl_s2u_conv.
    warn_implicitconvImplicit Arithmetic Conversions setting and pragma warn_implicitconv.
    warn_missingreturnPragma warn_missingreturn
    warn_no_explicit_virtualPragma warn_no_explicit_virtual
    warn_no_side_effectpragma warn_no_side_effect.
    warn_notinlinedNon-Inlined Functions setting and pragma warn_notinlined.
    warn_paddingpragma warn_padding.
    warn_possunwantPossible Errors setting and pragma warn_possunwant.
    warn_ptr_int_convpragma warn_ptr_int_conv.
    warn_resultnotusedpragma warn_resultnotused.
    warn_structclassInconsistent ‘class’ / ‘struct’ Usage setting and pragma warn_structclass.
    warn_undefmacropragma warn_undefmacro
    warn_unusedargUnused Arguments setting and pragma warn_unusedarg.
    warn_unusedvarUnused Variables setting and pragma warn_unusedvar.
    warning_errorsTreat Warnings As Errors setting and pragma warning_errors.
    wchar_typeEnable wchar_t Support setting and pragma wchar_type.
    -

    - - - - - + + + + + +Checking Settings + + + +

    Checking Settings

    +

    The preprocessor function __option() lets you check pragmas and other settings that control the C/C++ compiler and code generation. You typically modify these settings using various panels in the Project Settings window.

    +

    The syntax for this preprocessor function is as follows:

    +

    __option(setting-name)

    +

    If the specified setting is enabled, __option() returns 1; otherwise it returns 0.

    +

    To determine if a setting-name is invalid, see Warnings as Errors.

    +

    Use this function when you want one source file to contain code that uses different settings. The example below shows how to compile one series of lines if you are compiling for machines with the MC68881 floating-point unit and another series if you are compiling for machines without it:

    +

    #if __option (code68881) // Code for 68K chip with FPU
    + #else
    + // Code for any 68K processor
    + #endif

    +

    Table 1 lists all the setting names you can use in the preprocessor function __option().

    +
    Table 1. Preprocessor Setting Names for __option()
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    This argument...Corresponds to the…
    a6framesPragma a6frames.
    align_array_membersPragma align_array_members.
    altivec_codegenPragma altivec_codegen.
    altivec_modelPragma altivec_model.
    altivec_vrsavePragma altivec_vrsave.
    always_inlinePragma always_inline.
    ANSI_strictANSI Strict setting and pragma ANSI_strict.
    arg_dep_lookupPragma arg_dep_lookup.
    ARM_conformPragma ARM_conform.
    array_new_deletePragma array_new_delete
    auto_inlineAuto-Inline setting of the Inlining menu and pragma auto_inline.
    boolEnable bool Support setting and pragma bool.
    check_header_flagsPragma check_header_flags.
    code68020Pragma code68020.
    code68881Pragma code68881.
    const_multiplyPragma const_multiply.
    const_stringsPragma const_strings.
    cplusplusForce C++ Compilation setting , the pragma cplusplus, and the macro cplusplus. Indicates whether the compiler is compiling this file as a C++ file.
    cpp_extensionsPragma cpp_extensions.
    d0_pointersPragmas pointers_in_D0 and pointers_in_A0.
    def_inheritedPragma def_inherited.
    defer_codegenPragma defer_codegen.
    defer_defarg_parsingPragma defer_defarg_parsing
    direct_destructionNo longer available
    direct_to_SOMPragma direct_to_SOM.
    disable_registersPragma disable_registers.
    dollar_identifiersPragma dollar_identifiers.
    dont_inlineDon’t Inline setting and pragma dont_inline.
    dont_reuse_stringsReuse Strings setting and pragma dont_reuse_strings.
    ecplusplusPragma ecplusplus.
    EIPC_EIPSWPragma EIPC_EIPSW.
    enumsalwaysintEnums Always Int setting and pragma enumsalwaysint.
    exceptionsEnable C++ Exceptions setting and pragma exceptions.
    exportPragma export.
    extended_errorcheckExtended Error Checking setting and pragma extended_errorcheck.
    far_dataPragma far_data.
    far_stringsPragma far_strings.
    far_vtablesPragma far_vtables.
    faster_pch_genPragma faster_pch_gen.
    float_constantsPragma float_constants.
    force_activePragma force_active.
    fourbyteintsPragma fourbyteints.
    fp_contractPragma fp_contract.
    fullpath_prepdumpPragma fullpath_prepdump.
    function_alignPragma function_align.
    gcc_extensionsPragma gcc_extensions.
    IEEEdoublesPragma IEEEdoubles.
    ignore_oldstylePragma ignore_oldstyle.
    importPragma import.
    inline_bottom_upPragma inline_bottom_up.
    inline_bottom_up_oncePragma inline_bottom_up_once
    inline_intrinsicsPragma inline_intrinsics.
    inline_max_auto_sizePragma inline_max_auto_size
    inline_max_sizePragma inline_max_size
    inline_max_total_sizePragma inline_max_total_size
    internalPragma internal.
    interruptPragma interrupt.
    k63dK6 3D Favored setting in the Extended Instruction Set menu of the x86 CodeGen panel and pragma k63d.
    k63d_calls MMX + K6 3D setting in the Extended Instruction Set menu of the x86 CodeGen panel and pragma k63d_calls.
    lib_exportPragma lib_export.
    line_prepdumpPragma line_prepdump.
    little_endianNo option. Defined as 1 if you are compiling for a little endian target (such as x86); 0 if you are compiling for a big endian target (such as PowerPC).
    longlongPragma longlong.
    longlong_enumsPragma longlong_enums.
    longlong_prepevalPragma longlong_prepeval.
    macsbugPragma macsbug.
    max_errorsPragma max_errors
    microsoft_exceptionsPragma microsoft_exceptions.
    microsoft_RTTIPragma microsoft_RTTI.
    mmxMMX setting in the Extended Instruction Set menu of the x86 CodeGen panel and pragma mmx.
    mmx_callPragma mmx_call.
    mpwcPragma mpwc.
    mpwc_newlinePragma mpwc_newline.
    mpwc_relaxPragma mpwc_relax.
    msg_show_linerefPragma msg_show_lineref
    msg_show_realrefPragma msg_show_realref
    multibyteaware_ preserve_literalsPragma multibyteaware_ +preserve_literals
    no_conststringconvPragma no_conststringconv
    no_register_coloringPragma no_register_coloring.
    no_static_dtorsPragma no_static_dtors.
    no_conststringconvPragma no_conststringconv
    oldstyle_symbolsPragma oldstyle_symbols.
    only_std_keywordsANSI Keywords Only setting and pragma only_std_keywords.
    opt_classresultsPragma opt_classresults
    opt_common_subsPragma opt_common_subs.
    opt_dead_assignmentsPragma opt_dead_assignments.
    opt_dead_codePragma opt_dead_code.
    opt_lifetimesPragma opt_lifetimes.
    opt_loop_invariantsPragma opt_loop_invariants.
    opt_propagationPragma opt_propagation.
    opt_strength_reductionPragma opt_strength_reduction.
    opt_strength_reduction_strictPragma opt_strength_reduction_strict.
    opt_unroll_loopsPragma opt_unroll_loops.
    opt_vectorize_loopsPragma opt_vectorize_loops.
    optimize_for_sizePragma optimize_for_size.
    optimizewithasmPragma optimizewithasm.
    pool_dataPragma pool_data.
    pool_stringsPool Strings setting and pragma pool_strings.
    ppc_unroll_speculativePragma ppc_unroll_speculative.
    precompileWhether or not the file is precompiled.
    preprocessWhether or not the file is preprocessed.
    profilePragma profile.
    readonly_stringsPragma readonly_strings.
    register_coloringPragma register_coloring.
    require_prototypesRequire Function Prototypes setting and pragma require_prototypes.
    RTTIEnable RTTI setting and pragma RTTI.
    showmessagenumberPragma showmessagenumber
    side_effectsPragma side_effects.
    simple_prepdumpPragma simple_prepdump.
    SOMCallOptimizationPragma SOMCallOptimization.
    SOMCheckEnvironmentPragma SOMCheckEnvironment.
    stack_cleanupPragma stack_cleanup.
    suppress_init_codePragma suppress_init_code.
    suppress_warningsPragma suppress_warnings.
    symMarker in the project window debug column and pragma sym.
    syspath_oncePragma syspath_once.
    text_encodingPragma text_encoding
    toc_dataPragma toc_data.
    tracebackPragma traceback.
    trigraphsExpand Trigraphs setting and pragma trigraphs.
    unsigned_charUse Unsigned Chars setting and pragma unsigned_char.
    use_fp_instructionsPragma use_fp_instructions.
    use_framePragma use_frame.
    use_mask_registersPragma use_mask_registers.
    warningPragma warning
    warn_any_ptr_int_convPragma warn_any_ptr_int_conv
    warn_emptydeclEmpty Declarations setting and pragma warn_emptydecl.
    warn_extracommaExtra Commas setting and pragma warn_extracomma.
    warn_hiddenlocalsPragma warn_hiddenlocals
    warn_hidevirtualHidden virtual functions setting and pragma warn_hidevirtual.
    warn_illegal_instructions Pragma warn_illegal_instructions.
    warn_illpragmaIllegal Pragmas setting and pragma warn_illpragma.
    warn_illtokenpastingPragma warn_illtokenpasting
    warn_illunionmembersPragma warn_illunionmembers
    warn_impl_f2i_convPragma warn_impl_f2i_conv.
    warn_impl_i2f_convPragma warn_impl_i2f_conv.
    warn_impl_s2u_convPragma warn_impl_s2u_conv.
    warn_implicitconvImplicit Arithmetic Conversions setting and pragma warn_implicitconv.
    warn_missingreturnPragma warn_missingreturn
    warn_no_explicit_virtualPragma warn_no_explicit_virtual
    warn_no_side_effectpragma warn_no_side_effect.
    warn_notinlinedNon-Inlined Functions setting and pragma warn_notinlined.
    warn_paddingpragma warn_padding.
    warn_possunwantPossible Errors setting and pragma warn_possunwant.
    warn_ptr_int_convpragma warn_ptr_int_conv.
    warn_resultnotusedpragma warn_resultnotused.
    warn_structclassInconsistent ‘class’ / ‘struct’ Usage setting and pragma warn_structclass.
    warn_undefmacropragma warn_undefmacro
    warn_unusedargUnused Arguments setting and pragma warn_unusedarg.
    warn_unusedvarUnused Variables setting and pragma warn_unusedvar.
    warning_errorsTreat Warnings As Errors setting and pragma warning_errors.
    wchar_typeEnable wchar_t Support setting and pragma wchar_type.
    +

    + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp.compiler.doc.user/html/symbols/symbols.htm --- a/core/com.nokia.carbide.cpp.compiler.doc.user/html/symbols/symbols.htm Mon Jul 19 15:31:48 2010 -0500 +++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/symbols/symbols.htm Mon Jul 19 16:13:24 2010 -0500 @@ -1,21 +1,21 @@ - - - - - -Predefined Symbols - - - -

    Predefined Symbols

    -

    Carbide C/C++ compilers define several preprocessor and compiler symbols that give you information about the compile-time environment. The compiler evaluates these symbols at compile time, not runtime. The topics in this section are:

    - - - - - - + + + + + +Predefined Symbols + + + +

    Predefined Symbols

    +

    Carbide C/C++ compilers define several preprocessor and compiler symbols that give you information about the compile-time environment. The compiler evaluates these symbols at compile time, not runtime. The topics in this section are:

    + + + + + + diff -r 4891d49809bb -r 2b3996fc09a1 core/com.nokia.carbide.cpp/icons/gold_header.png Binary file core/com.nokia.carbide.cpp/icons/gold_header.png has changed