Chapter 16 C++ Compiler
The compiler does not allow expressions in inline assembly statements that depend on template parameters. See
Listing 16-7 on page 303 .
Listing 16-7. Assembly statements cannot depend on template arguments
template <typename T> void asm_tmpl()
{
asm { move #sizeof(T), D0 ); // ERROR: Not supported.
}
The compiler also supports the address of template-id rules. See
Listing 16-8 on page
303 .
Listing 16-8. Address of Template-id Supported
template <typename T> void funcA(T) {} template <typename T> void funcB(T) {}
...
funcA{ &funcB<int> ); // now accepted
16.3 Implementation-Defined Behavior
Annex A of the ISO/IEC 14882:2003 C++ Standard lists compiler behaviors that are beyond the scope of the standard, but which must be documented for a compiler implementation. This annex also lists minimum guidelines for these behaviors, although a conforming compiler is not required to meet these minimums.
The CodeWarrior C++ compiler has these implementation quantities listed in
Table 16-2
, based on the ISO/IEC 14882:2003 C++ Standard, Annex A.
NOTE
The term unlimited in
Table 16-2
means that a behavior is limited only by the processing speed or memory capacity of the computer on which the CodeWarrior C++ compiler is running.
Table 16-2. Implementation Quantities for C/C++ Compiler (ISO/IEC 14882:2003 C++, §A)
Behavior
Nesting levels of compound statements, iteration control structures, and selection control structures
Nesting levels of conditional inclusion
Pointer, array, and function declarators
(in any combination) modifying an arithmetic, structure, union, or incomplete type in a declaration
Nesting levels of parenthesized expressions within a full expression
256
256
256
256
Standard Minimum Guideline
Table continues on the next page...
Unlimited
256
Unlimited
Unlimited
CodeWarrior Limit
CodeWarrior Development Studio for Advanced Packet Processing Build Tools Reference Manual, Rev.
10.2, 01/2016
Freescale Semiconductor, Inc.
303
Implementation-Defined Behavior
Table 16-2. Implementation Quantities for C/C++ Compiler (ISO/IEC 14882:2003 C++, §A)
(continued)
CodeWarrior Limit Behavior Standard Minimum Guideline
Number of initial characters in an internal identifier or macro name
Number of initial characters in an external identifier
1024
1024
External identifiers in one translation unit 65536
Identifiers with block scope declared in one block
1024
Macro identifiers simultaneously defined in one translation unit
65536
Parameters in one function definition
Arguments in one function call
Parameters in one macro definition
256
256
256
Arguments in one macro invocation
Characters in one logical source line
Characters in a character string literal or wide string literal (after concatenation)
Size of an object
Nesting levels for # include files
256
65536
65536
262144
256
16384
Case labels for a switch statement
(excluding those for any nested switch statements)
Data members in a single class, structure, or union
Enumeration constants in a single enumeration
Levels of nested class, structure, or union definitions in a single structdeclaration-list
Functions registered by atexit()
16384
4096
256
Direct and indirect base classes
Direct base classes for a single class
Members declared in a single class
Final overriding virtual functions in a class, accessible or not
Direct and indirect virtual bases of a class
Static members of a class
Friend declarations in a class
Access control declarations in a class
Member initializers in a constructor definition
Scope qualifications of one identifier
32
16384
1024
4096
16384
1024
1024
4096
4096
6144
256
Table continues on the next page...
Unlimited
Unlimited
Unlimited
Unlimited
Unlimited
Unlimited
Unlimited
256
256
Unlimited
Unlimited
2 GB
256
Unlimited
Unlimited
Unlimited
Unlimited
64
Unlimited
Unlimited
Unlimited
Unlimited
Unlimited
Unlimited
Unlimited
Unlimited
Unlimited
Unlimited
CodeWarrior Development Studio for Advanced Packet Processing Build Tools Reference Manual, Rev.
10.2, 01/2016
304 Freescale Semiconductor, Inc.