# HG changeset patch
# User fturovic 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. 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. Carbide generally supports the 8-bit character set of the host OS. Carbide generally supports the 8-bit character set of the host OS. 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. 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. 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. 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. See Enumerated Types. See Enumerated Types. (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. (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. 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. 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. This reference does not cover implementation-defined behaviors in the Metrowerks Standard Library for C (MSL C). This reference does not cover implementation-defined behaviors in the Metrowerks Standard Library for C (MSL C). 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. 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. (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. (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. The Carbide C language has functions __rol(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.
- The Carbide C language has functions __rol(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.
+ (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 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). (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 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). 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. 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. 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. char c; See Checking for Standard C and Standard C++ Conformity for more information on this setting. 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. char c; See Checking for Standard C and Standard C++ Conformity for more information on this setting. (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.
- (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.
+ 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”.
- 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”.
+ (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. (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. 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(); The list of valid arguments are grouped by targets: 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(); The list of valid arguments are grouped by targets: (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__ 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: See also Checking for Standard C and Standard C++ Conformity. (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__ 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: See also Checking for Standard C and Standard C++ Conformity. (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. #pragma enumsalwaysint on 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. #pragma enumsalwaysint off 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.) #pragma enumsalwaysint off 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. #pragma enumsalwaysint off 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. (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. #pragma enumsalwaysint on 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. #pragma enumsalwaysint off 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.) #pragma enumsalwaysint off 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. #pragma enumsalwaysint off 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. (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 '??^ 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.
- (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 '??^ 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.
+ The __FUNCTION__ predefined identifier contains the name of the function currently being compiled. For related information, see “Predefined Symbols”.
- The __FUNCTION__ predefined identifier contains the name of the function currently being compiled. For related information, see “Predefined Symbols”.
+ 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) #define DEBUG(fmt,args...) printf(fmt, ## args) struct Incomplete arr[10]; class MyClass { struct empty { } x; struct empty { } x = {}; typedef struct { int x, y, z; float q; } mystruct; void *p; switch(x) { #define MAC 3 int a[10], b[10]; enum { A, B, C, }; typedef struct { struct { int x, y, z; float q; } x = { q: 3.0, For related information, see the #pragma gcc_extensions. 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) #define DEBUG(fmt,args...) printf(fmt, ## args) struct Incomplete arr[10]; class MyClass { struct empty { } x; struct empty { } x = {}; typedef struct { int x, y, z; float q; } mystruct; void *p; switch(x) { #define MAC 3 int a[10], b[10]; enum { A, B, C, }; typedef struct { struct { int x, y, z; float q; } x = { q: 3.0, For related information, see the #pragma gcc_extensions. The C compiler has two built-in functions that return information about a data type’s byte alignment and its data type. The C compiler has two built-in functions that return information about a data type’s byte alignment and its data type. (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: 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”. (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: 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”. This section describes how the Carbide C compiler implements the C programming language: This section describes how the Carbide C compiler implements the C programming language: (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. (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. If you enable the pragma gcc_extensions, the compiler allows the initialization of local arrays and structs with non-constant values. void myFunc( int i, double x ) If you enable the pragma gcc_extensions, the compiler allows the initialization of local arrays and structs with non-constant values. void myFunc( int i, double x ) 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. 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)). inline int f() __attribute__((never_inline)) int main() NOTE For Intel x86 targets, the __decspec(noinline) is a compatible synonym. 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. 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)). inline int f() __attribute__((never_inline)) int main() NOTE For Intel x86 targets, the __decspec(noinline) is a compatible synonym. 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. 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. (ISO C, §6.10.3) The C compiler can accept # tokens that do not appear before arguments in macro definitions. #define add1(x) #x #1 // OK, but probably not what you wanted: To use this feature, disable the ANSI Strict setting. See also “Checking for Standard C and Standard C++ Conformity”. (ISO C, §6.10.3) The C compiler can accept # tokens that do not appear before arguments in macro definitions. #define add1(x) #x #1 // OK, but probably not what you wanted: To use this feature, disable the ANSI Strict setting. See also “Checking for Standard C and Standard C++ Conformity”. 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. 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. 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 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. 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: 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 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. In addition, note the following: wchar_t florette = L’\u273f’; extern string *Wörter[]; 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. 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 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. 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: 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 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. In addition, note the following: wchar_t florette = L’\u273f’; extern string *Wörter[]; 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. 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. 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. 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”. 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”. 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 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) 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. 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 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) 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. 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. switch (i) 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. switch (i) 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. 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. (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. #include <stdio.h> void PrintNum(float 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. #include <stdio.h> void main(void) void PrintNum(float 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. (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. #include <stdio.h> void PrintNum(float 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. #include <stdio.h> void main(void) void PrintNum(float 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. 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"; 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. 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"; 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. The short double data type is no longer supported for most targets.
- The short double data type is no longer supported for most targets.
+ 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. 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. 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.
- 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.
+ The C compiler can accept pointers that are typecasted to other pointer types as lvalues. char *cp; See also “Checking for Standard C and Standard C++ Conformity”. The C compiler can accept pointers that are typecasted to other pointer types as lvalues. char *cp; See also “Checking for Standard C and Standard C++ Conformity”. 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. char *cp; __typeof__(*ip) i; /* equivalent to "int i;" */ #pragma gcc_extensions on 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. char *cp; __typeof__(*ip) i; /* equivalent to "int i;" */ #pragma gcc_extensions on (ISO C, §6.9.1) The C compiler can accept unnamed arguments in a function definition. void f(int ) {} /* OK if ANSI Strict is disabled */ See also: Checking for Standard C and Standard C++ Conformity. (ISO C, §6.9.1) The C compiler can accept unnamed arguments in a function definition. void f(int ) {} /* OK if ANSI Strict is disabled */ See also: Checking for Standard C and Standard C++ Conformity. 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.
- 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.
+ 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. 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. (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. void main(void) a = 5; i[a + b] = 15; /* compiler calculates 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. (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. void main(void) a = 5; i[a + b] = 15; /* compiler calculates 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. 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. struct listOfLongs { 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. struct listOfLongs { 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. 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. 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. 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. 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. 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. 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 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. Use the predefined macro __env_var() to return host-specific environmental variables. An example of getting an environmental variable: // returns "username" environmental variable 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. 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. 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. 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 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. Use the predefined macro __env_var() to return host-specific environmental variables. An example of getting an environmental variable: // returns "username" environmental variable 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. 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. 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. 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. 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. 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. 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. 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++. 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++. Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. x86 Compiler 3.2.5 (Build 480); July, 2009 x86 Compiler 3.2.5 (Build 489); Feb, 2010 (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. (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. (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. (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. (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. (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. (ISO C++, §1.7) The standard specifies that the size of a byte is implementation-defined. (ISO C++, §1.7) The standard specifies that the size of a byte is implementation-defined. (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. (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. 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. 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. 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.
- 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.
+ This section describes how to control compiler behavior by selecting settings . This section contains the following topics: This section describes how to control compiler behavior by selecting settings . This section contains the following topics: 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. 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. 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. 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. 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. 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. 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 #pragma cpp_extensions on 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. 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 #pragma cpp_extensions on 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. 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. 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. 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. for(int i=1; i<1000; i++) { /* ... */ } 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. 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. for(int i=1; i<1000; i++) { /* ... */ } 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. 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. 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. 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 represents the qualified (unmangled) C++ name of the function being compiled. For related information, see Predefined Symbols.
- 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 represents the qualified (unmangled) C++ name of the function being compiled. For related information, see Predefined Symbols.
+ (ISO C++, §2.8, §2.11) The Carbide.c++ language reserves symbols from these two sections as keywords. (ISO C++, §2.8, §2.11) The Carbide.c++ language reserves symbols from these two sections as keywords. (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 { (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 { 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 { struct incomplete arr[10];
- 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 { struct incomplete arr[10];
+ 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: If you enable the ANSI Strict setting , the compiler enforces an external int main() function. 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: If you enable the ANSI Strict setting , the compiler enforces an external int main() 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. 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. 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. #pragma def_inherited on void Q::draw (int x,int y) For related information on this pragma see “def_inherited”.
- (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. 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. 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. #pragma def_inherited on void Q::draw (int x,int y) For related information on this pragma see “def_inherited”.
+ (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 { (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 { 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 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; are not allowed because foo is being redeclared in the current namespace, thereby masking the foo imported from NS. 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 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; are not allowed because foo is being redeclared in the current namespace, thereby masking the foo imported from NS. 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. 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. 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: 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: 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) { ; } }; And these pointers: Person *lois = new Person; This is how dynamic_cast works with each pointer: a = dynamic_cast<Athlete*>(arnold); 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> 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) { ; } }; And these pointers: Person *lois = new Person; This is how dynamic_cast works with each pointer: a = dynamic_cast<Athlete*>(arnold); 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> 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 { /* . . . */ }; using namespace std; Person *lois = new Person; All these expressions are true: #include <typeinfo> 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> Print this: Lois is a(n) Person 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 { /* . . . */ }; using namespace std; Person *lois = new Person; All these expressions are true: #include <typeinfo> 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> Print this: Lois is a(n) Person 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: 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: 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() 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) 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. void f(char); template <typename T> void tmpl_func() Names of template arguments that are dependent in base classes must be explicitly qualified (ISO C++, §14.6.2). See Listing 2. template <typename T> struct Base 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. void f(char); template <typename T> void type_dep_func() void f(int); int main() The compiler only uses external names to look up type-dependent arguments in function calls. static void f(int); // f() is internal. The compiler does not allow expressions in inline assembly statements that depend on template parameters. template <typename T> void asm_tmpl() The compiler also supports the address of template-id rules. template <typename T> void foo(T) {} 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() 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) 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. void f(char); template <typename T> void tmpl_func() Names of template arguments that are dependent in base classes must be explicitly qualified (ISO C++, §14.6.2). See Listing 2. template <typename T> struct Base 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. void f(char); template <typename T> void type_dep_func() void f(int); int main() The compiler only uses external names to look up type-dependent arguments in function calls. static void f(int); // f() is internal. The compiler does not allow expressions in inline assembly statements that depend on template parameters. template <typename T> void asm_tmpl() The compiler also supports the address of template-id rules. template <typename T> void foo(T) {} 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. // You must define names in a class template declaration struct bar; // Names in template argument dependent base classes: template<typename T> struct foo { template<typename T> struct foo { // The correct usage of typename in template argument template<class T> struct X { // Workaround: Use 'typename': template<class T> typename X<T>::xptr X<T>::f() // OK 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. // You must define names in a class template declaration struct bar; // Names in template argument dependent base classes: template<typename T> struct foo { template<typename T> struct foo { // The correct usage of typename in template argument template<class T> struct X { // Workaround: Use 'typename': template<class T> typename X<T>::xptr X<T>::f() // OK In a header file, declare your class functions and function templates, as shown in Listing 3.9. template <class 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. #include "templ.h" 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. 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. // You must define names in a class template declaration struct bar; // Names in template argument dependent base classes: template<typename T> struct foo { template<typename T> struct foo { // The correct usage of typename in template argument template<class T> struct X { // Workaround: Use 'typename': template<class T> typename X<T>::xptr X<T>::f() // OK In a header file, declare your class functions and function templates, as shown in Listing 3.9. template <class 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. #include "templ.h" 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. 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. // You must define names in a class template declaration struct bar; // Names in template argument dependent base classes: template<typename T> struct foo { template<typename T> struct foo { // The correct usage of typename in template argument template<class T> struct X { // Workaround: Use 'typename': template<class T> typename X<T>::xptr X<T>::f() // OK 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. #include <iostreams.h> void main(void) { 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. 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. #include <iostreams.h> void main(void) { 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. 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 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); 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. template <class T> struct X { template <class T> T X<T>::i = 1; NOTE Explicit instantiation is not in the ARM but is part of the ISO C++ standard. 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 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); 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. template <class T> struct X { template <class T> T X<T>::i = 1; NOTE Explicit instantiation is not in the ARM but is part of the ISO C++ standard. 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. 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. (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: (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: 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”.
- 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”.
+ Compiler-related strategies rely on compiler features to reduce object code size. 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. 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 rely on compiler features to reduce object code size. 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. 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.
+ 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. 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. 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”. 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. 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. 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 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. 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. 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”. 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. 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. 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. Library related strategies include: 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. 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 include: 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. 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.
+ The EC++ proposal does not support the following ISO C++ (ANSI C++) features. ANSI C++ supports templates. The EC++ proposal does not include template support for class or functions. 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. The EC++ proposal does not support any file operations except simple console input and output file types. The EC++ proposal does not contain localization libraries because of the excessive memory requirements. The EC++ proposal does not support exception handling. The EC++ proposal does not support the following language features: The EC++ proposal does not support the following ISO C++ (ANSI C++) features. ANSI C++ supports templates. The EC++ proposal does not include template support for class or functions. 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. The EC++ proposal does not support any file operations except simple console input and output file types. The EC++ proposal does not contain localization libraries because of the excessive memory requirements. The EC++ proposal does not support exception handling. The EC++ proposal does not support the following language features: 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.
- 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.
+ This section describes how to design software that adhere to the EC++ proposal. 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 Do not refer to routines, data structures, and classes in the Metrowerks Standard Library (MSL) for C++.
- This section describes how to design software that adhere to the EC++ proposal. 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 Do not refer to routines, data structures, and classes in the Metrowerks Standard Library (MSL) for C++.
+ 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++). 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++). 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. 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. Use either of the following pragmas to detect bad pointer value conversions: Use either of the following pragmas to detect bad pointer value conversions: 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 a == 0; // WARNING: This is a comparison. 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 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. 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 a == 0; // WARNING: This is a comparison. 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 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. If you enable the Empty Declarations setting, the compiler issues a warning when it encounters a declaration with no variable name. int ; // WARNING 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. If you enable the Empty Declarations setting, the compiler issues a warning when it encounters a declaration with no variable name. int ; // WARNING 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. 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. 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. 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 { class B: public A { 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. 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 { class B: public A { 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. 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. #pragma warn_resultnotused on 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. #pragma warn_resultnotused on 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. 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. 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. 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. 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). 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). 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.
- 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.
+ 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; 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. 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; 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. 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. 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. 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. #pragma warn_no_side_effect on 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. #pragma warn_no_side_effect on 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 */ enum Day { Sunday, Monday, Tuesday, Wednesday, d = 5; /* WARNING */ /* ... */ /* ... */ 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. 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 */ enum Day { Sunday, Monday, Tuesday, Wednesday, d = 5; /* WARNING */ /* ... */ /* ... */ 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. 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 You can declare an argument that you do not use in two ways without receiving this warning: void foo(int temp, int error) void foo(int /* temp */, int error) 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. 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 You can declare an argument that you do not use in two ways without receiving this warning: void foo(int temp, int error) void foo(int /* temp */, int error) 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. 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. int error; 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. void foo(void) #pragma unused (i, temp) /* Do not warn that i and temp */ 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. 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. int error; 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. void foo(void) #pragma unused (i, temp) /* Do not warn that i and temp */ 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. 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. 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. 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. 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. Arguments to main()
-Arguments to main()
+Character Sets
-Character Sets
+Interactive Device
-Interactive Device
+How to Identify Diagnostic Messages
-How to Identify Diagnostic Messages
+Enumerations
-Enumerations
+Identifiers
-Identifiers
+Implementation Quantities
-Table 1. Implementation Quantities for the C/C++ Compiler
-
-
-
-
-
-
-
+
+
+
+
+
+
-
- Quantity
- Minimum
-
-
- 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
+Table 1. Implementation Quantities for the C/C++ Compiler
+
+
+
+
+
+
+
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 @@
-
-
-
-
-
-
+
+ Quantity
+ Minimum
+
+
+ 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
+ Library Behaviors
-Library Behaviors
+C Implementation-Defined Behavior
-
-
-C Implementation-Defined Behavior
+
+
+ANSI Keywords Only
-
-
-
-ANSI Keywords Only
+
+
+
+Intrinsic Functions for Bit Rotation
-
- __ror(op, n)Intrinsic Functions for Bit Rotation
+
+ __ror(op, n)Character Constants as Integer Values
-
-
-
-
- Character constant
- Equivalent 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)
-
-Character Constants as Integer Values
+
+
+
+
+ Character constant
+ Equivalent 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)
+
+C Compiler
-
-C Compiler
+
+Converting Pointers to Types of the Same Size
-Converting a Pointer to a Same-sized Integral Type
-
- long arr = (long)&c; // accepted (not ISO C)Converting Pointers to Types of the Same Size
+Converting a Pointer to a Same-sized Integral Type
+
+ long arr = (long)&c; // accepted (not ISO C)C++ Comments
-C++ Comments
+The “D” Constant Suffix
-The “D” Constant Suffix
+Declaring Variables by Address
-
-Declaring Variables by Address
+
+The __declspec Declarator
-
- class __declspec(arg) bar { ... };
-
-
-
-
-
-
+
+
+
+
+
+The __declspec Declarator
+
+ class __declspec(arg) bar { ... };
+
+
+
+
+
+
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
-
- # ifndef __cplusplus
- /*
- * . . .
- */
- # endif __cplusplus
-#endif __MWERKS__
-
- #ifdef __MWERKS__
- # ifndef __cplusplus
- /*
- * . . .
- */
- # endif /* __cplusplus */
-#endif /* __MWERKS__ */Using an Identifier After #endif
+
+ # ifndef __cplusplus
+ /*
+ * . . .
+ */
+ # endif __cplusplus
+#endif __MWERKS__
+
+ #ifdef __MWERKS__
+ # ifndef __cplusplus
+ /*
+ * . . .
+ */
+ # endif /* __cplusplus */
+#endif /* __MWERKS__ */Enumerated Types
-Listing 2.2 Example of Enumerations as Signed Integers
-
- #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).Listing 2.3 Example of Enumeration Base Types
-
- 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 shortListing 2.4 Example of Enumerations with Type long long
-
- #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 longListing 2.5 Example of Enumerations with Type long
-
- #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)
-Enumerated Types
+Listing 2.2 Example of Enumerations as Signed Integers
+
+ #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).Listing 2.3 Example of Enumeration Base Types
+
+ 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 shortListing 2.4 Example of Enumerations with Type long long
+
+ #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 longListing 2.5 Example of Enumerations with Type long
+
+ #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)
+Expand Trigraphs
-
- char d = '\?\?\?\?'; // OKExpand Trigraphs
+
+ char d = '\?\?\?\?'; // OKThe __FUNCTION__ Predefined Identifier
-The __FUNCTION__ Predefined Identifier
+GCC Extension Support
-
-
-
-
-
-
-
-
-
- {
- asm ( "cntlzw %0, %1" : "=r" (bits) : "r" (value) );
- return bits;
- }
-
-
-
-
- DEBUG("test");
- DEBUG("saw %d copies\n", n_copies);
-• The abbreviated “?:” operator is allowed
- x = y ?: z; // --> x = y ? y : z;
-
-
-
-
-
-
-
-
- ...
- int MyClass::getval();
- ...
- };
-
-
-
-
-
-
-
-
-
-
-
-
- void foo(mystruct s);
- foo( (mystruct) { 1,2,3,6e3 } );
-
-
-
-
- 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.
-
-
-
-
- label:
- }
-
-
-
-
- #define MAC (3)
-
-
-
-
- a = b;
-
-
-
-
-
-
-
-
- int type;
- char data[];
- } Node;
-
-
-
-
- y:1, z:-4, x:-6 };GCC Extension Support
+
+
+
+
+
+
+
+
+
+ {
+ asm ( "cntlzw %0, %1" : "=r" (bits) : "r" (value) );
+ return bits;
+ }
+
+
+
+
+ DEBUG("test");
+ DEBUG("saw %d copies\n", n_copies);
+• The abbreviated “?:” operator is allowed
+ x = y ?: z; // --> x = y ? y : z;
+
+
+
+
+
+
+
+
+ ...
+ int MyClass::getval();
+ ...
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+ void foo(mystruct s);
+ foo( (mystruct) { 1,2,3,6e3 } );
+
+
+
+
+ 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.
+
+
+
+
+ label:
+ }
+
+
+
+
+ #define MAC (3)
+
+
+
+
+ a = b;
+
+
+
+
+
+
+
+
+ int type;
+ char data[];
+ } Node;
+
+
+
+
+ y:1, z:-4, x:-6 };Getting Alignment and Type Information at Compile Time
-
-
-
-
-
-
-
+
+
+
+
+
+
- Getting Alignment and Type Information at Compile Time
+
+
+
+
+
+
+
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 @@
-
-
-
-
-
-
+ Header Files
-
-
-
-
- System
- Directive
-
-
- Windows
- #include "c:\HD\Tools\my headers\macros.h"
-
-
-UNIX
- #include "/HD/Tools/my headers/macros.h"
-
-Header Files
+
+
+
+
+ System
+ Directive
+
+
+ Windows
+ #include "c:\HD\Tools\my headers\macros.h"
+
+
+UNIX
+ #include "/HD/Tools/my headers/macros.h"
+
+The Carbide Implementation of C
-
-
-
-
-
-
-
+
+
+
+
+
+The Carbide Implementation of C
+
+
+
+
+
+
+
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
+ Initialization of Local Arrays and Structures
-
-GNU C Extension for Initializing Arrays and Structures
-
- {
- int arr[2] = { i, i + 1 };
- struct myStruct = { i, x };
- } Initialization of Local Arrays and Structures
+
+GNU C Extension for Initializing Arrays and Structures
+
+ {
+ int arr[2] = { i, i + 1 };
+ struct myStruct = { i, x };
+ } Inlining
-
-
-Table 1: Settings for the Inline Depth
-
-
-
-
- This setting
- Does this…
-
-
- Don’t Inline
- Inlines no functions, not even C or C++ functions declared inline.
-
-
- Smart
- Inlines small functions to a depth of 2 to 4 inline functions deep.
-
-
-1 to 8
- Inlines to the depth specified by the numerical selection.
- Example __attribute__(never_inline)
-
- {
- return 10;
- }
- {
- return f(); // f() is never inlined
- }Inlining
+
+
+Table 1: Settings for the Inline Depth
+
+
+
+
+ This setting
+ Does this…
+
+
+ Don’t Inline
+ Inlines no functions, not even C or C++ functions declared inline.
+
+
+ Smart
+ Inlines small functions to a depth of 2 to 4 inline functions deep.
+
+
+1 to 8
+ Inlines to the depth specified by the numerical selection.
+ Example __attribute__(never_inline)
+
+ {
+ return 10;
+ }
+ {
+ return f(); // f() is never inlined
+ }Extensions to ISO C
-
-
-Extensions to ISO C
+
+
+A # Not Followed by a Macro Argument
-Listing 1. Preprocessor Macros Using # Without an Argument
-
- // add1(abc) creates "abc"#1
- #define add2(x) #x "2" // OK: add2(abc) creates "abc2"
-A # Not Followed by a Macro Argument
+Listing 1. Preprocessor Macros Using # Without an Argument
+
+ // add1(abc) creates "abc"#1
+ #define add2(x) #x "2" // OK: add2(abc) creates "abc2"
+Map Newlines to CR
-
-Map Newlines to CR
+
+Multibyte and Unicode Support
-Wide String Literals
-Source Encoding
-
-
-
- #pragma text_encoding("name" | unknown | reset [, global])
- 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
-Other Support
-
-
-
-
-
- int \u30AD\u30B3\u30DE\u30A6 = soy_sauce();
-
-
-
-
- -->
- extern string *W\u00F6rter[];
-
-Multibyte and Unicode Support
+Wide String Literals
+Source Encoding
+
+
+
+ #pragma text_encoding("name" | unknown | reset [, global])
+ 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
+Other Support
+
+
+
+
+
+ int \u30AD\u30B3\u30DE\u30A6 = soy_sauce();
+
+
+
+
+ -->
+ extern string *W\u00F6rter[];
+
+Pool Strings
-
-Pool Strings
+
+Precompiled Header Files
-
-
-Precompiled Header Files
+
+
+Prefix Files
-
- #pragma warn_illtokenpasting off
- #include "MyHeaders.mch"
- #endifPrefix Files
+
+ #pragma warn_illtokenpasting off
+ #include "MyHeaders.mch"
+ #endifRanges in case statements
-Listing 1. Ranges in case Statements
-
- {
- 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
+Listing 1. Ranges in case Statements
+
+ {
+ case 0 ... 2: /* Equivalent to case 0: case 1: case 2: */
+ j = i * 2;
+ break;
+ case 3:
+ j = i;
+ break;
+ default:
+ j = 0;
+ break;
+ } Relaxed Pointer Type Rules
-
-Relaxed Pointer Type Rules
+
+Require Function Prototypes
-Listing 1. Unnoticed Type-mismatch
-
- void main(void)
- {
- PrintNum(1); // PrintNum() tries to interpret the
- integer as a float. Prints 0.000000.
- }
- {
- printf("%f\n", x);
- }Listing 2. Using a Prototype to Avoid Type-mismatch
-
- void PrintNum(float x); // Function prototype.
- {
- PrintNum(1); // Compiler converts int to float.
- } // Prints 1.000000.
- {
- printf("%f\n", x);
- }
-Require Function Prototypes
+Listing 1. Unnoticed Type-mismatch
+
+ void main(void)
+ {
+ PrintNum(1); // PrintNum() tries to interpret the
+ integer as a float. Prints 0.000000.
+ }
+ {
+ printf("%f\n", x);
+ }Listing 2. Using a Prototype to Avoid Type-mismatch
+
+ void PrintNum(float x); // Function prototype.
+ {
+ PrintNum(1); // Compiler converts int to float.
+ } // Prints 1.000000.
+ {
+ printf("%f\n", x);
+ }
+Reusing Strings
-
- char *str2="Hello"; // two identical strings
- *str2 = 'Y';
-Reusing Strings
+
+ char *str2="Hello"; // two identical strings
+ *str2 = 'Y';
+The short double Data Type
-The short double Data Type
+Sizeof() Operator Data Type
-
-Sizeof() Operator Data Type
+
+Checking for Standard C and Standard C++ Conformity
-
-
-Checking for Standard C and Standard C++ Conformity
+
+
+Using Typecasted Pointers as lvalues
-Listing 1. Example of a Typecasted Pointer as an lvalue
-
- ((long *) cp)++; /* OK if ANSI Strict is disabled. */
-Using Typecasted Pointers as lvalues
+Listing 1. Example of a Typecasted Pointer as an lvalue
+
+ ((long *) cp)++; /* OK if ANSI Strict is disabled. */
+ The __typeof__() and typeof() operators
-Listing 1. Example of __typeof__() and typeof() Operators
-
- int *ip;
- long *lp;
- __typeof__(*lp) l; /* equivalent to "long l;" */
- typeof(*cp) c; /* equivalent to "char c;" */
- The __typeof__() and typeof() operators
+Listing 1. Example of __typeof__() and typeof() Operators
+
+ int *ip;
+ long *lp;
+ __typeof__(*lp) l; /* equivalent to "long l;" */
+ typeof(*cp) c; /* equivalent to "char c;" */
+ Unnamed Arguments in Function Definitions
-Listing 1. Unnamed Function Arguments
-
- void f(int i) {} /* ALWAYS OK */
-Unnamed Arguments in Function Definitions
+Listing 1. Unnamed Function Arguments
+
+ void f(int i) {} /* ALWAYS OK */
+Use Unsigned Chars
-Use Unsigned Chars
+Using long long Integers
-
-Using long long Integers
+
+Volatile Variables
-
-
-Listing 1. Volatile Variables
-
- {
- int i[100];
- volatile int a, b; /* a and b are not cached in registers. */
- b = 20;
- i[a + b] = 30; /* compiler recalculates a + b */
- }
-Volatile Variables
+
+
+Listing 1. Volatile Variables
+
+ {
+ int i[100];
+ volatile int a, b; /* a and b are not cached in registers. */
+ b = 20;
+ i[a + b] = 30; /* compiler recalculates a + b */
+ }
+Arrays of Zero Length in Structures
-Listing 1. Using Zero-length Arrays
-
- long listCount;
- long list[0]; // OK if ANSI Strict is disabled, [] is OK, too.
- }
- Arrays of Zero Length in Structures
+Listing 1. Using Zero-length Arrays
+
+ long listCount;
+ long list[0]; // OK if ANSI Strict is disabled, [] is OK, too.
+ }
+ Help and Administrative Options
-
-Help and Administrative Options
+
+Command-Line Settings Conventions
-Command-Line Settings Conventions
+Working with Environment Variables
-CWFolder Environment Variable
-Setting the PATH Environment Variable
-
- %CWFolder%\Carbide\Carbide.c++Getting Environmental Variables
-
- // (host-specific)
- char* username = __env_var(username);Search Path Environment Variables
-Working with Environment Variables
+CWFolder Environment Variable
+Setting the PATH Environment Variable
+
+ %CWFolder%\Carbide\Carbide.c++Getting Environmental Variables
+
+ // (host-specific)
+ char* username = __env_var(username);Search Path Environment Variables
+File Extensions
-File Extensions
+Invoking Command-Line Tools
-
-
-
-
-
-Invoking Command-Line Tools
+
+
+
+
+
+Command-Line Tools
-
-
-
-Command-Line Tools
+
+
+
+Tool Naming Conventions
-
-
-
-
-Tool Naming Conventions
+
+
+
+
+
+
License: http://www.eclipse.org/legal/epl-v10.html
-
+ x86 C/C++ Compiler Reference
- x86 C/C++ Compiler Reference
+ Character Literals
-Character Literals
+Interactive Devices
-Interactive Devices
+Header File Access
-Header File Access
+Size of Bytes
-Size of Bytes
+Source File Handling
-
- New-line characters are left untouched, unless preceded by a backslash (“\”), in which case the proceeding line is appended.Source File Handling
+
+ New-line characters are left untouched, unless preceded by a backslash (“\”), in which case the proceeding line is appended.C++ Implementation-Defined Behavior
-
-
-C++ Implementation-Defined Behavior
+
+
+C++ Compiler
-
-
-C++ Compiler
+
+
+Controlling the C++ Compiler
-
-
-
-
-
-
-
+
+
+
+
+
+
-Controlling the C++ Compiler
+
+
+
+
+
+
+
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
+Using the bool Type
-
-Using the bool Type
+
+Controlling Exception Handling
-
-Controlling Exception Handling
+
+Controlling C++ Extensions
-
-
-
-
-
- void foo()
- {
- union {
- long hilo;
- struct { short hi, lo; };
- // anonymous struct
- };
- hi=0x1234;
- lo=0x5678;
- // hilo==0x12345678
- }
-
-
-
-
- struct Foo { void f(); }
- void Foo::f()
- {
- void (Foo::*ptmf1)() = &Foo::f;
- // ALWAYS OK
-
- void (Foo::*ptmf2)() = f;
- // OK if you enabled cpp_extensions.
- }
-
-Controlling C++ Extensions
+
+
+
+
+
+ void foo()
+ {
+ union {
+ long hilo;
+ struct { short hi, lo; };
+ // anonymous struct
+ };
+ hi=0x1234;
+ lo=0x5678;
+ // hilo==0x12345678
+ }
+
+
+
+
+ struct Foo { void f(); }
+ void Foo::f()
+ {
+ void (Foo::*ptmf1)() = &Foo::f;
+ // ALWAYS OK
+
+ void (Foo::*ptmf2)() = f;
+ // OK if you enabled cpp_extensions.
+ }
+
+Controlling RTTI
-Controlling RTTI
+Controlling Variable Scope in for Statements
-Listing 1. Example of a Local Variable Outside a for Statement
-
- return i; // OK in ARM, Error in Carbide.c++
-Controlling Variable Scope in for Statements
+Listing 1. Example of a Local Variable Outside a for Statement
+
+ return i; // OK in ARM, Error in Carbide.c++
+Working with C++ Exceptions
-
-
-Working with C++ Exceptions
+
+
+Extensions to ISO Standard C++
-The __PRETTY_FUNCTION__ Predefined Identifier
-Extensions to ISO Standard C++
+The __PRETTY_FUNCTION__ Predefined Identifier
+Additional Keywords
-Additional Keywords
+Default Arguments in Member Functions
-
- 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
+
+ enum A { AA };
+ int f(A a = AA); // OK
+ int f(B b = BB); // ERROR: BB is not declared yet
+ enum B { BB };
+ }; Forward Declarations of Arrays of Incomplete Type
-
- int a, b, c;
- };Forward Declarations of Arrays of Incomplete Type
+
+ int a, b, c;
+ };Implicit Return Statement for main()
-
- // int main() { return 0; }
-
- main() { } // equivalent to:
- // int main() { return 0; }Implicit Return Statement for main()
+
+ // int main() { return 0; }
+
+ main() { } // equivalent to:
+ // int main() { return 0; }Calling an Inherited Member Function
-The standard method of calling inherited member functions
-Using inheritance to call inherited member functions
-Listing 1. Using inherited to Call an Inherited Member Function
-
- struct O { virtual void draw(int,int); };
- struct Q : O { void draw(int,int); };
- {
- inherited::draw(x,y); // Perform behavior of base class
- ... // Perform added behavior
- }Calling an Inherited Member Function
+The standard method of calling inherited member functions
+Using inheritance to call inherited member functions
+Listing 1. Using inherited to Call an Inherited Member Function
+
+ struct O { virtual void draw(int,int); };
+ struct Q : O { void draw(int,int); };
+ {
+ inherited::draw(x,y); // Perform behavior of base class
+ ... // Perform added behavior
+ }Keyword Ordering
-
- virtual int f0(); // OK
- int virtual f1(); // OK
- friend int f2(); // OK
- int friend f3(); // ERROR
- }; Keyword Ordering
+
+ virtual int f0(); // OK
+ int virtual f1(); // OK
+ friend int f2(); // OK
+ int friend f3(); // ERROR
+ }; Namespaces
-
- {
- int foo();
- void bar();
- }
- int foo;Namespaces
+
+ {
+ int foo();
+ void bar();
+ }
+ int foo;Vendor Independent C++ ABI
-
-
-
-
-Vendor Independent C++ ABI
+
+
+
+
+Carbide Implementation of C++
-
-
-
-
-
-
-
+
+
+
+
+
+Carbide Implementation of C++
+
+
+
+
+
+
+
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
-
- class Athlete : public Person { /* . . . */ };
-class Superman : public Athlete { /* . . . */ };
- Person *arnold = new Athlete;
- Person *clark = new Superman;
-Athlete *a;
- // 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.
- using namespace std;
- Person &superref = *clark;
- try {
- Person &ref = dynamic_cast<Person&>(superref);
- }
- catch(bad_cast) {
- cout << "oops!" << endl;
- }
-Using the dynamic_cast Operator
+
+ class Athlete : public Person { /* . . . */ };
+class Superman : public Athlete { /* . . . */ };
+ Person *arnold = new Athlete;
+ Person *clark = new Superman;
+Athlete *a;
+ // 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.
+ using namespace std;
+ Person &superref = *clark;
+ try {
+ Person &ref = dynamic_cast<Person&>(superref);
+ }
+ catch(bad_cast) {
+ cout << "oops!" << endl;
+ }
+Using the typeid Operator
-
-
-
- class Athlete : public Person { /* . . . */ };
- Athlete *arnold = new Athlete;
- Athlete *louganis = new Athlete;
- // . . .
- 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
- // . . .
- cout << "Lois is a(n) "
-<< typeid(*lois).name() << endl;
-cout << "Arnold is a(n) "
-<< typeid(*arnold).name() << endl;
- Arnold is a(n) Athlete
-Using the typeid Operator
+
+
+
+ class Athlete : public Person { /* . . . */ };
+ Athlete *arnold = new Athlete;
+ Athlete *louganis = new Athlete;
+ // . . .
+ 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
+ // . . .
+ cout << "Lois is a(n) "
+<< typeid(*lois).name() << endl;
+cout << "Arnold is a(n) "
+<< typeid(*arnold).name() << endl;
+ Arnold is a(n) Athlete
+Working with RTTI
-Working with RTTI
+ Better Template Conformance
-
- {
- T::name *ptr; // ERROR: an attempt to multiply T::name by ptr
- typename T::name *ptr; // OK
- }
- {
- ptr->f<int>(); // ERROR: f is less than int
- ptr->template f<int>(); // OK
- }Listing 1. Binding Non-dependent Identifiers
-
- {
- f(1); // Uses f(char); f(int) is not defined yet.
- g(); // ERROR: g() is not defined yet.
- }
- void g();
- void f(int);Listing 2. Qualifying Template Arguments in Base Classes
-
- {
- void f();
- }
- template <typename T> struct Derive: Base<T>
- {
- void g()
- {
- f(); // ERROR: Base<T>::f() is not visible.
- Base<T>::f(); // OK
- }
- }Listing 3. Function Call with Type-dependent Argument
-
- {
- f(1); // Uses f(char), above; f(int) is not declared yet.
- f(T()); // f() called with a type-dependent argument.
- }
- struct A{};
- void f(A);
- {
- type_dep_func<int>(); // Calls f(char) twice.
- type_dep_func<A>(); // Calls f(char) and f(A);
- return 0;
- }
- 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.
-}
- {
- asm { move #sizeof(T), D0 ); // ERROR: Not yet supported.
- }
- template <typename T> void bar(T) {}
- ...
- foo{ &bar<int> ); // now accepted
- Better Template Conformance
+
+ {
+ T::name *ptr; // ERROR: an attempt to multiply T::name by ptr
+ typename T::name *ptr; // OK
+ }
+ {
+ ptr->f<int>(); // ERROR: f is less than int
+ ptr->template f<int>(); // OK
+ }Listing 1. Binding Non-dependent Identifiers
+
+ {
+ f(1); // Uses f(char); f(int) is not defined yet.
+ g(); // ERROR: g() is not defined yet.
+ }
+ void g();
+ void f(int);Listing 2. Qualifying Template Arguments in Base Classes
+
+ {
+ void f();
+ }
+ template <typename T> struct Derive: Base<T>
+ {
+ void g()
+ {
+ f(); // ERROR: Base<T>::f() is not visible.
+ Base<T>::f(); // OK
+ }
+ }Listing 3. Function Call with Type-dependent Argument
+
+ {
+ f(1); // Uses f(char), above; f(int) is not declared yet.
+ f(T()); // f() called with a type-dependent argument.
+ }
+ struct A{};
+ void f(A);
+ {
+ type_dep_func<int>(); // Calls f(char) twice.
+ type_dep_func<A>(); // Calls f(char) and f(A);
+ return 0;
+ }
+ 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.
+}
+ {
+ asm { move #sizeof(T), D0 ); // ERROR: Not yet supported.
+ }
+ template <typename T> void bar(T) {}
+ ...
+ foo{ &bar<int> ); // now accepted
+Providing declarations when declaring the template
-Listing 1. Declarations in Template Declarations
-
- template<typename T> struct foo {
- bar *member; // OK
- };
- struct bar { };
- foo<int> fi;
- typedef T *tptr;
- };
- typedef T *tptr;
- };
- template<typename T> struct bar : foo<T> {
- typename foo<T>::tptr member; // OK
- };
- // dependent qualified names in some contexts:
- typedef X *xptr;
- xptr f();
- };
- template<class T> X<T>::xptr X<T>::f() // 'typename' missing
- {
- return 0;
- }
- {
- return 0;
- }
-
- Providing declarations when declaring the template
+Listing 1. Declarations in Template Declarations
+
+ template<typename T> struct foo {
+ bar *member; // OK
+ };
+ struct bar { };
+ foo<int> fi;
+ typedef T *tptr;
+ };
+ typedef T *tptr;
+ };
+ template<typename T> struct bar : foo<T> {
+ typename foo<T>::tptr member; // OK
+ };
+ // dependent qualified names in some contexts:
+ typedef X *xptr;
+ xptr f();
+ };
+ template<class T> X<T>::xptr X<T>::f() // 'typename' missing
+ {
+ return 0;
+ }
+ {
+ return 0;
+ }
+
+ Declaring and Defining Templates
-Listing 1. templ.h: A Template Declaration File
-
- class Templ {
- T member;
- public:
- Templ(T x) { member=x; }
- T Get();
- };
-
- template <class T>
- T Max(T,T);Listing 2. templ.cp: A Template Definition File
-
-
- template <class T>
- T Templ<T>::Get()
- {
- return member;
- }
-
- template <class T>
- T Max(T x, T y)
- {
- return ((x>y)?x:y);
- }Providing declarations when declaring the template
-Listing 3.11 Declarations in Template Declarations
-
- template<typename T> struct foo {
- bar *member; // OK
- };
- struct bar { };
- foo<int> fi;
- typedef T *tptr;
- };
- typedef T *tptr;
- };
- template<typename T> struct bar : foo<T> {
- typename foo<T>::tptr member; // OK
- };
- // dependent qualified names in some contexts:
- typedef X *xptr;
- xptr f();
- };
- template<class T> X<T>::xptr X<T>::f() // 'typename' missing
- {
- return 0;
- }
- {
- return 0;
- }
-
- Declaring and Defining Templates
+Listing 1. templ.h: A Template Declaration File
+
+ class Templ {
+ T member;
+ public:
+ Templ(T x) { member=x; }
+ T Get();
+ };
+
+ template <class T>
+ T Max(T,T);Listing 2. templ.cp: A Template Definition File
+
+
+ template <class T>
+ T Templ<T>::Get()
+ {
+ return member;
+ }
+
+ template <class T>
+ T Max(T x, T y)
+ {
+ return ((x>y)?x:y);
+ }Providing declarations when declaring the template
+Listing 3.11 Declarations in Template Declarations
+
+ template<typename T> struct foo {
+ bar *member; // OK
+ };
+ struct bar { };
+ foo<int> fi;
+ typedef T *tptr;
+ };
+ typedef T *tptr;
+ };
+ template<typename T> struct bar : foo<T> {
+ typename foo<T>::tptr member; // OK
+ };
+ // dependent qualified names in some contexts:
+ typedef X *xptr;
+ xptr f();
+ };
+ template<class T> X<T>::xptr X<T>::f() // 'typename' missing
+ {
+ return 0;
+ }
+ {
+ return 0;
+ }
+
+ Automatic instantiation
-Listing 1. myprog.cp: A Source File that Uses Templates
-
- #include "templ.cp" // includes templ.h as well
- Templ<long> a = 1, b = 2;
- // The compiler instantiates Templ<long> here.
- cout << Max(a.Get(), b.Get());
- // The compiler instantiates Max<long>() here.
- };
- Automatic instantiation
+Listing 1. myprog.cp: A Source File that Uses Templates
+
+ #include "templ.cp" // includes templ.h as well
+ Templ<long> a = 1, b = 2;
+ // The compiler instantiates Templ<long> here.
+ cout << Max(a.Get(), b.Get());
+ // The compiler instantiates Max<long>() here.
+ };
+ Explicit instantiation
-
- template long Max<long>(long,long); // function instantiation
- // The compiler can tell from the arguments
-// that you are instantiating Max<long>()Listing 2. Explicit Instantiation of Non-Template Members
-
- static T i;
- };
- template char X<char>::i;
- Explicit instantiation
+
+ template long Max<long>(long,long); // function instantiation
+ // The compiler can tell from the arguments
+// that you are instantiating Max<long>()Listing 2. Explicit Instantiation of Non-Template Members
+
+ static T i;
+ };
+ template char X<char>::i;
+ Instantiating a Template
-
-
-
- Instantiating a Template
+
+
+
+Working with Templates
-Working with Templates
+Activating EC++
-Activating EC++
+Compiler-related Strategies
-
-
-Size Optimizations
-Inlining
-Compiler-related Strategies
+
+
+Size Optimizations
+Inlining
+Language-related Strategies
-
-
-Virtual Functions
-Runtime Type Identification
-Exception Handling
-Operator New
-Multiple and Virtual Inheritance
-Language-related Strategies
+
+
+Virtual Functions
+Runtime Type Identification
+Exception Handling
+Operator New
+Multiple and Virtual Inheritance
+Library-related strategies
-
-
-Stream-Based Classes
-Alternative Class Libraries
-Library-related strategies
+
+
+Stream-Based Classes
+Alternative Class Libraries
+Differences Between ISO C++ and EC++
-Templates
-Libraries
-File Operations
-Localization
-Exception Handling
-Unsupported Language Features
-
-
-
-
-
-
-
+
+
+
+
+
+Differences Between ISO C++ and EC++
+Templates
+Libraries
+File Operations
+Localization
+Exception Handling
+Unsupported 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++
+
+
+EC++ Specifications
- Language Related Issues
-
-
-Library-Related Issues
-EC++ Specifications
+ Language Related Issues
+
+
+Library-Related Issues
+C++ and Embedded Systems
-
-
-C++ and Embedded Systems
+
+
+Warnings as Errors
-
-Warnings as Errors
+
+Bad Conversions of Pointer Values
-
-
-
-
-
-
-
+
+
+
+
+
+Bad Conversions of Pointer Values
+
+
+
+
+
+
+
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
-
-
-
-
-
- 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; // OK: This is an assignment, no warning
-
-
-
-
- while (i++) /*: Comment separation, no warning */ ;
-Common Errors
+
+
+
+
+
+ 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; // OK: This is an assignment, no warning
+
+
+
+
+ while (i++) /*: Comment separation, no warning */ ;
+Empty Declarations
-
-For example:
- int i; // OK
-Empty Declarations
+
+For example:
+ int i; // OK
+Extra Commas
-
-Extra Commas
+
+Hidden Virtual Functions
-
- public:
- virtual void f(int);
- virtual void g(int);
- };
- public:
- void f(char); // WARNING: Hides A::f(int)
- virtual void g(int); // OK: Overrides A::g(int)
- };
-Hidden Virtual Functions
+
+ public:
+ virtual void f(int);
+ virtual void g(int);
+ };
+ public:
+ void f(char); // WARNING: Hides A::f(int)
+ virtual void g(int); // OK: Overrides A::g(int)
+ };
+ Ignored Function Results
-Listing 6.13 Example of Pragma warn_resultnotused
-
- void foo(int a,int b)
- {
- bar(); // warning: result of bar() is not used
- (void)bar(); // void cast suppresses warning
- }
- Ignored Function Results
+Listing 6.13 Example of Pragma warn_resultnotused
+
+ void foo(int a,int b)
+ {
+ bar(); // warning: result of bar() is not used
+ (void)bar(); // void cast suppresses warning
+ }
+ Illegal Pragmas
-
- #pragma far_data select // WARNING: select is not defined
-#pragma far_data on // OK
-Illegal Pragmas
+
+ #pragma far_data select // WARNING: select is not defined
+#pragma far_data on // OK
+Implicit Arithmetic Conversions
-
-
-Table 6.1 Implicit Arithmetic Conversion Pragmas
-
-
-
-
-
-
-
+
+
+
+
+
+
-
- This pragma…
- Warns about this kind of conversion
-
-
- warn_illunionmembers
- a floating point value to an integer value
-
-
- warn_impl_i2f_conv
- an integer value to a floating-point value
-
-
- warn_impl_s2u_conv
- a signed value to an unsigned value
-
-
-warn_implicitconv
- all; this pragma is equivalent to the Implicit Arithmetic Conversions setting
- Implicit Arithmetic Conversions
+
+
+Table 6.1 Implicit Arithmetic Conversion Pragmas
+
+
+
+
+
+
+
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 @@
-
-
-
-
-
-
+
+ This pragma…
+ Warns about this kind of conversion
+
+
+ warn_illunionmembers
+ a floating point value to an integer value
+
+
+ warn_impl_i2f_conv
+ an integer value to a floating-point value
+
+
+ warn_impl_s2u_conv
+ a signed value to an unsigned value
+
+
+warn_implicitconv
+ all; this pragma is equivalent to the Implicit Arithmetic Conversions setting
+ inline Functions That Are Not Inlined
-inline Functions That Are Not Inlined
+Mixed Use of ‘class’ and ‘struct’ Keywords
-
- struct X { int a; }; // warning
-Mixed Use of ‘class’ and ‘struct’ Keywords
+
+ struct X { int a; }; // warning
+Realigned Data Structures
-
-Realigned Data Structures
+
+Redundant Statements
-Listing 6.12 Example of Pragma warn_no_side_effect
-
- void foo(int a,int b)
- {
- a+b; // warning: expression has no side effect
- (void)(a+b); // void cast suppresses warning
- }
- Redundant Statements
+Listing 6.12 Example of Pragma warn_no_side_effect
+
+ void foo(int a,int b)
+ {
+ a+b; // warning: expression has no side effect
+ (void)(a+b); // void cast suppresses warning
+ }
+ Suspicious Assignments and Incorrect Function Returns
-
-
-
-
-
- {
- 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
-
- Thursday, Friday, Saturday } d;
- 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 */
-Suspicious Assignments and Incorrect Function Returns
+
+
+
+
+
+ {
+ 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
+
+ Thursday, Friday, Saturday } d;
+ 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 */
+Unused Arguments
-
- {
- error = do_something(); // WARNING: temp and error are
- // unused.
-}
-
-
-
-
- {
- #pragma unused (temp)
- /* Compiler does not warn that temp is not used */
- error=do_something();
- }
-
-
-
-
- {
- /* Compiler does not warn that "temp" is not used.
- error=do_something(); */
- }
-Unused Arguments
+
+ {
+ error = do_something(); // WARNING: temp and error are
+ // unused.
+}
+
+
+
+
+ {
+ #pragma unused (temp)
+ /* Compiler does not warn that temp is not used */
+ error=do_something();
+ }
+
+
+
+
+ {
+ /* Compiler does not warn that "temp" is not used.
+ error=do_something(); */
+ }
+Unused Variables
-Listing 1. Unused Local Variables Example
-
- void foo(void)
- {
- int temp, errer; // ERROR: errer is misspelled
- error = do_something()
- // WARNING: temp and error are unused.
- }Listing 2. Suppressing Unused Variable Warnings
-
- {
- int i, temp, error;
- error=do_something(); /* are not used */
- }
-Unused Variables
+Listing 1. Unused Local Variables Example
+
+ void foo(void)
+ {
+ int temp, errer; // ERROR: errer is misspelled
+ error = do_something()
+ // WARNING: temp and error are unused.
+ }Listing 2. Suppressing Unused Variable Warnings
+
+ {
+ int i, temp, error;
+ error=do_something(); /* are not used */
+ }
+Conventions Used in This Reference
-Table 1. Understanding Syntax Examples
-
-
-
-
-
-
-
+
+
+
+
+
+
-
- If the text looks like…
- Then…
-
-
- literal
- Include the text in your statement exactly as you see it.
-
-
- metasymbol
- Replace the symbol with an appropriate value. The text after the syntax example describes what the appropriate values are.
-
-
- a | b | c
- Use 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
+Table 1. Understanding Syntax Examples
+
+
+
+
+
+
+
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 @@
-
-
-
-
-
-
+
+ If the text looks like…
+ Then…
+
+
+ literal
+ Include the text in your statement exactly as you see it.
+
+
+ metasymbol
+ Replace the symbol with an appropriate value. The text after the syntax example describes what the appropriate values are.
+
+
+ a | b | c
+ Use 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.
+ Where to Look for Related Information
-
-
-Where to Look for Related Information
+
+
+
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:
+Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.eclipse.org/legal/epl-v10.html
-Portions of this product are covered by the following licenses:
-- +
Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.eclipse.org/legal/epl-v10.html
+Portions of this product are covered by the following licenses:
++
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 @@
+
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 @@
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.
-
+
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 @@ - - - -
- -
- - - -
+ + + +
+ +
+ + + +