Home
User Manual
Contents
1. y absolute object file control program Figure 1 1 Development flow Overview 1 5 1 2 1 THE PRELINKER PHASE The C compiler provides a complete prototype implementation of an automatic instantiation mechanism The automatic instantiation mechanism is a linker feedback mechanism It works by providing additional information in the object file that is used by a prelinker to determine which template entities reguire instantiation so that the program can be linked successfully Unlike most aspects of the C compiler the automatic instantiation mechanism is by its nature dependent on certain operating system and object file format properties In particular the prelinker is a separate program that accesses information about the symbols defined in object files At the end of each compilation the C compiler determines whether any template entities were referenced in the translation unit If so an instantiation information file is created referred to for convenience as a ii file If no template entities were referenced in the translation unit the ii file will not be created and any existing file will be removed If an error occurs during compilation the state of the ii file is unchanged Once a complete set of object files has been generated including the appropriate flags the prelinker is invoked to determine whether any new instantiations are reguired or if any existing instantiat
2. Chapter 1 1 4 FILE EXTENSIONS For compatibility with future TASKING Cross Software the following extensions are suggested Source files CC CXX cpp asm lsl C source file input for C compiler C source file input for C compiler C source file input for C compiler C source file input for C compiler or for C compiler if you use the c option of the control program hand written assembly source file input for the assembler linker script file input for the linker Generated source files ic STC Object files obj eln abs elf hex temporary C source file generated by the C compiler input for the C compiler assembly source file generated by the C compiler input for the assembler relocatable ELF DWARF object file generated by the assembler input for the linker object library file relocatable linker output file absolute IEEE 695 output file from the linker absolute ELF DWARF output file from the linker absolute Intel Hex output file from the linker absolute Motorola S record output file from the linker Overview List files lst assembler list file map linker map file Error List files err compiler error messages file ers assembler error messages file elk linker error messages file 1 12 OVERVIEW Chapter 1 LANGUAGE IMPLEMENTATION ail TASKING M dJiLdVHO Language Implementation 2 3 2 1 INTRODU
3. cpml6c no wchar_t keyword test cc 3 114 Chapter 3 wrap diagnostics Option wrap diagnostics no wrap diagnostics Default wrap diagnostics Description Enable or disable a mode in which the error message text is not wrapped when too long to fit on a single line Example cpml6c no wrap diagnostics test cc d gt brief diagnostics Chapter Compiler Diagnostics and Appendix Error Messages Compiler Use 3 115 xref X Option Xxfile xref x ile Arguments The name of the cross reference file Description Generate cross reference information in the file xfile For each reference to an identifier in the source program a line of the form symbol _id name X file name line number column number is written where X is D for definition d for declaration that is a declaration that is not a definition for modification for address taken for used cc gt ez for changed but actually meaning used and modified in a single operation such as an increment w for any other kind of reference or for an error in which the kind of reference is indeterminate symbol id is a unique decimal number for the symbol The fields of the above line are separated by tab characters 3 116 Chapter 3 3 2 INCLUDE FILES You may specify include files in two ways enclosed in lt gt or enclosed in When an include directive is seen the following a
4. distinct template signatures no distinct template signatures Default distinct template signatures Description Control whether the signatures for template functions can match those for non template functions when the functions appear in different compilation units The default is distinct template signatures under which a normal function cannot be used to satisfy the need for a template instance e g a function void f int could not be used to satisfy the need for an instantiation of a template void f T with T set to int no distinct template signatures provides the older language behavior under which a non template function can match a template function Also controls whether function templates may have template paramcters that are not used in the function signature of the function template Example cpml6c no distinct template signatures test cc Compiler Use dollar Option dollar Default No dollar signs are allowed in identifiers Description Accept dollar signs in identifiers Names like A VAR are allowed Example cpml6c test cc 3 37 3 38 Chapter 3 early tiebreaker late tiebreaker Option early tiebreaker late tiebreaker Default early tiebreaker Description Select the way that tie breakers e g cv gualifier differences apply in overload resolution In early tie breaker processing the tie brea
5. 0063 0064 0065 0066 0067 0068 0069 0070 0071 0075 Appendix A bad constant function call function call is not allowed in a constant expression bad integral operator this operator is not allowed in an integral constant expression integer overflow integer operation result is out of range negative shift_count shift count is negative shift count too large shift count is too large useless_decl declaration does not declare anything exp_semicolon 99 expected a enum_value_out_of_int_range enumeration value is out of int range exp rbrace expected a integer_sign_change integer conversion resulted in a change of sign integer_truncated integer conversion resulted in truncation incomplete_type_not_allowed incomplete type is not allowed sizeof_bit_field operand of sizeof may not be a bit field bad_indirection_operand operand of must be a pointer Error Messages A 9 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 empty_macro_argument argument to macro is empty missing decl specifiers this declaration has no storage class or type specifier initializer in param a parameter declaration may not have an initializer exp_ type specifier expected a type specifier storage class_not allowed a storage class may not be specified here mult storage classes
6. 0354 0356 0357 0358 0359 0360 0361 0362 0363 0364 bad arg type for operator new first parameter of allocation function must be of type size_t bad return type for op new allocation function requires void return type bad return type for op delete deallocation function requires void return type bad first arg type for operator delete first parameter of deallocation function must be of type void type must be object type type must be an object type base_class_already_initialized base class type has already been initialized base_class_init_anachronism base class name required type assumed anachronism member_already_initialized entity kind entity has already been initialized missing base_class_or_member_name name of member or base class is missing assignment to this assignment to this anachronism overload_anachronism overload keyword used anachronism anon_union_member_access invalid anonymous union nonpublic member is not allowed anon_union_member_function invalid anonymous union member function is not allowed A 28 0365 0366 0367 0368 0369 0370 0371 0372 0373 0375 0377 0378 0379 Appendix A anon union storage class anonymous union at global or namespace scope must be declared static missing initializer on fields entity
7. 0496 0497 0498 0500 0501 0502 0503 Appendix A instantiation reguested no definition supplied entity kind entity cannot be instantiated no template definition was supplied instantiation_requested_and_specialized entity kind entity cannot be instantiated it has been explicitly specialized no_constructor class type has no constructor no_match_for_type_of_overloaded_function no instance of entity kind entity matches the specified type nonstd_void_param_list declaring a void parameter list with a typedef is nonstandard cfront_name_lookup_bug global entity kind entity used instead of entity kind entity cfront compatibility redeclaration_of_template_param_name template parameter xxxx may not be redeclared in this scope decl_hides_template_parameter declaration of xxxx hides template parameter must_be_prototype_instantiation template argument list must match the parameter list bad extra arg for postfix operator extra parameter of postfix operatorxxxx must be of type int function type reguired an operator name must be declared as a function operator name not allowed operator name is not allowed bad scope for specialization entity kind entity cannot be specialized in the current scope Error Messages A 37 0504 0505 0506 0507 0508 0510 0511 0512 0513 0514 0515 0516 05
8. 0680 0681 0682 0688 const volatile ref init anachronism temporary used for initial value of reference to const volatile anachronism bad const volatile ref init a reference of type type cannot be initialized with a value of type rype const volatile ref init from rvalue initial value of reference to const volatile must be an lvalue cl SVR4 C option only in ansi C SVR4 C compatibility option can be used only when compiling ANSI C using out of scope declaration using out of scope declaration of entity kind entity declared at line xxxx cl strict ansi incompatible_with _SVR4 strict ANSI mode is incompatible with SVR4 C mode cannot inline call call of entity kind ent ty declared at line xxxx cannot be inlined cannot inline entity kind entity cannot be inlined cl_invalid_pch_directory invalid PCH directory exp_except_or_finally expected __ except or _ finally leave_must be in try a __ leave statement may only be used within a __ try not found on pack alignment stack xxxx not found on pack alignment stack A 50 0689 0690 0691 0692 0693 0694 0695 0696 0697 0698 0699 0701 Appendix A empty_pack_alignment_stack empty pack alignment stack cl rtti option only in cplusplus RTTI option can be used only when compiling C inaccessible_elided cctor entity kind entity required
9. 0881 0882 Appendix A bad_multibyte_char invalid multibyte character sequence bad_type_from_instantiation template instantiation resulted in unexpected function type of type the meaning of a name may have changed since the template declaration the type of the template is type ambiguous_guiding decl ambiguous guiding declaration more than one function template entity matches type type non integral operation in templ arg non integral operation not allowed in nontype template argument cl embedded cplusplus_ option only in cplusplus option embedded_c can be used only when compiling C templates_in embedded cplusplus Embedded C does not support templates exceptions_in_embedded_cplusplus Embedded C does not support exception handling namespaces_in_embedded_cplusplus Embedded C does not support namespaces rtti in embedded cplusplus Embedded C does not support run time type information new_cast in embedded cplusplus Embedded C does not support the new cast syntax using decl in embedded cplusplus Embedded C does not support using declarations mutable_in_embedded_cplusplus Embedded C does not support mutable multiple inheritance in embedded cplusplus Embedded C does not support multiple or virtual inheritance Error Messages A 65 0883 0884 0885 0886 0887 0888 0889 0890 0891 0892 0893
10. dupl param name duplicate parameter name id already_declared xxxx has already been declared in the current scope nonstd forward decl enum forward declaration of enum type is nonstandard class_too large class is too large Error Messages A 11 0104 0105 0106 0107 0108 0109 0110 0111 0112 0114 0115 0116 0117 struct_too_large struct or union is too large bad_bit_field_size invalid size for bit field bad_bit_field_type invalid type for a bit field zero_length_bit_field_must_be_unnamed zero length bit field must be unnamed signed one bit field signed bit field of length 1 expr_not ptr to function expression must have pointer to function type exp definition of tag expected either a definition or a tag name code is unreachable statement is unreachable exp_ while expected while never defined entity kind entity was referenced but not defined continue_must_be_in_ loop a continue statement may only be used within a loop break_must_be_in_loop_or_switch a break statement may only be used within a loop or switch no_ value returned in non void function non void entity kind entity declared at line xxxx should return a value A 12 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 Appendix A value returned in void function a void
11. is incompatible with that of overridden entity kind entity implicit call of ambiguous name entity implicitly called from entity kind entity is ambiguous A 56 0770 0771 0772 0773 0774 0775 0776 0777 0778 0779 0780 0781 Appendix A cl explicit option only in cplusplus option explicit can be used only when compiling C explicit not allowed explicit is not allowed conflicts_with_predeclared type info declaration conflicts with xxxx reserved class name array member initialization only is allowed as initializer for array entity kind entity virtual function template virtual is not allowed in a function template declaration anon union class member template invalid anonymous union class member template is not allowed template_ depth mismatch template nesting depth does not match the previous declaration of entity kind entity multiple_template_decls_not_allowed this declaration cannot have multiple template lt gt clauses cl_old_for_init_option_only_in_cplusplus option to control the for init scope can be used only when compiling C redeclaration of for init decl name xxxx declared in for loop initialization may not be redeclared in this scope hidden by_old for init reference is to entity kind entity declared at line xxxx under old for init scoping rules it wo
12. may not be specified here redecl changes access redeclaration of entity kind entity alters its access gualified name reguired a class or namespace gualified name is reguired implicit int on main return type int omitted in declaration of function main invalid inheritance kind for class pointer to member representation xxxx is too restrictive for entity kind entity implicit_return_from_non_void_function missing return statement at end of non void entity kind entity duplicate using decl duplicate using declaration of entity ignored A 70 0958 0959 0960 0961 0962 0964 0965 0966 0967 0968 0969 0970 Appendix A unsigned enum bit field with signed enumerator enum bit fields are always unsigned but enum type includes negative enumerator cl_class_name_injection_option_only_in_cplusplus option class_name_injection can be used only when compiling C cl arg dependent lookup_option_only_in cplusplus option arg_dep_lookup can be used only when compiling C cl friend injection option only in cplusplus option friend injection can be used only when compiling C invalid name after template name following template must be a member template local class friend reguires_prior decl nonstandard local class friend declaration no prior declaration in the enclosing scope nonstd default
13. new for init old for init Option new for init old for init Default new for init Description Control the scope of a declaration in a for init statement The old cfront compatible scoping rules mean the declaration is in the scope to which the for statement itself belongs the new standard conforming rules in effect wrap the entire for statement in its own implicitly generated scope Example cpml6c old for init test cc Compiler Use no code gen n Option n no code gen Description Do syntax checking only Do not generate a C file Example cpml6c no code gen test cc 3 73 3 74 Chapter 3 no line commands P Option P no line commands Description Do preprocessing only Write preprocessed text to the preprocessing output file with comments removed and without line control information When you use the P option use the output option to separate the output from the header produced by the compiler Example cpml6c P output preout test cc d gt comments C preprocess E dependencies M Compiler Use 3 75 nonconst ref anachronism Option nonconst ref anachronism no nonconst ref anachronism Default nonconst ref anachronism Description Enable or disable the anachronism of allowing a reference to nonconst to bind to a class rvalue of the right type This anachronism is also enabled by
14. no pch messages When the pch verbose option is used the C compiler will display a message for each precompiled header file that is considered that cannot be used giving the reason that it cannot be used In automatic mode i e when pch is used the C compiler will deem a precompiled header file obsolete and delete it under the following circumstances e if the precompiled header file is based on at least one out of date header file but is otherwise applicable for the current compilation or e if the precompiled header file has the same base name as the source file being compiled e g xxx pch and xxx cc but is not applicable for the current compilation e g because of different command line options This handles some common cases other PCH file clean up must be dealt with by other means e g by the user Support for precompiled header processing is not available when multiple source files are specified in a single compilation an error will be issued and the compilation aborted if the command line includes a request for precompiled header processing and specifies more than one primary source file 2 8 2 MANUAL PRECOMPILED HEADER PROCESSING Command line option create pch file name specifies that a precompiled header file of the specified name should be created Command line option use pch file name specifies that the indicated precompiled header file should be used for this compilation if it is
15. not a type name xxxx is not a type name cl cannot _open_ pch input file cannot open precompiled header input file invalid pch file precompiled header file xxxx is either invalid or not generated by this version of the compiler pch_curr_directory_changed precompiled header file xxxx was not generated in this directory pch header files have_changed header files used to generate precompiled header file xxxx have changed pch cmd line option mismatch the command line options do not match those used when precompiled header file xxxx was created pch file prefix mismatch the initial seguence of preprocessing directives is not compatible with those of precompiled header file xxxx unable_to get mapped memory unable to obtain mapped memory A 46 0632 0633 0634 0635 0636 0637 0638 0639 0640 0641 0642 0643 Appendix A using pch xxxx using precompiled header file xxxx creating pch xxxx creating precompiled header file xxxx memory mismatch memory usage conflict with precompiled header file xxxx cl invalid pch size invalid PCH memory size cl pch must be first PCH options must appear first in the command line out of memory during pch allocation insufficient memory for PCH memory allocation cl pch incompatible_with multiple inputs precompiled header files may not be used when compiling several input f
16. 3 32 Chapter 3 define D Option Dmacro parm iist def define macro parm liist de Arguments The macro you want to define and optionally its definition Description Define macro to the preprocessor as in define If def is not given is absent 1 is assumed Function style macros can be defined by appending a macro parameter list to name Any number of symbols can be defined The definition can be tested by the preprocessor with if ifdef and ifndef for conditional compilations Example cpml6c DNORAM DPI 3 1416 test cc d gt undefine U Compiler Use 3 33 dependencies M Option M dependencies Description Do preprocessing only Instead of the normal preprocessing output generate on the preprocessing output file a list of dependency lines suitable for input to a make utility When implicit inclusion of templates is enabled the output may indicate false but safe dependencies unless no preproc only is also used When you use the control program you have to use the Em option instead to obtain the same result Examples cpml6c M test cc test ic test cc d gt preprocess E no line commands P 3 34 Chapter 3 diag option Option diag suppress ag ag diag remark ag ag diag warning tag tag diag error tag tag Arguments A mnemonic error tag or an error number Descript
17. The line has the form S file name line number column number message text where S is R W E or C as explained above Errors at the end of file indicate the last line of the primary source file and a column number of zero Command line errors are catastrophes with an empty file name and a line and column number of zero Internal errors are catastrophes with position information as usual and message text beginning with internal error When a diagnostic displays a list e g all the contending routines when there is ambiguity on an overloaded call the initial diagnostic line is followed by one or more lines with the same overall format code letter file name line number column number and message text but in which the code letter is the lower case version of the code letter in the initial line The source position in such lines is the same as that in the corresponding initial line Example To write raw listing information to the file test lst enter cpml6c L test lst test cc 3 68 Chapter 3 long lifetime temps short lifetime temps Option long lifetime temps short lifetime temps Default long lifetime temps cfront short lifetime temps standard C Description Select the lifetime for temporaries short means to end of full expression long means to the earliest of end of scope end of switch clause or the next label Short is standard C and long is what cfront
18. exceptions no exceptions X embedded c embedded no embedded enum overloading no enum overloading explicit no explicit extern inline no extern inline implicit extern c type conversion no implicit extern c type conv ersion suppress typeinfo vars suppress vtbl Compiler Use Description Option Force definition of virtual function tables Enable or disable anachronisms Enable or disable the anachronism of accepting a copy assignment operator with a base class as a default for the derived class Enable or disable the anachronism of allowing a reference to nonconst to bind to a class rvalue of the right type Use or do not use a non standard template argument deduction method Allow or disallow unqualified name in non member using declaration Perform argument dependent lookup of unqualified function names Add class name to the scope of the class Control the visibility of friend declarations Early or late handling of tie breakers in overload resolution Enable or disable support for array new and delete Enable or disable support for namespaces New style for scoping rules Old style for scoping rules Enable or disable implicit use of the std namespace when standard header files are included Enable or disable support for RTTI run time type information Enable or disable recognition of bool Enable or disable re
19. in a function definition a type qualifier on a void return type is not allowed static data member not allowed static data member declaration is not allowed in this class invalid declaration template instantiation resulted in an invalid function declaration A 60 0819 0820 0821 0822 0824 0825 0826 0827 0828 0829 0830 0831 Appendix A ellipsis_not_allowed is not allowed cl_extern_inline_option_only_in_cplusplus option extern_inline can be used only when compiling C extern inline never defined extern inline entity kind entity was referenced but not defined invalid_destructor_name invalid destructor name for type type ambiguous_ destructor destructor reference is ambiguous both entity kind entity and entity kind entity could be used virtual inline never defined virtual inline entity kind entity was never defined unreferenced_function_param entity kind entity was never referenced union_already_initialized only one member of a union may be specified in a constructor initializer list no array new and delete support support for new and delete is disabled double for long double double used for long double in generated C code no_corresponding delete entity kind entity has no corresponding operator deletexxxx to be called if an exception is thrown during
20. unknown external linkage specification incompatible linkage specifier linkage specification is incompatible with previous entity declared at line xxxx A 26 0338 0339 0340 0341 0342 0343 0344 0345 0346 0347 0348 0349 0350 Appendix A overloaded function linkage more than one instance of overloaded function entity has C linkage ambiguous_default_constructor class type has more than one default constructor temp_used_for_ref_init value copied to temporary reference to temporary used nonmember_operator_not_allowed operatorxxxx must be a member function static member operator not allowed operator may not be a static member function too many args for conversion no arguments allowed on user defined conversion too many_args_for operator too many parameters for this operator function too few args for operator too few parameters for this operator function no params with class type nonmember operator reguires a parameter with class type default arg expr not allowed default argument is not allowed ambiguous user defined conversion more than one user defined conversion from type to type applies no matching operator function no operator xxxx matches these operands ambiguous_operator_function more than one operator xxxx matches these operands Error Messages A 27 0351 0352 0353
21. Compiler Use 3 29 comments C Option C comments Description Keep comments in the preprocessed output This should be specified after either preprocess or no line commands it does not of itself reguest preprocessing output Example To do preprocessing only with comments and with line control information enter cpml6c E C test cc d gt preprocess E no line commands P 3 30 Chapter 3 const string literals Option const string literals no const string literals Default const string literals Description Control whether C string literals and wide string literals are const as required by the standard or non const as was true in earlier versions of the C language Example cpml6c no const string literals test cc Compiler Use 3 31 create pch Option create pch filename Arguments A filename specifying the precompiled header file to create Description If other conditions are satisfied see the Precompiled Headers section create a precompiled header file with the specified name If pch automatic PCH mode or use pch appears on the command line following this option its effect is erased Example To create a precompiled header file with the name test pch enter cpl6c create pch test pch test cc d gt pch uuse pch Section Precompiled Headers in chapter Language Implementation
22. Example cpml6c exceptions test cc Compiler Use 3 45 explicit Option explicit no explicit Default explicit Description Enable or disable support for the explicit specifier on constructor declarations Example To disable support for the explicit specifier on constructor declarations enter cpml6c no explicit test cc 3 46 Chapter 3 extended variadic macros Option extended variadic macros no extended variadic macros Default no extended variadic macros Description Allow or disallow macros with a variable number of arguments implies variadic macros and alow or disallow the naming of the variable argument list Example cpml6c extended variadic macros test cc d gt variadic macros Compiler Use extern inline Option extern inline no extern inline Default extern inline Description Enable or disable support for inline functions with external linkage in C When inline functions are allowed to have external linkage as reguired by the standard then extern and inline are compatible specifiers on a non member function declaration the default linkage when inline appears alone is external that is inline means extern inline on non member functions and an inline member function takes on the linkage of its class which is usually external However when inline functions have only internal linkage as specifie
23. To disable overloading builtin operations on enum typed operands enter cpml6c no enum overloading test cc 3 42 Chapter 3 error limit e Option enumber error limit number Arguments An error limit number Default error limit 100 Description Set the error limit to number The C compiler will abandon compilation after this number of errors remarks and warnings are not counted toward the limit By default the limit is 100 Example When you want compilation to stop when 10 errors occurred enter cpml6c e10 test cc Compiler Use 3 43 error output Option error output efile Arguments The name for an error output file Description Redirect the output that would normally go to stderr that is diagnostic messages to the file efile This option is useful on systems where output redirection of files is not well supported If used this option should probably be specified first in the command line since otherwise any command line errors for options preceding the error output would be written to stderr before redirection Example To write errors to the file test err instead of stderr enter cpml6c error output test err test cc 3 44 Chapter 3 exceptions x Option x exceptions no exceptions Default no exceptions Description Enable or disable support for exception handling x is eguivalent to exceptions
24. cpml6c I proj include test cc d gt Section 3 2 Include Files sys include Compiler Use 3 61 include file Option include file filename Arguments The name of the file to be included at the beginning of the compilation Description Include the source code of the indicated file at the beginning of the compilation This can be used to establish standard macro definitions etc The filename is searched for in the directories on the include search list Example cpml6c include file extra h test cc d gt Section 3 2 Include Files 3 62 inlining Option inlining no inlining Default inlining Description Enable or disable minimal inlining of function calls Example To disable function call inlining enter cpml6c no inlining test cc Chapter 3 Compiler Use 3 63 instantiate t Option tmode instantiate mode Pragma instantiate mode Arguments The instantiation mode which can be one of none used all local Default tnone Description Control instantiation of external template entities External template entities are external that is noninline and nonstatic template functions and template static data members The instantiation mode determines the template entities for which code should be generated based on the template definition none Instantiate no template entities This is the default used In
25. libcps a libcplx a C library with exception handling libcpmx a libcpsx a libstll a STLport library libstlm a libstls a libstllx a STLport library with exception handling libstlmx a libstlsx a RSC libraries Library to link Description libcp a C library libcpx a C library with exception handling libstl a STLport library libstlx a STLport library with exception handling 2 3 C LANGUAGE EXTENSION KEYWORDS The C compiler supports the same language extension keywords as the C compiler These language extensions are enabled by default embedded but you can disable them by specifying the no embedded command line option When A is used the extensions will be disabled The following language extensions are supported _ bit You can use data type __ bit for the type definition of scalars in the M16C bit addressable area and for the return type of functions Language Implementation 2 5 at You can specify a variable to be at an absolute address memory type gualifiers Apart from a memory category extern static you can specify a memory type in each declaration This way you obtain a memory model independent addressing of variables in several address ranges _ near far paged _ rom __sfr Memory type qualifier for the declaration of Special Function Registers inline C functions You can specify to inline a function bod
26. 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 extra_text_in_pp_directive extra text after expected end of preprocessing directive illegal source file name xxxx is not a valid source file name exp_rbracket expected a exp rparen expected a extra_chars_on_number extra text after expected end of number undefined identifier identifier xxxx is undefined useless_type_qualifiers type qualifiers are meaningless in this declaration bad_hex_digit invalid hexadecimal number integer_too_large integer constant is too large bad_octal_digit invalid octal digit zero_length_ string quoted string should contain at least one character too_many_characters too many characters in character constant bad_character_value character value is out of range expr_not_constant expression must have a constant value 0029 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 Appendix A exp_ primary_expr expected an expression bad float_value floating constant is out of range expr_not integral expression must have integral type expr not arithmetic expression must have arithmetic type exp line number expected a line number bad line number invalid line number error directive error directive xxxx missing pp if the if for this directive is missing missing endif the endi
27. 30 no distinct template signatures 3 36 no embedded 3 39 no enum overloading 3 41 no exceptions 3 44 no explicit 3 45 no extended variadic macros 3 46 no extern inline 3 47 Index Index 7 no for inil diff warning 3 51 no friend injection 3 53 no guiding decls 3 55 no implicit extern c type convers ion 3 56 no implicit include 3 57 no implicit typename 3 58 no inlining 3 62 no line commands 3 74 no long preserving rules 3 69 no namespaces 3 71 no nonconst ref anachronism 3 75 no nonstd qualifier deduction 3 76 no nonsid using decl 3 77 no old specializations 3 82 no preproc only 3 78 no remove unneeded entities 3 94 no rtti 3 95 no special subscript cost 3 97 no tsw diagnostics 3 104 no typename 3 105 no use before sel warnings 3 79 no using sid 3 110 no variadic macros 3 111 mo warnings 3 80 no wchar_t keyword 3 113 no wrap diagnostics 3 114 nonconst ref anachronism 3 75 nonstd qualifier deduction 3 76 nonsid using decl 3 77 old for init 3 72 old line commands 3 81 old pecializalions 3 82 old style preprocessing 3 83 one instantiation per object 3 84 output 3 85 pcb 3 86 pch dir 3 87 pch messages 3 88 pch verbose 3 89 pending insiantiations 3 90 preproce
28. C Issue warnings on non ANSI features Suppress type info variables in generated C Suppress definition of virtual function tables Look in directory dir for system include files Generate compilation timing information Preprocess only Generate list of included files Enable or disable TASKING style diagnostic messages Enable or disable recognition of typename 3 10 Chapter 3 Option Description undefine macro Umacro unsigned chars u use pch file using std no using std variadic macros no variadic macros version V vV wchar_t keyword no wchar_t keyword wrap diagnostics no wrap diagnostics xref xfile X xfile Remove preprocessor macro Treat all char variables as unsigned Use a precompiled header file of the specified name Enable or disable implicit use of the std namespace when standard header files are included Allow or disallow macros with a variable number of arguments Display version header only Enable or disable recognition of wchar_t as a keyword Enable or disable wrapping of diagnostic messages Generate cross reference file xfile Table 3 1 Compiler options alpbabetical Description Option Include options Look in dir for include files Look in dir for system include files Set the valid suffixes for include files Include file at the beginning of the compilatio
29. Enable or disable a shorter form of diagnostic output Enable or disable TASKING style diagnostic messages Enable or disable wrapping of diagnostic messages Enable or disable warning when old style or scoping is used 3 1 1 error limit number enumber remarks r no warnings W no use before set warnings J brief diagnostics no brief diagnostics tsw diagnostics no tsw diagnostics wrap diagnostics no wrap diagnostics for init diff warning no for init diff warning Table 3 2 Compiler options functional DETAILED DESCRIPTION OF THE COMPILER OPTIONS Option letters are listed below If the same option is used more than once the first most left occurrence is used The placement of command line options is of no importance except for the I option Some options also have a_ no form These options are described together Compiler Use Option Description Display an explanation of options at stdout Example cpml6c 3 18 Chapter 3 alternative tokens Option alternative tokens no alternative tokens Default alternative tokens Description Enable or disable recognition of alternative tokens This controls recognition of the digraph tokens in C and controls recognition of the operator keywords e g not and bitand etc Example To disable operator keywords e g not a
30. Implicit inclusions are only performed during the normal compilation of a file i e not when doing only preprocessing A common means of investigating certain kinds of problems is to produce a preprocessed source file that can be inspected When using implicit inclusion it is sometimes desirable for the preprocessed source file to include any implicitly included files This may be done using the no preproc only command line option This causes the preprocessed output to be generated as part of a normal compilation When implicit inclusion is being used the implicitly included files will appear as part of the preprocessed output in the precise location at which they were included in the compilation Language Implementation 2 35 2 7 PREDE FINED MACROS The C compiler defines a number of preprocessing macros Many of them are only defined under certain circumstances This section describes the macros that are provided and the circumstances under which they are defined All C predefined macros are also defined _ STDC __ _ FILE _ _ LINE _ _ TIME _ _ DATE _ _ CPM16C _ Defined in ANSI C mode and in C mode In C mode the value may be redefined Not defined when embedded C is used current source filename current source line number int type hh mm ss Mmm dd yyyy Identifies the C compiler _ LITTLE ENDIAN __ Expands to 1 indicating the processor accesses data in little endian _
31. a definition to instantiate a template entity declared in a h file it can implicitly include the corresponding cc file to get the source code for the definition For example if a template entity ABC f is declared in file xyz h and an instantiation of ABC f is required in a compilation but no definition of ABC f appears in the source code processed by the compilation the compiler will look to see if a file xyz cc exists and if so it will process it as if it were included at the end of the main source file To find the template definition file for a given template entity the C compiler needs to know the full path name of the file in which the template was declared and whether the file was included using the system include syntax e g include lt file h gt This information is not available for preprocessed source containing fl ine directives Consequently the C compiler will not attempt implicit inclusion for source code containing line directives By default the list of definition file suffixes tried is cc cpp and cxx If force c is supplied to the control program ccm16c c is also used as C file Implicit inclusion works well alongside automatic instantiation but the two are independent They can be enabled or disabled independently and implicit inclusion is still useful when automatic instantiation is not done The implicit inclusion mode can be turned on by the command line option implicit include
32. arg specifying a default argument on this declaration is nonstandard cl nonstd using decl option only in cplusplus option nonstd using decl can be used only when compiling C bad return type_on main return type of function main must be int template_parameter_has_class type a template parameter may not have class type default arg on member decl a default template argument cannot be specified on the declaration of a member of a class template return from ctor function try_block handler a return statement is not allowed in a handler of a function try block of a constructor Error Messages A 71 0971 0972 0973 0974 0975 0976 0977 0978 0979 0980 0981 0982 0983 no ordinary and extended designators ordinary and extended designators cannot be combined in an initializer designation no negative designator range the second subscript must not be smaller than the first cl designators_option_only_in C option designators can be used only when compiling C cl extended designators_option only in C option extended designators can be used only when compiling C extra_bits ignored declared size for bit field is larger than the size of the bit field type truncated to xxxx bits constructor type mismatch type used as constructor name does not match type type type_with no linkage in var with linkage use of a type with no linkag
33. as illustrated in the following example int al int bl struct A static int al class B static int bl friend void f int il al cfront uses A al int jl bl cfront uses global bl h h operator may be declared as a nonmember function This is flagged as an anachronism by cfront 2 1 A type gualifier is allowed but ignored on the declaration of a constructor or destructor For example class A A const No error in cfront 2 1 mode Language Implementation 2 17 2 4 6 EXTENSIONS ACCEPTED IN CFRONT 2 1 AND 3 0 COMPATIBILITY MODE The following extensions are accepted in both cfront 2 1 and cfront 3 0 compatibility mode i e these are features or problems that exist in both cfront 2 1 and 3 0 Type gualifiers on the this parameter may to be dropped in contexts such as this example struct A void const h void A fp amp A f This is actually a safe operation A pointer to a const function may be put into a pointer to non const because a call using the pointer is permitted to modify the object and the function pointed to will actually not modify the object The opposite assignment would not be safe Conversion operators specifying conversion to void are allowed A nonstandard friend declaration may introduce a new type A friend declaration that omits the elaborated type specifier is allowed in default mode but in cfront mode the declaration is also al
34. cases e g even when the type is exactly right without conversion A reference to a non const type may be initialized from a value that is a const gualified version of the same type but only if the value is the result of selecting a member from a const class object or a pointer to such an object The cfront 2 1 transitional model for nested type support is simulated In the transitional model a nested type is promoted to the file scope unless a type of the same name already exists at the file scope It is an error to have two nested classes of the same name that need to be promoted to file scope or to define a type at file scope after the declaration of a nested class of the same name This feature actually restricts the source language accepted by the compiler This is necessary because of the effect this feature has on the name mangling of functions that use nested types in their signature This feature does not apply to template classes 2 14 Chapter 2 A cast to an array type is allowed it is treated like a cast to a pointer to the array element type A warning is issued When an array is selected from a class the type gualifiers on the class object if any are not preserved in the selected array In the normal mode any type gualifiers on the object are preserved in the element type of the resultant array An identifier in a function is allowed to have the same name as a parameter of the function A warning is iss
35. constant expression bad compound literal type a compound literal of type type is not allowed friend template in local class a template friend declaration cannot be declared in a local class ambiguous_question_operator ambiguous operation second operand of type type can be converted to third operand type type and vice versa bad_call_of_class_object call of an object of a class type without appropriate operator or conversion functions to pointer to function type Error Messages A 73 0997 0998 0999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 surrogate func add on surrogate function from conversion name ambiguous_ class call there is more than one way an object of type type can be called for the argument list expected asm before _endasm pragma expected a pragma asm before pragma endasm end of source reached before pragma endasm end of source reached while searching for pragma endasm similar _typedef typedef name has already been declared with similar type no internal linkage for new_or delete operator new and operator delete cannot be given internal linkage no mutable allowed _on anonymous_ union storage class mutable is not allowed for anonymous unions bad_pch_file invalid precompiled header file abstract_class_catch_type abstract class type type is not allowed as catch type bad gua
36. files Write preprocess output in file Automatically use and or create a precompiled header file Specify directory dir in which to search for and or create a precompiled header file Enable or disable the display of a message indicating that a precompiled header file was created or used in the current compilation Generate a message when a precompiled header file cannot be used Maximum number of instantiations for a single template default 64 Preprocess only Keep line control information and remove comments Select R8C core instead of M16C Compiler Use Option Description remarks r remove unneeded entities no remove unneeded entities rtti no rtti signed chars s special subscript cost no special subscript cost strict A strict warnings a suppress typeinfo vars suppress vtbl sys include dir timing trace includes H tsw diagnostics no tsw diagnostics typename no typename Issue remarks Enable or disable the removal of unneeded entities from the generated intermediate C file Enable or disable support for RTTI run time type information Treat all char variables as signed Enable or disable a special nonstandard weighting of the conversion to the integral operand of the operator in overload resolution Strict ANSI C Issue errors on non ANSI features Strict ANSI
37. function may not return a value cast_to_bad type cast to type type is not allowed bad return value type return value type does not match the function type case label must be in switch a case label may only be used within a switch default label must be in switch a default label may only be used within a switch case label appears more than once case label value has already appeared in this switch default label appears more_than_ once default label has already appeared in this switch exp_ lparen expected a C expr not an lvalue expression must be an lvalue exp_ statement expected a statement loop not reachable loop is not reachable from preceding code block scope_function must _be_extern a block scope function may only have extern storage class exp_lbrace expected a expr_not_ptr_to_class expression must have pointer to class type Error Messages A 13 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 expr not ptr to struct_or union expression must have pointer to struct or union type exp member name expected a member name exp field name expected a field name not a member entity kind entity has no member xxxx not a field entity kind entity has no field xxxx expr not a modifiable lvalue expression must be a modifiable lvalue address_of regis
38. gt should begin That is the search for lt gt names should only consider directories named in I or include directory options following the I and the directories of items 3 and 4 above I also removes the directory containing the current input file item 1 above from the search path for file names enclosed in 09 An include directory specified with the sys include option is considered a system include directory Warnings are suppressed when processing files found in system include directories If the filename has no suffix it will be searched for by appending each of a set of include file suffixes When searching in a given directory all of the suffixes are tried in that directory before moving on to the next search directory The default set of suffixes is no extension h and hpp The default can be overridden using the incl suffixes command line option A null file suffix cannot be used unless it is present in the suffix list that is the C compiler will always attempt to add a suffix from the suffix list when the filename has no suffix Compiler Use 3 119 3 3 PRAGMAS According to ANSI 3 8 6 a preprocessing directive of the form pragma pragma token list new line causes the compiler to behave in an implementation defined manner The compiler ignores pragmas which are not mentioned in the list below Pragmas give directions to the code generator of the compiler Besides the pragmas the
39. has a default operator deletexxxx but no operator Newxxxx base_class_with_nonvirtual_dtor destructor for base class type is not virtual member_function_redeclaration entity kind entity has already been declared inline_main function main may not be declared inline class_and_member_function_name_conflict member function with the same name as its class must be a constructor nested_class_anachronism using nested entity kind entity anachronism too_many_params_for_destructor a destructor may not have parameters bad_constructor_param copy constructor for class type may not have a parameter of type type Error Messages A 31 0409 0410 0411 0412 0413 0414 0415 0416 0417 0418 0424 0425 0426 incomplete function return type entity kind entity returns incomplete type type protected_access_problem protected entity kind entity is not accessible through a type pointer or object param_not_allowed a parameter is not allowed asm_decl_not_allowed an asm declaration is not allowed here no conversion function no suitable conversion function from type to type exists delete_of incomplete_class delete of pointer to incomplete class no_constructor for conversion no suitable constructor exists to convert from type to type ambiguous_constructor_for_conversion more th
40. initialization of an allocated object useless_placement_delete support for placement delete is disabled Error Messages A 61 0832 0833 0834 0835 0836 0837 0838 0840 0841 0842 0843 0844 no_appropriate_ delete no appropriate operator delete is visible ptr_or_ref_to_incomplete_type pointer or reference to incomplete type is not allowed bad_partial_specialization invalid partial specialization entity kind entity is already fully specialized incompatible _exception_specs incompatible exception specifications returning ref to local variable returning reference to local variable nonstd implicit int omission of explicit type is nonstandard int assumed ambiguous_ partial spec more than one partial specialization matches the template argument list of entity kind entity partial spec is primary_template a template argument list is not allowed in a declaration of a primary template default_not_allowed_on_partial_spec partial specializations may not have default template arguments not_used_in_partial_spec_arg list entity kind entity is not used in template argument list of entity kind entity partial_spec_param_depends_on_templ_param the type of partial specialization template parameter entity kind entity depends on another template parameter partial spec arg depends _on_templ_param the template argument list of the partial spe
41. instead of by address code like this compiled in cfront mode is not calling seguence compatible with the same code compiled in normal mode In practice this is not much of a problem since classes that allow bitwise copying usually do not have destructors e A union member may be declared to have the type of a class for which you have defined an assignment operator as long as the class has no constructor or destructor A warning is issued e When an unnamed class appears in a typedef declaration the typedef name may appear as the class name in an elaborated type specifier typedef struct int i j S struct S x No error in cfront mode e Two member functions may be declared with the same parameter types when one is static and the other is non static with a function qualifier class A void f int const static void f int No error in cfront mode e The scope of a variable declared in the for init statement is the scope to which the for statement belongs int f int i for int j 0 j lt i j return j No error in cfront mode e Function types differing only in that one is declared extern C and the other extern C can be treated as identical 2 22 Chapter 2 typedef void PF extern C typedef void PCF void f PF void f PCF PF and PCF are considered identical and void f PCF is treated as a compatible redeclaration of f By contrast in standa
42. is allowed e mutable is accepted on non static data member declarations e Namespaces are implemented including using declarations and directives Access declarations are broadened to match the corresponding using declarations e Explicit instantiation of templates is implemented e The typename keyword is recognized e explicit is accepted to declare non converting constructors e The scope of a variable declared in the for init statement of a for loop is the scope of the loop not the surrounding scope e Member templates are implemented 2 8 Chapter 2 The new specialization syntax using template lt gt is implemented Cv gualifiers are retained on rvalues in particular on function return values The distinction between trivial and nontrivial constructors has been implemented as has the distinction between PODs and non PODs with trivial constructors The linkage specification is treated as part of the function type affecting function overloading and implicit conversions extern inline functions are supported and the default linkage for inline functions is external A typedef name may be used in an explicit destructor call Placement delete is implemented An array allocated via a placement new can be deallocated via delete Covariant return types on overriding virtual functions are supported enum types are considered to be non integral types Partial specialization of class templates is impleme
43. linkage conflict with previous declaration float to integer conversion floating point value does not fit in required integral type expr_has_no effect expression has no effect subscript out of range subscript out of range declared but not referenced entity kind entity was declared but never referenced pcc address of array amp applied to an array has no effect mod by_zero right operand of is zero old style incompatible_param argument is incompatible with formal parameter printf arg mismatch argument is incompatible with corresponding format string conversion empty include search path could not open source file xxxx no directories in search list cast_not integral type of cast must be integral cast_not scalar type of cast must be arithmetic or pointer initialization not reachable dynamic initialization in unreachable code Error Messages A 17 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0219 0220 0221 unsigned_compare_with_zero pointless comparison of unsigned integer with zero assign_where_compare_meant use of where may have been intended mixed_enum_type enumerated type mixed with another type file_write_error error while writing xxxx file bad_il_file invalid intermediate language file cast_to_qualified_type type qualifier is meaningless on cast type unrecognized_c
44. more than one storage class may not be specified storage class not first storage class is not first dupl type gualifier type gualifier specified more than once bad combination of type specifiers invalid combination of type specifiers bad param storage class invalid storage class for a parameter bad function storage class invalid storage class for a function type_specifier not allowed a type specifier may not be used here array_of function array of functions is not allowed array_of_void array of void is not allowed A 10 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 Appendix A function_returning function function returning function is not allowed function_returning array function returning array is not allowed param_id_list_needs_function_def identifier list parameters may only be used in a function definition function_type_must_come_from_declarator function type may not come from a typedef array_size_must_be_positive the size of an array must be greater than zero array_size_too_large array is too large empty_translation_unit a translation unit must contain at least one declaration bad_function_return_type a function may not return a value of this type bad_array_element_type an array may not have elements of this type decl_should_be_of_param a declaration here must declare a parameter
45. of remark warning error catastrophic error command line error or internal error If the severity may be overridden the error number will include the suffix D for discretionary otherwise no suffix will be present In a raw listing file L option diagnostic messages have the following layout starting with the severity R remark W warning E error C catastrophe R W E C ilename line number column_number error_message d gt For more detailed information see chapter Compiler Diagnostics All diagnostic messages are listed below A 4 Appendix A 2 MESSAGES 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 last line incomplete last line of file ends without a newline last line_backslash last line of file ends with a backslash include recursion include file xxxx includes itself out_of memory out of memory source file could not_be opened could not open source file xxxx comment unclosed at eof comment unclosed at end of file bad token unrecognized token unclosed string missing closing guote nested comment nested comment is not allowed bad use of sharp not expected here bad pp directive_keyword unrecognized preprocessing directive end of flush parsing restarts here after previous syntax error exp file name expected a file name Error Messages A 5 0014 0016
46. saved in the precompiled header file is assigned to preallocated memory MS Windows two additional restrictions apply e The total memory needed at the header stop point cannot exceed the size of the block of preallocated memory e No single program entity saved can exceed 16384 the preallocation unit When a precompiled header file is produced it contains in addition to the snapshot of the compiler state some information that can be checked to determine under what circumstances it can be reused This includes e The compiler version including the date and time the compiler was built The current directory i e the directory in which the compilation is occurring e The command line options e The initial sequence of preprocessing directives from the primary source file including include directives e The date and time of the header files specified in include directives Language Implementation 2 41 This information comprises the PCH prefix The prefix information of a given source file can be compared to the prefix information of a PCH file to determine whether the latter is applicable to the current compilation As an illustration consider two source files a cc include xxx h ee Start of code b ce include xxx h ER Start of code When a cc is compiled with pch a precompiled header file named a pch is created Then when b cc is compiled or when a cc is recompiled the pre
47. segment name in __ declspec allocate declspec allocate_not allowed __ declspec allocate is not allowed on this declaration dupl allocate_segname a segment name has already been specified pm_virtual base from derived class cannot convert pointer to member of derived class type to pointer to member of base class type base class is virtual cl invalid instantiation_ directory invalid directory for instantiation files cl one instantiation_per object option only in_cplusplus option one instantiation_per object can be used only when compiling C invalid_output_file invalid output file xxxx cannot_open_output_file cannot open output file xxxx cl ii file name incompatible with multiple inputs an instantiation information file name may not be specified when compiling several input files cl one instantiation_per object incompatible_with multiple inputs option one instantiation_per object may not be used when compiling several input files A 68 0923 0925 0926 0927 0928 0929 0930 0931 0932 0941 0942 0943 0944 Appendix A cl ambiguous option more than one command line option matches the abbreviation NNN cv_qualified_function_type a type qualifier cannot be applied to a function type cannot open definition list file cannot open definition list file xxxx cl late tiebreaker option only_in_cplusplus l
48. the anachronisms option and the cfront compatibility options Example cpml6c no nonconst ref anachronism test cc anachronisms cfront 2 1 b cfront 3 0 Section Anachronisms Accepted in chapter Language Implementation 3 76 Chapter 3 nonstd gualifier deduction Option nonstd gualifier deduction no nonstd gualifier deduction Default no nonstd gualifier deduction Description Controls whether nonstandard template argument deduction should be performed in the gualifier portion of a gualified name With this feature enabled a template argument for the template parameter T can be deduced in contexts like A lt T gt B or T B The standard deduction mechanism treats these as nondeduced contexts that use the values of template parameters that were either explicitly specified or deduced elsewhere Example cpml6c nonstd gualifier deduction test cc Compiler Use nonstd using decl Option nonstd using decl no nonstd using decl Default no nonstd using decl Description Controls whether a non member using declaration that specifies an ungualified name is allowed Example cpml6c nonstd using decl test cc 3 77 3 78 Chapter 3 no preproc only Option no preproc only Description May be used in conjunction with the options that normally cause the C compiler to do preprocessing only e g preprocess etc to
49. the files list includes all object files and libraries and the options are Display an explanation of options at stdout V Display version information at stderr c C Use c as symbol prefix character instead of the default underscore D Do not assign instantiation to non local object files Instantiations may only be assigned to object files in the current directory i Ignore invalid input lines lxxx Specify a library e g lcp L Skip system library search B 4 Appendix B L directory Specify an additional search path for system libraries m n o file rf R number s number T cpu Do not demangle identifier names that are displayed Update the instantiation list files ii but do not recompile the source files If a file from a non local directory needs to be recompiled do the compilation in the current directory An updated list of object files and library names is written to the file specified by the o option so that the control program can tell that alternate versions of some of the object files should be used Write an updated list of object files and library names to the file specified by file Use this option when the N or O option is used One instantiation per object mode is used A list of object files including the instantiation object files associated with the object files specified on the prelinker command line is written to the file specified by the o optio
50. 0251 0252 0253 0254 0255 0256 0257 0258 0259 0260 0261 0262 0263 Appendix A reference to_void reference to void is not allowed array_of reference array of reference is not allowed missing initializer on reference reference entity kind entity requires an initializer exp_comma 09 expected a type_identifier_not_allowed type name is not allowed type_definition_not_allowed type definition is not allowed bad_type_name_redeclaration invalid redeclaration of type name entity declared at line xxxx missing initializer on_const const entity kind entity requires an initializer this_used_incorrectly this may only be used inside a nonstatic member function constant_value_not_known constant value is not known missing type_specifier explicit type is missing Cint assumed missing access_specifier access control not specified xxxx by default not a class or struct name not a class or struct name dupl base class name duplicate base class name Error Messages A 21 0264 0265 0266 0267 0268 0269 0274 0276 0277 0278 0279 0280 0281 0282 bad base class invalid base class no access to namc entity kind entity is inaccessible ambiguous_name entity is ambiguous old_style_parameter_list old style parameter list anachronism declaration_af
51. 0479 0481 0482 0484 0485 0486 0487 0488 bad use of member function typedef entity kind entity may be used only in pointer co member declaration nonexternal entity in template arg a template argument may not reference a non external entity id must be class or type name MTD name followed by must be a class name or a type name destructor_name_mismatch destructor name does not match name of class type destructor_type_mismatch type used as destructor name does not match type type called_function_redeclared_inline entity kind entity redeclared inline after being called bad storage class_on template decl invalid storage class for a template declaration no access to type cfront mode entity kind entity is an inaccessible type allowed for cfront compatibility invalid_instantiation_argument invalid explicit instantiation declaration not_instantiatable_entity entity kind entity is not an entity that can be instantiated compiler_generated_function_cannot_be_instantiated compiler generated entity kind entity cannot be explicitly instantiated inline_function_cannot_be_instantiated inline entity kind entity cannot be explicitly instantiated pure_virtual_function_cannot_be_instantiated pure virtual entity kind entity cannot be explicitly instantiated A 36 0489 0490 0491 0493 0494 0495
52. 0894 0896 cl_invalid_microsoft_version invalid Microsoft version number inheritance_kind_already_set pointer to member representation has already been set for entity kind entity bad constructor type type cannot be used to designate constructor for type bad suffix invalid suffix on integral constant uuidof reguires uuid class type operand of __ uuiof must have a class type for which __ declspec uuid has been specified bad uuid string invalid GUID string in _ declspec uuid cl vla option only in C option vla can be used only when compiling C vla_with unspecified bound not allowed variable length array with unspecified bound is not allowed explicit template_args_not allowed an explicit template argument list is not allowed on this declaration variably_modified type not allowed an entity with linkage cannot have a variably modified type vla is not auto a variable length array cannot have static storage duration sym_not a_template entity kind entity is not a template expected template arg expected a template argument A 66 0897 0898 0899 0901 0902 0903 0905 0906 0907 0908 0909 0910 Appendix A explicit template args in expr explicit function template argument lists are not supported yet in expression contexts no params with class or enum type nonmember operator reguires a parameter with class
53. 17 nonstd member function address nonstandard form for taking the address of a member function too few_template_params too few template parameters does not match previous declaration too_many_template_params too many template parameters does not match previous declaration template_operator_delete function template for operator delete void is not allowed class_template_same_name_as_templ_param class template and template parameter may not have the same name unnamed_type_in_template_arg a template argument may not reference an unnamed type enum_type_not_allowed enumerated type is not allowed qualified_reference_type type qualifier on a reference type is not allowed incompatible_assignment_operands a value of type type cannot be assigned to an entity of type type unsigned_compare_with_negative pointless comparison of unsigned integer with a negative constant converting to_incomplete_class cannot convert to incomplete class type missing initializer on unnamed const const object reguires an initializer unnamed object with uninitialized field object has an uninitialized const or reference member A 38 0518 0519 0520 0521 0522 0523 0524 0525 0526 0529 0530 0531 0532 Appendix A nonstd_ pp directive nonstandard preprocessing directive unexpected template arg list entity kind entity may not have a template argument l
54. CTION The TASKING C compiler cpm16c offers a new approach to high level language programming for the M16C family The C compiler accepts the C language as defined by the ISO IEC 14882 1998 standard with the exceptions listed in section 2 4 It also accepts the language extensions of the C compiler This chapter describes the C language extensions and some specific features 2 2 C LIBRARY The TASKING C compiler supports the STLport C libraries STLport is a multiplatform ANSI C Standard Library implementation It is a free open source product wich is delivered with the TASKING C compiler The library supports standard templates and I O streams The include files for the STLport C libraries are present in directory include st1 relative to the product installation directory You can find more information and documentation on the STLport library on the following site http www stlport org doc index html Also read the license agreement on http www stlport org doc license html This license agreement is applicable to the C library only All other product components fall under the TASKING license agreement For an STL Programmer s Guide you can see http www sgi com tech stl index html 2 4 Chapter 2 7 The following C libraries are delivered with the product M16C libraries Library to link Description libcpl a C library for each memory model large medium small libcpm a
55. ES NAMESPACES is the default __TSW_IMPLICIT USING _STD Defined in C mode when the configuration flag RUNTIME USES NAMESPACES is TRUE and when the standard header files should implicitly do a using directive on the std namespace using std _ TSW_CPP _ Always defined Language Implementation 2 37 _ TSW_CPP VERSION _ Defined to an integral value that represents the version number of the C front end For example version 2 43 is represented as 243 __embedded cplusplus Defined as 1 in Embedded C mode 2 38 Chapter 2 2 8 PRECOMPILED HEADERS It is often desirable to avoid recompiling a set of header files especially when they introduce many lines of code and the primary source files that include them are relatively small The C compiler provides a mechanism for in effect taking a snapshot of the state of the compilation at a particular point and writing it to a disk file before completing the compilation then when recompiling the same source file or compiling another file with the same set of header files it can recognize the snapshot point verify that the corresponding precompiled header PCH file is reusable and read it back in Under the right circumstances this can produce a dramatic improvement in compilation time the trade off is that PCH files can take a lot of disk space 2 8 1 AUTOMATIC PRECOMPILED HEADER PROCESSING When pch appears on the command line automatic prec
56. ILE H body of the header file endif The pragma once is marked as optional in this example because the C compiler recognizes the ifndef idiom and does the optimization even in its absence pragma once is accepted for compatibility with other compilers and to allow the programmer to use other guard code idioms This pragma is given in the form pragma ident string or ident string Compiler Use 3 121 3 4 COMPILER LIMITS The ANSI C standard 1 2 2 4 defines a number of translation limits which a C compiler must support to conform to the standard The standard states that a compiler implementation should be able to translate and execute a program that contains at least one instance of every one of the limits listed below The C compiler s actual limits are given within parentheses Most of the actual compiler limits are determined by the amount of free memory in the host system In this case a D Dynamic is given between parentheses Some limits are determined by the size of the internal compiler parser stack These limits are marked with a P Although the size of this stack is 200 the actual limit can be lower and depends on the structure of the translated program e 15 nesting levels of compound statements iteration control structures and selection control structures P gt 15 e 8 nesting levels of conditional inclusion 50 e 12 pointer array and function declarators in any combinati
57. MA299 012 00 00 Doc ver 1 63 M16C v3 1 C Compiler User s Manual A publication of Altium BV Documentation Department Copyright 2005 Altium BV All rights reserved Reproduction in whole or part is prohibited without the written consent of the copyright owner TASKING is a brand name of Altium Limited The following trademarks are acknowledged FLEXlm is a registered trademark of Macrovision Corporation IBM is a trademark of International Business Machines Corp Intel is a trademark of Intel Corporation Motorola is a trademark of Motorola Inc MS DOS and Windows are registered trademarks of Microsoft Corporation SUN is a trademark of Sun Microsystems Inc UNIX is a registered trademark of X Open Company Ltd All other trademarks are property of their respective owners The STLport C library has the following copyrights Copyright 1994 Hewlett Packard Company Copyright 1996 97 Silicon Graphics Computer Systems Inc Copyright 1997 Moscow Center for SPARC Technology Copyright 1999 2000 Boris Fomitchev Data subject to alteration without notice http www tasking com http www altium com The information in this document bas been carefully reviewed and is believed to be accurate and reliable However Altium assumes no liabilities for inaccuracies in this document Furthermore the delivery of this information does not convey to the recipient any license to use or copy the software or doc
58. MODEL _ Identifies for which memory model the module is compiled _ SINGLE FP Defined when you use option F Treat double as float _ M1I6C _ Defined when you select a M16C core _ R8C_ Defined when you select a R8C core r8c _ DSPC __ Identifies conformation to the DSP C standard Expands to 0 DSP C extensions are not supported _ cplusplus Defined in C mode c_plusplus Defined in default C mode but not in strict mode 2 36 Chapter 2 _ STDC VERSION _ Defined in ANSI C mode with the value 199409L The name of this macro and its value are specified in Normative Addendum 1 of the ISO C Standard _ SIGNED CHARS _ Defined when plain char is signed This is used in the lt limits h gt header file to get the proper definitions of CHAR MAX and CHAR MIN _WCHAR_T Defined in C mode when wchar_t is a keyword _BOOL Defined in C mode when bool is a keyword _ ARRAY_OPERATORS Defined in C mode when array new and delete are enabled __ EXCEPTIONS Defined in C mode when exception handling is enabled _ RTTI Defined in C mode when RTTI is enabled _ PLACEMENT_DELETE Defined in C mode when placement delete is enabled __NAMESPACES Defined in C mode when namespaces are supported mamespaces _ TSW_RUNTIME USES NAMESPACES Defined in C mode when the configuration flag RUNTIME USES NAMESPACES is TRUE The name of this predefined macro is specified by a configuration flag _ EDG_RUNTIME US
59. U id cl invalid instantiation mode invalid instantiation mode cl invalid error limit invalid error limit A 42 0579 0580 0581 0582 0583 0584 0585 0586 0587 0588 0589 0590 0591 Appendix A cl invalid raw listing output file invalid raw listing output file cl cannot open raw listing output file cannot open raw listing output file cl invalid xref output file invalid cross reference output file cl cannot_open xref output file cannot open cross reference output file cl invalid error output file invalid error output file cl cannot open error output file cannot open error output file cl vtbl option only in cplusplus virtual function tables can only be suppressed when compiling C cl anachronism option only_in_cplusplus anachronism option can be used only when compiling C cl instantiation option _only_in_cplusplus instantiation mode option can be used only when compiling C cl auto instantiation option only in cplusplus automatic instantiation mode can be used only when compiling C cl implicit inclusion_option_ only_in_cplusplus implicit template inclusion mode can be used only when compiling C cl_exceptions_option_only_in_cplusplus exception handling option can be used only when compiling C cl strict ansi incompatible with pcc strict ANSI mode is incompatible with K amp R mode Error Message
60. When the second form is used there may not be any white space on either side of the eguals sign The priority of the options is left to right when two options conflict the first most left one takes effect The D and lt U options are not considered conflicting options so they are processed left to right for each source file You can overrule the default output file name with the gen c file name option A summary of the options is given below The next section describes the options in more detail Option Description Display invocation syntax alternative tokens no alternative tokens Enable or disable recognition of alternative tokens Chapter 3 Option Description anachronisms no anachronisms arg dep lookup no arg dep lookup array new and delete no array new and delete auto instantiation no auto instantiation T base assign op is default no base assign op is default bool no bool brief diagnostics no brief diagnostics cfront 2 1 b cfront 3 0 class name injection no class name injection comments C Ccpu const string literals no const string literals create pch file define macro parm list def Dmacro parm list def Enable or disable anachronisms Perform argument dependent lookup of unqualified function names Enable or disable support for array new
61. _ ARRAY OPERATORS 2 36 3 106 __cplusplus 2 35 3 106 __CPMI16C__ 2 35 __ DATE _ 2 35 3 106 _ DSPC__ 2 35 _ EXCEPTIONS 2 36 __ FILE 2 35 3 106 _ LINE_ 2 35 3 106 _ LITTLE ENDIAN _ 2 35 _ M16C_ 2 35 _ MODEL 2 35 __ NAMESPACES 2 36 __PLACEMENT_DELETE 2 36 __R8C__ 2 35 __RTTI 2 36 _ SIGNED CHARS__ 2 36 3 96 3 106 SINGLE FP__ 2 35 STDC__ 2 35 3 106 __STDC_VERSION _ 2 36 __TIME _ 2 35 3 106 __TSW_IMPLICIT_USING_STD 2 36 _ TSW_RUNTIME USES NAMESPACES 2 36 _BOOL 2 36 3 106 _ WCHAR T 2 36 3 106 A alternative tokens 3 18 anachronism 2 9 anachronisms 3 19 3 27 3 75 ansi standard 3 106 array new and delete 3 21 automatic instantiation 1 5 automatic instantiation method 2 28 bool keyword 3 24 C language extensions 2 4 2 6 library 2 3 C dialect 2 4 2 6 accepted 2 6 anachronisms accepted 2 9 cfront 2 1 and 3 0 extensions 2 17 cfront 2 1 extensions 2 13 new language features accepted 2 6 new language features not accepted 2 9 normal C mode extensions 2 11 not accepted 2 9 C language features accepted 2 6 not accepted 2 9 c_plusplus 2 35 3 106 can_instantiate 3 119 catastrophic error 4 3 cfront 3 27 2 1 and 3 0 extensions 2 17 2 1 extensions 2 13 character signed 3 96 unsigned 3 108 class name injection 3 28 command file 3 49 compiler diagnostics 4 1 compiler limits 3 121 compiler use 3 1 const string literals 3 30 Index 4 co
62. _comma or gt 9 expected a or gt missing template_param_list expected a template parameter list incr of bool deprecated incrementing a bool value is deprecated bool type not allowed bool type is not allowed base_class_offset_too large offset of base class entity within class entity is too large expr_not_bool expression must have bool type or be convertible to bool cl array new and delete option only in cplusplus array new and delete option can be used only when compiling C based reguires_variable_name entity kind entity is not a variable name based_not_allowed_here __ based modifier is not allowed here based_not_followed_by_star __ based does not precede a pointer operator __ based ignored A 52 0716 0717 0718 0719 0720 0721 0722 0723 0724 0725 0726 0727 0728 Appendix A based_var_must_be_ptr variable in __ based modifier must have pointer type bad_const_cast_type the type in a const_cast must be a pointer reference or pointer to member to an object type bad_const_cast a const_cast can only adjust type qualifiers it cannot change the underlying type mutable_not_allowed mutable is not allowed cannot change access redeclaration of entity kind entity is not allowed to alter its access nonstd printf format string nonstandard format string conversion probable inadver
63. an one constructor applies to convert from type to type ambiguous conversion function more than one conversion function from type to type applies ambiguous conversion to builtin more than one conversion function from type to a built in type applies addr of constructor or destructor a constructor or destructor may not have its address taken dollar used in identifier dollar sign used in identifier nonconst ref init anachronism temporary used for initial value of reference to non const anachronism A 32 0427 0428 0429 0430 0432 0433 0434 0435 0436 0437 0438 0439 0440 Appendix A qualifier in member declaration qualified name is not allowed in member declaration mixed enum type anachronism enumerated type mixed with another type anachronism new_array_size_must_be_nonnegative the size of an array in new must be non negative return ref init reguires_temp returning reference to local temporary enum not allowed enum declaration is not allowed gualifier dropped in ref init qualifiers dropped in binding reference of type type to initializer of type type bad nonconst ref init a reference of type type not const gualified cannot be initialized with a value of type type delete of function pointer a pointer to function may not be deleted bad conversion function decl conve
64. and delete Enable or disable automatic instantiation of templates Enable or disable the anachronism of accepting a copy assignment operator with a base class as a default for the derived class Enable or disable recognition of bool Enable or disable a shorter form of diagnostic output Compile C compatible with cfront version 2 1 Compile C compatible with cfront version 3 0 Add class name to the scope of the class Keep comments in the preprocessed output Use special function registers for cpu Make string literals const Create a precompiled header file with the specified name Define preprocessor macro Compiler Use Option Description dependencies M diag suppress tag tag diag remark tag tag diag warning tag tag diag error tag lag display error number distinct template signatures no distinct template signatures dollar early tiebreaker embedded no embedded embedded c enum overloading no enum overloading error limit number enumber error output efile exceptions no exceptions X explicit no explicit Preprocess only Emit dependencies for make Override normal error severity Display error number in diagnostic messages Disallow or allow normal functions as template instantiation Accept dollar signs in identifiers Early handling of tie breaker
65. are directly passed to the assembler Relocatable object files obj and libraries a and files with extension out and 1s1 are recognized as linker input files The control program supports options to stop at any stage in the compilation process and has options to produce and retain intermediate files The C compiler accepts the C language of the ISO IEC 14882 1998 C standard with some minor exceptions documented in the next chapter With the proper command line options it alternatively accepts the ANSI ISO C language or traditional K amp R C B W Kernighan and D M Ritchie It also accepts embedded C language extensions The C compiler does no optimization Its goal is to produce quickly a complete and clean parsed form of the source program and to diagnose errors It does complete error checking produces clear error messages including the position of the error within the source line and avoids cascading of errors It also tries to avoid seeming overly finicky to a knowledgeable C or C programmer 1 4 Chapter 1 1 2 DEVELOPMENT STRUCTURE The next figure explains the relationship between the different parts of the M16C toolchain C source file assembly file C source file asm CC C compiler Cc input object files library files a assembly file relocatable object module obj recompilation C prelinker object file SIC assembler linker
66. ate early tiebreaker option can be used only when compiling C cl strict ansi incompatible_with_tsw_extensions strict ANSI mode is incompatible with TASKING Embedded C extensions tsw_embedded_extensions_not_allowed TASKING Embedded C extensions not allowed tsw_at_already_used _at can only be used once in a declaration tsw_atbit_already_used _atbit can only be used once in a declaration tsw_at atbit_ conflict _at and _atbitQ cannot be used in the same declaration tsw_expr_ not integral or fractional expression must have integral or fractional type tsw_expr not integral or enum or fractional expression must have integral enum or fractional type cl options after input file not allowed options are not allowed after the input file name bad va start incorrect use of va_start Error Messages A 69 0945 0946 0947 0948 0949 0950 0951 0952 0953 0954 0955 0956 0957 bad va arg incorrect use of va_arg bad va end incorrect use of va_end cl pending instantiations option only in cplusplus pending instantiations option can be used only when compiling C cl_invalid_import_directory invalid directory for import files cl_import_only_in_microsoft an import directory can be specified only in Microsoft mode ref not allowed in union a member with reference type is not allowed in a union typedef not allowed typedef
67. ation indicates actions you can perform with the mouse EE This illustration indicates keyboard input d gt This illustration can be read as See also It contains a reference to another command option or section OVERVIEW ail TASKING M d3iLdVHO Overview 1 3 1 1 INTRODUCTION TO C COMPILER This manual provides a functional description of the TASKING M16C C Compiler This manual uses cpm16c the name of the binary as a shorthand notation for IASKING M16C C Compiler You should be familiar with the C language and with the ANSI ISO C language The C compiler can be seen as a preprocessor or front end which accepts C source files or sources using C language features The output generated by cpm16c is M16C C which can be translated with the C compiler cm16c The C compiler is part of a complete toolchain For details about the C compiler see the C Compiler Assembler Linker User s Manual The C compiler is normally invoked via the control program which is part of the toolchain The control program facilitates the invocation of various components of the toolchain The control program recognizes several filename extensions C source files cc cxx cpp or c with the force c option are passed to the C compiler C source files c are passed to the compiler Assembly source files asm are preprocessed and passed to the assembler Assembly sources src
68. ave unwittingly used cfront features to continue to compile their existing code In particular if a program gets an error when compiled by cfront the C compiler may produce a different error or no error at all Command line options are also available to enable and disable anachronisms and strict standard conformance checking 2 4 1_ NEW LANGUAGE FEATURES ACCEPTED The following features not in traditional C the C language of Tbe Annotated C Reference Manual by Ellis and Stroustrup ARM but in the standard are implemented e The dependent statement of an if while do while or for is considered to be a scope and the restriction on having such a dependent statement be a declaration is removed e The expression tested in an if while do while or for as the first operand of a operator or as an operand of the amp amp or 1 operators may have a pointer to member type or a class type that can be converted to a pointer to member type in addition to the scalar cases permitted by the ARM e Qualified names are allowed in elaborated type specifiers e A global scope qualifier is allowed in member references of the form x A B and p gt A B e The precedence of the third operand of the operator is changed e If control reaches the end of the main routine and main has an integral return type it is treated as if a return 0 statement were executed e Pointers to arrays wi
69. aw source lines information on transitions into and out of include files and diagnostics generated by the C compiler Each line of the listing file begins with a key character that identifies the type of line as follows N X a normal line of source the rest of the line is the text of the line the expanded form of a normal line of source the rest of the line is the text of the line This line appears following the N line and only if the line contains non trivial modifications comments are considered trivial modifications macro expansions line splices and trigraphs are considered non trivial modifications a line of source skipped by an if or the like the rest of the line is text Note that the else elif or endif that ends a skip is marked with an N an indication of a change in source position The line has a format similar to the line identifying directive output by cpp that is to say L line number file name key where key is 1 for entry into an include file 2 for exit from an include file and omitted otherwise Compiler Use 3 67 The first line in the raw listing file is always an L line identifying the primary input file L lines are also output for line directives Rey is omitted L lines indicate the source position of the following source line in the raw listing file R W E or C an indication of a diagnostic R for remark W for warning E for error and C for catastrophic error
70. be visible in a direct base class cl sun incompatible with microsoft Sun mode is incompatible with Microsoft mode cl sun incompatible with cfront Sun mode is incompatible with cfront mode Error Messages A 75 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 cl strict ansi incompatible with sun strict ANSI mode is incompatible with Sun mode cl sun mode only in cplusplus Sun mode is only allowed when compiling C template_template_param same name as templ param a template template parameter cannot have the same name as one of its template parameters recursive_def arg instantiation recursive instantiation of default argument dependent type in templ templ param a parameter of a template template parameter cannot depend on the type of another template parameter bad_template_name entity kind entity is not an entity that can be defined destructor_name_must_be_qualified destructor name must be qualified no_typename_in_friend_class_decl friend class name may not be introduced with typename no ctor or dtor using declaration a using declaration may not name a constructor or destructor friend is nonreal template a gualified friend template declaration must refer to a specific previously declared template bad class template decl invalid specifier in class template declaration simple incompatible_param argument
71. cialization includes a nontype argument whose type depends on a template parameter A 62 0845 0846 0847 0848 0849 0850 0851 0852 0853 0854 0855 0856 Appendix A partial spec after instantiation this partial specialization would have been used to instantiate entity kind entity partial_spec_after_instantiation_ambiguous this partial specialization would have been made the instantiation of entity kind entity ambiguous expr not integral or enum expression must have integral or enum type expr not arithmetic _or enum expression must have arithmetic or enum type expr_not arithmetic or enum or pointer expression must have arithmetic enum or pointer type cast not integral or enum type of cast must be integral or enum cast_not arithmetic_or enum or pointer type of cast must be arithmetic enum or pointer expr_not_object_pointer expression must be a pointer to a complete object type member_partial_spec_not_in_class a partial specialization of a member class template must be declared in the class of which it is a member partial_spec_nontype_expr a partial specialization nontype argument must be the name of a nontype parameter or a constant different_return_type_on_virtual_function_override return type is not identical to return type type of overridden virtual function entity kind entity cl_guiding decls_option_only_in_cplusplu
72. cognition of typename force vtbl anachronisms no anachronisms base assign op is default no base assign op is default nonconst ref anachronism no nonconst ref anachronism nonstd gualifier deduction no nonstd gualifier deduction nonstd using decl no nonstd using decl arg dep lookup no arg dep lookup class name injection no class name injection friend injection no friend injection early tiebreaker late tiebreaker array new and delete no array new and delete namespaces no namespaces new for init old for init using std no using std rtti no rtti bool no bool typename no typename 3 14 Chapter 3 Description Option Enable or disable implicit determination from context whether a template parameter dependent name is a type or nontype Enable or disable a special nonstandard weighting of the conversion to the integral operand of the operator in overload resolution Enable or disable recognition of wchar_t as a keyword Select lifetime for temporaries Enable or disable recognition of alternative tokens Enable or disable minimal inlining of function calls Enable or disable the removal of unneeded entities from the generated intermediate C file implicit typename no implicit typename special subscript cost no special subs
73. cript cost wchar_t keyword no wchar_t keyword long lifetime temps short lifetime temps alternative tokens no alternative tokens inlining no inlining remove unneeded entities no remove unneeded entities Template instantiation options Control instantiation of external template entities Enable or disable automatic instantiation of templates Create separate instantiation files Write instantiation files to dir Enable or disable implicit inclusion of source files as a method of finding definitions of template entities to be instantiated Maximum number of instantiations for a single template default 64 Dis allow or allow normal functions as template instantiation Enable or disable recognition of guiding declarations of template functions Enable or disable old style template specialization instantiate mode t mode auto instantiation no auto instantiation T one instantiation per object instantiation dir dir implicit include no implicit include B pending instantiations n distinct template signatures no distinct template signatures guiding decls no guiding decls old specializations no old specializations Compiler Use Description Option Precompiled header options Automatically use and or create a pch precompiled header file Create a precompiled header file with the s
74. cription Suppress definition of virtual function tables in cases where the heuristic used by the C compiler to decide on definition of virtual function tables provides no guidance The virtual function table for a class is defined in a compilation if the compilation contains a definition of the first non inline non pure virtual function of the class For classes that contain no such function the default behavior is to define the virtual function table but to define it as a local static entity The suppress vtbl option suppresses the definition of the virtual function tables for such classes and the force vtbl option forces the definition of the virtual function table for such classes force vtbl differs from the default behavior in that it does not force the definition to be local Example cpml6c suppress vtbl test cc d gt force vtbl Compiler Use 3 101 sys include Option sys include directory Arguments The name of the system include directory to search for include file s Description Change the algorithm for searching system include files whose names do not have an absolute pathname to look in directory Example cpml6c sys include proj include test cc d gt Section 3 2 Include Files include directory 3 102 Chapter 3 timing Option timing Default No timing information is generated Description Generate compilation timing infor
75. d in the ARM then extern and inline are incompatible the default linkage when inline appears alone is internal that is inline means static inline on non member functions and inline member functions have internal linkage no matter what the linkage of their class Example cpml6c no extern inline test cc 3 47 3 48 Chapter 3 F Option F Description F forces using single precision floating point only even when double or long double is used In fact double and long double are treated as float and default argument promotion from float to double is suppressed Every expression is evaluated in single precision This saves a lot of code and increases the execution speed Examples To force double to be treated as float enter cpml6c F test cc Compiler Use 3 49 f Option f filename Arguments The name of an option file Description Instead of typing all options on the command line you can create an option file which contains all options and files you want to specify With this option you specify the option file to the C compiler Use an option file when the length of the command line would exceed the limits of the operating system or just to store options and save typing You can specify the option f multiple times Format of an option file Multiple command line arguments on one line in the option file are allowed To include whitespace in an argument surround the argu
76. declaration using declaration ignored it refers to the current namespace class_gualified name reguired a class gualified name is reguired using declaration ignored using declaration of entity kind entity ignored not an actual member entity kind entity has no actual member xxxx mem attrib incompatible incompatible memory attributes specified A 54 0745 0746 0747 0748 0749 0750 0751 0752 0753 0754 0755 0756 0757 Appendix A mem attrib ignored memory attribute ignored mem attrib may_not precede nested declarator memory attribute may not be followed by a nested declarator dupl mem attrib memory attribute specified more than once dupl calling convention calling convention specified more than once type gualifier not allowed a type gualifier is not allowed template instance already_used entity kind entity declared at line xxxx was used before its template was declared static nonstatic_with same_param types static and nonstatic member functions with same parameter types cannot be overloaded no prior declaration no prior declaration of entity kind entity template id not allowed a template id is not allowed class_gualified name not allowed a class gualified name is not allowed bad scope for redeclaration entity kind entity may not be redeclared in the current scope gualifier in namespace member decl
77. disable acceptance of old style template specializations that is specializations that do not use the template lt gt syntax Example cpml6c no old specializations test cc Compiler Use 3 83 old style preprocessing Option old style preprocessing Description Forces pcc style preprocessing when compiling This may be used when compiling an ANSI C program on a system in which the system header files reguire pcc style preprocessing Example To force pcc style preprocessing enter cpml6c E old style preprocessing test cc d gt preprocess E no line commands P 3 84 Chapter 3 one instantiation per object Option one instantiation per object Description Put out each template instantiation in this compilation function or static data member in a separate object file The primary object file contains everything else in the compilation that is everything that is not an instantiation Having each instantiation in a separate object file is very useful when creating libraries because it allows the user of the library to pull in only the instantiations that are needed That can be essential if two different libraries include some of the same instantiations Example To create separate instantiation files enter cpml6c one instantiation per object test cc d gt Section Template Instantiation in chapter Language Implementation Compiler Use 3 85 outpu
78. e a very long time The link step tries to be smart about recompiling instantiations only when necessary but because it keeps no fine grained dependency information it is often forced to recompile the world for a minor change in a h file In addition cfront has no way of ensuring that preprocessing symbols are set correctly when it does these instantiation compilations if preprocessing symbols are set other than on the command line e Borland s C compiler instantiates everything referenced in a compilation then uses a special linker to remove duplicate definitions of instantiated functions If you are using Borland s compiler you must make sure that every compilation sees all the source code it needs to instantiate all the template entities referenced in that compilation That is one cannot refer to a template entity in a source file if a definition for that entity is not included by that source file In practice this means that either all the definition code is put directly in the h files or that each h file includes an associated cc actually cpp file This scheme is straightforward and works well for small programs For large systems however it tends to produce very large object files because each object file must contain object code and symbolic debugging information for each template entity it references 2 The actual implementation allows for several different suffixes and provides a command line option to chang
79. e the suffixes sought 2 28 Chapter 2 Our approach is a little different It reguires that for each instantiation reguired there is some normal top level explicitly compiled source file that contains the definition of the template entity a reference that causes the instantiation and the declarations of any types reguired for the instantiation gt This requirement can be met in various ways e The Borland convention each h file that declares a template entity also contains either the definition of the entity or includes another file containing the definition e Implicit inclusion when the compiler sees a template declaration in a h file and discovers a need to instantiate that entity it is given permission to go off looking for an associated definition file having the same base name and a different suffix and it implicitly includes that file at the end of the compilation This method allows most programs written using the cfront convention to be compiled with our approach See the section on implicit inclusion e The ad hoc approach you make sure that the files that define template entities also have the definitions of all the available types and add code or pragmas in those files to request instantiation of the entities there Our compiler s automatic instantiation method works as follows The first time the source files of a program are compiled no template entities are instantiated However the generated object fi
80. e to declare a variable with linkage type with no linkage in function use of a type with no linkage to declare a function return type_on constructor return type may not be specified on a constructor return type_on destructor return type may not be specified on a destructor malformed universal character incorrectly formed universal character name invalid UCN universal character name specifies an invalid character UCN_names_basic_char a universal character name cannot designate a character in the basic character set A 72 0984 0985 0986 0987 0988 0989 0990 0991 0992 0993 0994 0995 0996 Appendix A invalid_identifier UCN this universal character is not allowed in an identifier VA_ARGS not allowed the identifier _ VA_ARGS__ can only appear in the replacement lists of variadic macros friend gualification ignored the gualifier on this friend declaration is ignored no range designator with dynamic init array range designators cannot be applied to dynamic initializers property_name_ not allowed property name cannot appear here inline gualifier ignored inline used as a function qualifier is ignored cl compound literals option only in C option compound literals can be used only when compiling C vla_not allowed a variable length array type is not allowed bad integral compound literal a compound literal is not allowed in an integral
81. ecialization exception specification is incompatible with that of entity kind entity declared at line xxxx omitted_exception_specification_on_specialization omission of exception specification is incompatible with entity kind entity declared at line xxxx Error Messages A 59 0807 0808 0809 0810 0811 0812 0813 0814 0815 0816 0817 0818 unexpected_end_of_default_arg unexpected end of default argument expression default_init_of_reference default initialization of reference is not allowed uninitialized field with const member uninitialized entity kind entity has a const member uninitialized base class with const member uninitialized base class type has a const member missing default constructor_on_const const entity kind entity requires an initializer class type has no explicitly declared default constructor missing default_constructor_on_unnamed_const const object requires an initializer class type has no explicitly declared default constructor cl impl extern c conv option only in cplusplus option implicit_extern_c_type_conversion can be used only when compiling C cl strict ansi incompatible_with long preserving strict ANSI mode is incompatible with long preserving rules useless_type_ gualifier on return type type gualifier on return type is meaningless type gualifier on_void return type
82. ecified entity It is typically used to suppress the instantiation of an entity for which a specific definition will be supplied 2 32 Chapter 2 e The can instantiate pragma indicates that a specified entity can be instantiated in the current compilation but need not be it is used in conjunction with automatic instantiation to indicate potential sites for instantiation if the template entity turns out to be reguired The argument to the instantiation pragma may be a template class name A lt int gt a template class declaration class A lt int gt a member function name A lt int gt f a static data member name A lt int gt i a static data declaration int A lt int gt i a member function declaration void A lt int gt f int char a template function declaration char f int float A pragma in which the argument is a template class name e g A lt int gt or class A lt int gt is equivalent to repeating the pragma for each member function and static data member declared in the class When instantiating an entire class a given member function or static data member may be excluded using the do_not_instantiate pragma For example pragma instantiate A lt int gt pragma do not instantiate A lt int gt f The template definition of a template entity must be present in the compilation for an instantiation to occur If an instantiation is explicitly reguested by use of the instantiate pragma and no template definition is availab
83. ection Precompiled Headers in chapter Language Implementation 3 88 Chapter 3 pch messages Option pch messages no pch messages Default pch messages Description Enable or disable the display of a message indicating that a precompiled header file was created or used in the current compilation Example cpml6c create pch test pch pch messages test cc test cc creating precompiled header file test pch d gt pch use pch create pch Section Precompiled Headers in chapter Language Implementation Compiler Use 3 89 pch verbose Option pch verbose Description In automatic PCH mode for each precompiled header file that cannot be used for the current compilation a message is displayed giving the reason that the file cannot be used Example cpml6c pch pch verbose test cc do as Section Precompiled Headers in chapter Language Implementation 3 90 Chapter 3 pending instantiations Option pending instantiations 77 Arguments The maximum number of instantiation for a single template Default 64 Description Specifies the maximum number of instantiations of a given template that may be in process of being instantiated at a given time This is used to detect runaway recursive instantiations If 7 is zero there is no limit Example To specify a maximum of 32 pending instantiations enter cpml6c pending insta
84. ed ptrepository It instantiates nothing during normal compilations At link time it looks for entities that are referenced but not defined and whose mangled names indicate that they are template entities For each such entity it consults the ptrepository information to find the file containing the source for the entity and it does a compilation of the source to generate an object file containing object code for that entity This object code for instantiated objects is then combined with the normal object code in the link step Language Implementation 2 27 If you are using cfront you must follow a particular coding convention all templates must be declared in h files and for each such file there must be a corresponding cc file containing the associated definitions The compiler is never told about the cc files explicitly one does not for example compile them in the normal way The link step looks for them when and if it needs them and does so by taking the h filename and replacing its suffix 2 This scheme has the disadvantage that it does a separate compilation for each instantiated function or at best one compilation for all the member functions of one class Even though the function itself is often guite small it must be compiled along with the declarations for the types on which the instantiation is based and those declarations can easily run into many thousands of lines For large systems these compilations can tak
85. efault in cfront 3 0 mode With this feature enabled the following code compiles without error struct A A operator int int operator unsigned he void main Aa a 0 Ambiguous but allowed with this option operator is chosen Example cpml6c special subscript cost test cc 3 98 Chapter 3 strict A strict warnings a Option A strict a strict warnings Description Enable strict ANSI mode which provides diagnostic messages when non ANSI features are used and disables features that conflict with ANSI C or C ANSI violations can be issued as either warnings or errors depending on which command line option is used The strict options issue errors and the strict warnings options issue warnings The error threshold is set so that the reguested diagnostics will be listed Example To enable strict ANSI mode with error diagnostic messages enter cpml6c A test cc Compiler Use 3 99 suppress typeinfo vars Option suppress typeinfo vars Description Suppress the generation of type info variables when run time type info RTTD is disabled By default only type info variables are generated no other run time type info With this option you can also suppress type info varables Example cpml6c suppress typeinfo vars test cc d gt rtti 3 100 Chapter 3 Suppress vtbl Option suppress vtbl Des
86. ence was a declaration instantiate local Similar to instantiate used except that the functions are given internal linkage This is intended to provide a very simple mechanism for those getting started with templates The compiler will instantiate the functions that are used in each compilation unit as local functions and the program will link and run correctly barring problems due to multiple copies of local static variables However one may end up with many copies of the instantiated functions so this is not suitable for production use instantiate local can not be used in conjunction with automatic template instantiation If automatic instantiation instantiate local option If automatic instantiation is not enabled by default use of instantiate local and auto instantiation is an error In the case where the cem16c command is given a single file to compile and link e g ccml6c test cc the compiler knows that all instantiations will have to be done in the single source file Therefore it uses the instantiate used mode and suppresses automatic instantiation 2 6 3 _ INSTANTIATION PRAGMA DIRECTIVES Instantiation pragmas can be used to control the instantiation of specific template entities or sets of template entities There are three instantiation pragmas e The instantiate pragma causes a specified entity to be instantiated e The do_not_instantiate pragma suppresses the instantiation of a sp
87. entifier name as in undef unless it is a predefined ANSI standard macro ANSI specifies the following predefined symbols to exist which cannot be removed _FILE_ current source filename _ LINE_ current source line number int type _TIME_ hh mm ss _ DATE Mmm dd yyyy _ SIDC _ level of ANSI standard This macro is set to 1 when the option to disable language extensions A is effective Whenever language extensions are excepted _ STDC _ is set to 0 zero __cplusplus is defined when compiling a C program When cpm16c is invoked also the following predefined symbols exist c_plusplus is defined in addition to the standard __ cplusplus _ SIGNED CHARS__ is defined when plain char is signed _WCHAR T is defined when wchar_t is a keyword _BOOL is defined when bool is a keyword _ ARRAY OPERATORS is defined when array new and delete are enabled These symbols can be turned off with the U option Compiler Use 3 107 Example cpml6c Uc_ plusplus test cc d gt D define 3 108 unsigned chars u Option u unsigned chars Description Treat character type variables as unsigned character variables Example cpml6c u test cc d gt signed chars s Chapter 3 Compiler Use 3 109 use pch Option use pch filename Arguments The filename to use as a precompiled header file Description Use a precompiled header file of the spec
88. es not declare anything struct A Test_name cc line 9 error 77 this declaration has no storage class or type specifier XXXXX Because an error is determined to be discretionary based on the error severity associated with a specific context a given error may be discretionary in some cases and not in others For some messages a list of entities is useful they are listed following the initial error message test cc line 4 error more than one instance of overloaded function f matches the argument list function f int function f float argument types are double f 1 5 In some cases some additional context information is provided specifically such context information is useful when the C compiler issues a diagnostic while doing a template instantiation or while generating a constructor destructor or assignment operator function For example Compiler Diagnostics 4 5 db test cc line 7 error A A is inaccessible B x detected during implicit generation of B B at line 7 Without the context information it is very hard to figure out what the error refers to For a list of error messages and error numbers see Appendix A Error Messages 4 2 TERMINATION MESSAGES cpm16c writes sign off messages to stderr if errors are detected For example one of the following forms of message n errors detected in the compilation of ifile 1 catastroph
89. executable tools The path you specify here should match the path that you specified for the PATH variable CCM16COPT With this variable you specify options and or arguments to each invocation of the control program ccm16c The control program processes these arguments before the command line arguments CPM16CINC Specifies an alternative path for include files for the C compiler cpm16c LIBM16C LIBR8C With this variable you specify one or more alternative directories in which the linker Ikm16c looks for library files for a specific core The linker first looks in these directories then always looks in the default 1ib directory LM_LICENSE_FILE With this variable you specify the location of the license data file You only need to specify this variable if your host uses the FLEXIm licence manager TASKING_LIC_WAIT If you set this variable the tool will wait for a license to become available if all licenses are taken If you have not set this variable the tool aborts with an error message Overview Environment Variable Description PATH With this variable you specify the directory in which the executables reside default productXbin This allows you to call the executables when you are not in the bin directory TMPDIR With this variable you specify the location where programs can create temporary files Table 1 1 Environment variables 1 10
90. f nonstd ptr to member decl A T2 pf A sf std ptr to static mem decl A T3 pmf2 amp A f nonstd ptr to member decl where T is construed to name a routine type for a non static member function of class A that takes an int argument and returns void the use of such types is restricted to nonstandard pointer to member declarations The declarations of T and pmf in combination are equivalent to a single standard pointer to member declaration void A pmf int amp A f A nonstandard pointer to member declaration that appears outside of a class declaration such as the declaration of T is normally invalid and would cause an error to be issued However for declarations that appear within a class declaration such as A T3 this feature changes the meaning of a valid declaration cfront version 2 1 accepts declarations such as T even when A is an incomplete type so this case is also excepted Protected member access checking is not done when the address of a protected member is taken For example Language Implementation 2 19 class B protected int i class D public B void mf void D mf int B pmil amp B i error OK in cfront mode int D pmi2 amp D i OK amp Protected member access checking for other operations i e everything except taking a pointer to member address is done in the normal manner The destructor of a derived class may implicitly call t
91. f for this directive is missing pp_else_already_appeared directive is not allowed an else has already appeared divide _by_zero division by zero exp identifier expected an identifier expr not scalar expression must have arithmetic or pointer type incompatible_operands operand types are incompatible rype and type Error Messages A 7 0044 0045 0046 0047 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 expr_not_pointer expression must have pointer type cannot_undef_predef_macro undef may not be used on this predefined name cannot_redef_predef_macro this predefined name may not be redefined bad_macro_redef incompatible redefinition of macro entity declared at line xxxx duplicate_macro_param_name duplicate macro parameter name paste_cannot_be_first may not be first in a macro definition paste_cannot_be_last may not be last in a macro definition exp macro_param expected a macro parameter name exp_ colon expected a too few macro args too few arguments in macro invocation too many macro args too many arguments in macro invocation sizeof function operand of sizeof may not be a function bad constant operator this operator is not allowed in a constant expression bad pp operator this operator is not allowed in a preprocessing expression 0059 0060 0061 0062
92. fiers are incompatible with previous declaration decl modifiers invalid for this decl the modifier xxxx is not allowed on this declaration branch into try_block transfer of control into a try block incompatible inline specifier on specific decl inline specification is incompatible with previous entity declared at line xxxx A 48 0658 0659 0660 0661 0662 0663 0664 0665 0666 0667 0668 0669 0670 Appendix A template missing closing brace closing brace of template definition not found cl wchar t option only in cplusplus wchar_t keyword option can be used only when compiling C bad_pack_alignment invalid packing alignment value exp_int_constant expected an integer constant call_of_pure_virtual call of pure virtual function bad_ident_string invalid source file identifier string template_friend_definition_not_allowed a class template cannot be defined in a friend declaration asm_not_allowed asm is not allowed bad asm function def asm must be used with a function definition nonstd asm function asm function is nonstandard nonstd ellipsis only_param ellipsis with no explicit parameters is nonstandard nonstd address of ellipsis amp is nonstandard bad address of ellipsis invalid use of amp Error Messages A 49 0672 0673 0674 0675 0676 0677 0678 0679
93. fix section of a pch is read in for comparison with the current source file If the command line options are identical if xxx h has not been modified and so forth then instead of opening xxx h and processing it line by line the C compiler reads in the rest of a pch and thereby establishes the state for the rest of the compilation It may be that more than one PCH file is applicable to a given compilation If so the largest i e the one representing the most preprocessing directives from the primary source file is used For instance consider a primary source file that begins with include xxx h include yyy h include zzz h If there is one PCH file for xxx h and a second for xxx h and yyy h the latter will be selected assuming both are applicable to the current compilation Moreover after the PCH file for the first two headers is read in and the third is compiled a new PCH file for all three headers may be created When a precompiled header file is created it takes the name of the primary source file with the suffix replaced by an implementation specified suffix pch by default Unless pch dir is specified see below it is created in the directory of the primary source file When a precompiled header file is created or used a message such as test cc creating precompiled header file test pch 2 42 Chapter 2 is issued The user may suppress the message by using the command line option
94. for copy that was eliminated is inaccessible uncallable elided cctor entity kind entity required for copy that was eliminated is not callable because reference parameter cannot be bound to rvalue typeid needs typeinfo lt typeinfo gt must be included before typeid is used cannot cast away_const xxxx cannot cast away const or other type gualifiers bad dynamic cast type the type in a dynamic_cast must be a pointer or reference to a complete class type or void bad ptr dynamic cast operand the operand of a pointer dynamic_cast must be a pointer to a complete class type bad ref dynamic cast operand the operand of a reference dynamic _cast must be an lvalue of a complete class type dynamic_cast_ operand must_be_polymorphic the operand of a runtime dynamic _cast must have a polymorphic class type cl bool option only in cplusplus bool option can be used only when compiling C array_type_not allowed an array type is not allowed here Error Messages A 51 0702 0703 0704 0705 0706 0707 0708 0709 0710 0711 0712 0713 0714 0715 exp assign 9 expected an exp_declarator_in_condition_decl expected a declarator in condition declaration redeclaration_of_condition_decl_name xxxx declared in condition may not be redeclared in this scope default_template_arg_not allowed default template arguments are not allowed for function templates exp
95. g the disadvantage of large precompiled header files can be minimized without giving up the advantage of a significant speedup in compilation times Conseguently to take full advantage of header file precompilation users should expect to reorder the include sections of their source files and or to group include directives within a commonly used header file Below is an example of how this can be done A common idiom is this include comnfile h pragma hdrstop include where comnfile h pulls in directly and indirectly a few dozen header files the pragma hdrstop is inserted to get better sharing with fewer PCH files The PCH file produced for comnfile h can be a bit over a megabyte in size Another idiom used by the source files involved in declaration processing is this include comnfile h include decl hdrs h pragma hdrstop include Language Implementation 2 45 decl hdrs h pulls in another dozen header files and a second somewhat larger PCH file is created In all the source files of a particular program can share just a few precompiled header files If disk space were at a premium you could decide to make comnfile h pull in all the header files used then a single PCH file could be used in building the program Different environments and different projects will have different needs but in general users should be aware that making the best use of the precompiled header support will re
96. gualified name is not allowed in namespace member declaration sym_not a type name entity kind entity is not a type name Error Messages A 55 0758 0759 0760 0761 0762 0763 0764 0765 0766 0767 0768 0769 explicit_instantiation_not_in_namespace_scope explicit instantiation is not allowed in the current scope bad_scope_for_explicit_instantiation entity kind entity cannot be explicitly instantiated in the current scope multiple_explicit_instantiations entity kind entity explicitly instantiated more than once typename not in template typename may only be used within a template cl special subscript_cost_option only in cplusplus special subscript_cost option can be used only when compiling C cl_typename_option_only_in_cplusplus typename option can be used only when compiling C cl_implicit_typename_option_only_in_cplusplus implicit typename option can be used only when compiling C nonstd_character_at_start_of_macro_def nonstandard character at start of object like macro definition exception_spec_override_incompat exception specification for virtual entity kind entity is incompatible with that of overridden entity kind entity pointer_conversion_loses_bits conversion from pointer to smaller integer generated_exception_spec_override_incompat exception specification for implicitly declared virtual entity kind entity
97. guire some experimentation and probably some minor changes to source code 2 46 Chapter 2 LANGUAGE COMPILER USE ail TASKING M d3iLdVHO Compiler Use 3 3 3 1 INVOCATION The invocation syntax of the C compiler is cpm16c option file When you use a UNIX shell Bourne shell C shell arguments containing special characters such as and must be enclosed with or escaped The option in the C shell becomes or The C compiler accepts a C source file name and command line options in random order A C source file must have a cc cxx or cpp suffix Command line options may be specified using either single character option codes e g A or keyword options e g strict If an option requires an argument the argument may immediately follow the option letter or may be separated from the option letter by white space A keyword option specification consists of two hyphens followed by the option keyword e g strict Keyword options may be abbreviated by specifying as many of the leading characters of the option name as are needed to uniguely identify an option name for example the wchar_t keyword option may be abbreviated as wc Note that this is not supported by the control program If an option reguires an argument the argument may be separated from the keyword by white space or the keyword may be immediately followed by option
98. har_escape unrecognized character escape sequence undefined_preproc_id zero used for undefined preprocessing identifier exp_asm_ string expected an asm string asm_func_must_be_prototyped an asm function must be prototyped bad_asm_func_ellipsis an asm function may not have an ellipsis file_delete_error error while deleting file xxxx integer_to_float_conversion integral value does not fit in required floating point type float_to_float_conversion floating point value does not fit in required floating point type A 18 0222 0223 0224 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 Appendix A bad float operation result floating point operation result is out of range implicit func decl function declared implicitly too few_printf args the format string reguires additional arguments too many_ printf args the format string ends before this argument bad printf format string invalid format string conversion macro recursion macro recursion nonstd extra _comma trailing comma is nonstandard enum bit field too small bit field cannot contain all values of the enumerated type nonstd bit field type nonstandard type for a bit field decl in prototype scope declaration is not visible outside of function decl of void ignored old fashioned typedef of void ignored old_fashioned_field_selection left operand is not a struct or union co
99. he variable for example cpml6c case in 0 echo ok 2 4 echo error esac The exit status of cpm16c indicates the highest severity diagnostic detected and is one of the numbers of the following list 1 Abnormal termination 0 Compilation successful no errors maybe some remarks O There were warnings 2 There were user errors but terminated normally 4 A catastrophic error premature ending ERROR MESSAGES ail TASKING M XIGNAddV Error Messages A 3 1 INTRODUCTION This appendix lists all diagnostic messages starting with the error number and the error tag name followed by the message itself The error number and or error tag can be used in diag severity options to override the normal error severity The C compiler produces error messages on standard error output With the error output option you can redirect the error messages to an error list file Normally diagnostics are written to stderr in the following form TASKING layout severity err_num message The severity can be one of R remark W warning E error F fatal error S internal error With no tsw diagnostics diagnostics are written to stderr in the following form filename line line_num message With display error number this form will be filename line line_num severity err_num message or filename line line_num severity err_num D message Where severity can be one
100. he instantiation from the proper ii file The ii files should not in general reguire any manual intervention One exception if a definition is changed in such a way that some instantiation no longer compiles it gets errors and at the same time a specialization is added in another file and the first file is being recompiled before the specialization file and is getting errors the ii file for the file getting the errors must be deleted manually to allow the prelinker to regenerate it 2 30 Chapter 2 If you supplied the v option to the control program ccm16c and the prelinker changes an instantiation assignment the prelinker will issue messages like Ctr prelinker A lt int gt f assigned to file test o C prelinker executing ccml6c c test cc The automatic instantiation scheme can coexist with partial explicit control of instantiation by you through the use of pragmas or command line specification of the instantiation mode See the following sections Instantiations are normally generated as part of the object file of the translation unit in which the instantiations are performed But when one instantiation per object mode is specified each instantiation is placed in its own object file One instantiation per object mode is useful when generating libraries that need to include copies of the instances referenced from the library If each instance is not placed in its own object file it may be impossible to link t
101. he library with another library containing some of the same instances Without this feature it is necessary to create each individual instantiation object file using the manual instantiation mechanism The automatic instantiation mode is enabled by default It can be turned off by the command line option no auto instantiation If automatic instantiation is turned off the extra information about template entities that could be instantiated in a file is not put into the object file 2 6 2 _ INSTANTIATION MODES Normally when a file is compiled no template entities are instantiated except those assigned to the file by automatic instantiation The overall instantiation mode can however be changed by a command line option instantiate none Do not automatically create instantiations of any template entities This is the default It is also the usually appropriate mode when automatic instantiation is done instantiate used Instantiate those template entities that were used in the compilation This will include all static data members for which there are template definitions Language Implementation 2 31 instantiate all Instantiate all template entities declared or referenced in the compilation unit For each fully instantiated template class all of its member functions and static data members will be instantiated whether or not they were used Non member template functions will be instantiated even if the only refer
102. he private destructor of a base class In default mode this is an error but in cfront mode it is reduced to a warning For example class A A class B public A B 7B Error except in cfront mode When disambiguation requires deciding whether something is a parameter declaration or an argument expression the pattern type name or keyword identifier is treated as an argument For example class A A double d A x int d A x2 By default int d is interpreted as a parameter declaration with redundant parentheses and so x is a function but in cfront compatibility mode int d is an argument and x is a variable The declaration A x2 is also misinterpreted by cfront It should be interpreted as the declaration of an object named x2 but in cfront mode is interpreted as a function style cast of x2 to the type A Similarly the declaration int xyz int 2 20 Chapter 2 declares a function named xzy that takes a parameter of type function taking no arguments and returning an int In cfront mode this is interpreted as a declaration of an object that is initialized with the value int which evaluates to zero A named bit field may have a size of zero The declaration is treated as though no name had been declared Plain bit fields i e bit fields declared with a type of int are always unsigned The name given in an elaborated type specifier is permitted to be a t
103. he top level statements of functions constructors or destructors are implemented Universal character set escapes e g uabcd are implemented On a call in which the expression to the left of the opening parenthesis has class type overload resolution looks for conversion functions that can convert the class object to pointer to function types and each such pointed to surrogate function type is evaluated alongside any other candidate functions Template template parameters are implemented NEW LANGUAGE FEATURES NOT ACCEPTED The following features of the C standard are not implemented yet 2 4 3 Two phase name binding in templates as described in temp res and temp dep of the standard is not implemented The export keyword for templates is not implemented A partial specialization of a class member template cannot be added outside of the class definition ANACHRONISMS ACCEPTED The following anachronisms are accepted when anachronisms are enabled with anachronisms overload is allowed in function declarations It is accepted and ignored Definitions are not reguired for static data members that can be initialized using default initialization The anachronism does not apply to static data members of template classes they must always be defined 2 10 Chapter 2 The number of elements in an array may be specified in an array delete operation The value is ignored A single operator and
104. ic error detected in the compilation of ifile n errors and 1 catastrophic error detected in the compilation of ifile is written to indicate the detection of errors in the compilation No message is written if no errors were detected The following message Error limit reached is written when the count of errors reaches the error limit see the e option compilation is then terminated The message Compilation terminated is written at the end of a compilation that was prematurely terminated because of a catastrophic error The message Compilation aborted is written at the end of a compilation that was prematurely terminated because of an internal error Such an error indicates an internal problem in the compiler If such an internal error appears please report the occurrence to TASKING using a Problem Report form Please include a diskette or tape containing a small C program causing the error 4 6 Chapter 4 4 3 RESPONSE TO SIGNALS The signals SIGINT caused by a user interrupt like C and SIGTERM caused by a kill command are trapped by the C compiler and cause abnormal termination 4 4 RETURN VALUES cpm16c returns an exit status to the operating system environment for testing For example in a PC BATCH file you can examine the exit status of the program executed with ERRORLEVEL cpml6c 1 cc IF ERRORLEVEL 1 GOTO STOP BATCH In a Bourne shell script the exit status can be found in t
105. ified name as part of the current compilation If pch automatic PCH mode or create pch appears on the command line following this option its effect is erased Example To use the precompiled header file with the name test pch enter cpml6c use pch test pch test cc pch create pch Section Precompiled Headers in chapter Language Implementation 3 110 Chapter 3 using std Option using std no using std Default using std Description Enable or disable implicit use of the std namespace when standard header files are included Example cpml6c using std test cc d gt namespaces Section Namespace Support in chapter Language Implementation Compiler Use variadic macros Option variadic macros no variadic macros Default no variadic macros Description Allow or disallow macros with a variable number of arguments Example cpml6c variadic macros test cc d gt extended variadic macros 3 111 3 112 version V v Option V V version Description Display version information Example cpml6c V TASKING M16C C compiler vx yrz Build nnn Copyright years Altium BV Serial 00000000 Chapter 3 Compiler Use 3 113 wchar_t keyword Option wchar_t keyword no wchar_t keyword Default wchar_t keyword Description Enable or disable recognition of wchar_t as a keyword Example
106. iles not enough preallocated memory insufficient preallocated memory for generation of precompiled header file xxxx bytes reguired program entity_too large for pch very large entity in program prevents generation of precompiled header file cannot chdir xxxx is not a valid directory cannot build temp file name cannot build temporary file name restrict not allowed restrict is not allowed Error Messages A 47 0644 0645 0646 0647 0648 0649 0650 0651 0652 0654 0655 0656 0657 restrict_pointer_to_function a pointer or reference to function type may not be qualified by restrict bad_declspec_modifier xxxx is an unrecognized __ declspec attribute calling convention not allowed a calling convention modifier may not be specified here conflicting calling conventions conflicting calling convention modifiers cl strict ansi incompatible_with microsoft strict ANSI mode is incompatible with Microsoft mode cl cfront incompatible_with microsoft cfront mode is incompatible with Microsoft mode calling convention ignored calling convention specified here is ignored calling convention may_not_precede nested declarator a calling convention may not be followed by a nested declarator calling convention ignored for type calling convention is ignored for this type decl modifiers incompatible with previous decl declaration modi
107. include no implicit include B implicit typename no implicit typename Enable or disable implicit type conversion between external C and C function pointers Enable or disable implicit inclusion of source files as a method of finding definitions of template entities to be instantiated Enable or disable implicit determination from context whether a template parameter dependent name is a type or nontype Compiler Use Option Description incl suffixes suffixes include directory dir ldir include file file inlining no inlining instantiate mode t mode instantiation dir dir late tiebreaker list file file L file long lifetime temps short lifetime temps long preserving rules no long preserving rules M s mll namespaces no namespaces new for init no code gen n no line commands P nonconst ref anachronism no nonconst ref anachronism nonstd gualifier deduction no nonstd gualifier deduction Set the valid suffixes for include files Look in directory dir for include files Include file at the beginning of the compilation Enable or disable minimal inlining of function calls Control instantiation of external template entities Write instantiation files to dir Late handling of tie breakers in overload resolution Generate raw list file file Select lifetime for
108. information file are used for the recompilation 5 When the compiler compiles a file it reads the ii file for that file and obeys the instantiation reguests therein It produces a new object file containing the reguested template entities and all the other things that were already in the object file 6 The prelinker repeats steps 3 5 until there are no more instantiations to be adjusted 7 The object files are linked together Once the program has been linked correctly the ii files contain a complete set of instantiation assignments From then on whenever source files are recompiled the compiler will consult the ii files and do the indicated instantiations as it does the normal compilations That means that except in cases where the set of reguired instantiations changes the prelink step from then on will find that all the necessary instantiations are present in the object files and no instantiation assignment adjustments need be done That s true even if the entire program is recompiled If you provide a specialization of a template entity somewhere in the program the specialization will be seen as a definition by the prelinker Since that definition satisfies whatever references there might be to that entity the prelinker will see no need to reguest an instantiation of the entity If you add a specialization to a program that has previously been compiled the prelinker will notice that too and remove the assignment of t
109. ings on non ANSI features Use special function registers for cpu Select R8C core instead of M16C Single precision floating point Select memory model small medium or large strict A strict warnings a Ccpu r8c F M s m 3 12 Chapter 3 Description Option Compile C compatible with cfront cfront 2 1 version 2 1 b Compile C compatible with cfront cfront 3 0 version 3 0 Accept dollar signs in identifiers dollar Treat all char variables as signed signed chars s Treat all char variables as unsigned Enable or disable K amp R arithmetic conversion rules for longs Make string literals const Enable or disable support for exception handling Enable the diagnostics of noncompliance with the Embedded C subset Enable or disable support for embedded C language extension keywords Enable or disable operator functions to overload builtin operators on enum typed operands Enable or disable support for the explicit specifier on constructor declarations Enable or disable inline function with external C linkage Enable or disable implicit type conversion between external C and C function pointers Suppress type info variables in generated C Suppress definition of virtual function tables unsigned chars u long preserving rules no long preserving rules const string literals no const string literals
110. inly the header files themselves meet certain requirements The header stop point must appear at file scope it may not be within an unclosed scope established by a header file For example a PCH file will not be created in this case xxx h class A xxx C include xxx h int i The header stop point may not be inside a declaration started within a header file nor in C may it be part of a declaration list of a linkage specification For example in the following case the header stop point is int but since it is not the start of a new declaration no PCH file will be created yyy h static yyy C include yyy h int i Similarly the header stop point may not be inside a if block or a define started within a header file 2 40 Chapter 2 The processing preceding the header stop must not have produced any errors Note warnings and other diagnostics will not be reproduced when the PCH file is reused e No references to predefined macros _ DATE__ or _ TIME__ may have appeared No use of the line preprocessing directive may have appeared e pragma no_pch see below must not have appeared e The code preceding the header stop point must have introduced a sufficient number of declarations to justify the overhead associated with precompiled headers The minimum number of declarations reguired is 1 When the host system does not support memory mapping so that everything to be
111. invalid i e if its prefix does not match the prefix for the current primary source file a warning will be issued and the PCH file will not be used When either of these options is used in conjunction with pch dir the indicated file name which may be a path name is tacked on to the directory name unless the file name is an absolute path name Language Implementation 2 43 The create pch use pch and pch options may not be used together If more than one of these options is specified only the last one will apply Nevertheless most of the description of automatic PCH processing applies to one or the other of these modes header stop points are determined the same way PCH file applicability is determined the same way and so forth 2 8 3 OTHER WAYS TO CONTROL PRECOMPILED HEADERS There are several ways in which the user can control and or tune how precompiled headers are created and used pragma hdrstop may be inserted in the primary source file at a point prior to the first token that does not belong to a preprocessing directive It enables you to specify where the set of header files subject to precompilation ends For example include xxx h include yyy h pragma hdrstop include zzz h Here the precompiled header file will include processing state for xxx h and yyy h but not zzz h This is useful if the user decides that the information added by what follows the pragma hdrsto
112. ion Override the normal error severity of the specified diagnostic messages The message s may be specified using a mnemonic error tag or using an error number The error tag names and error numbers are listed in the Error Messages appendix Example When you want diagnostic error 20 to be a warning enter cpml6c diag warning 20 test cc d gt Chapter Compiler Diagnostics and Appendix Error Messages Compiler Use 3 35 display error number Option display error number Description Display the error message number in any diagnostic messages that are generated The option may be used to determine the error number to be used when overriding the severity of a diagnostic message The error numbers are listed in the Error Messages appendix Normally diagnostics are written to stderr in the following form filename line line num message With display error number this form will be filename line line num severity err_num message or filename line line num severity err_num D message If the severity may be overridden the error number will include the suffix D for discretionary otherwise no suffix will be present Example cpml6c display error number test cc test cc line 7 error 64 D declaration does not declare anything struct d gt Chapter Compiler Diagnostics and Appendix Error Messages 3 36 Chapter 3 distinct template signatures Option
113. ions are no longer reguired The command line arguments to the prelinker include a list of input files to be analyzed The input files are the object files and libraries that constitute the application The prelinker begins by looking for instantiation information files for each of the object files If no instantiation information files are present the prelinker concludes that no further action is reguired If there are instantiation information files the prelinker reads the current instantiation list from each information file The instantiation list contains the list of instantiations assigned to a given source file by a previous invocation of the prelinker The prelinker produces a list of the global symbols that are referenced or defined by each of the input files The prelinker then simulates a link operation to determine which symbols must be defined for the application to link successfully 1 6 Chapter 1 When the link simulation has been completed the prelinker processes each input file to determine whether any new instantiations should be assigned to the input file or if any existing instantiations should be removed The prelinker goes through the current instantiation list from the instantiation information file to determine whether any of the existing instantiations are no longer needed An instantiation may be no longer needed because the template entity is no longer referenced by the program or because a user supplied specializati
114. irectives 2 51 2 6 4 Implicit Inclusion a 2 34 2 7 Predefined Macros 0 aa 2 35 2 8 Precompiled Headers VY eects 2 38 2 8 1 Automatic Precompiled Header Processing 2 38 2 8 2 Manual Precompiled Header Processing 2 42 2 8 3 Other Ways to Control Precompiled Headers 2 43 2 8 4 Performance Issues V Y aa 2 44 VI Table of Contents 7 COMPILER USE 3 1 3 1 Invocation hive owe awa beta cde dy deka dees a 3 1 1 Detailed Description of the Compiler Options 3 16 3 2 Include Fil amp S 1 sacks het ay tp legac Sas a a a 3 116 3 3 Pragmas y Cwn gw o Dahan ok ee oka Cea GN 3 119 3 4 Compiler Limits ua a gwy WL AY GAY Yy DYDW YRFA 3 121 COMPILER DIAGNOSTICS 4 1 4 1 Diagnostic Messages Y aa 4 3 4 2 Termination Messages V a 4 5 4 3 Response to Signals Y AA 4 6 4 4 Return Values FF FF FFF aa 4 6 ERROR MESSAGES A 1 Introdu cO eise rair hiiio FFF eae A BAS A 3 2 Messa Sesta aaae CD Nedw O A AAS A 4 UTILITY PROGRAMS B 1 Introduction sa suede teehee cake EER yW EG WY YB B 3 2 Prelin Keres Ase dn A GW Td OF B 3 INDEX Manual Purpose and Structure VII MANUAL PURPOSE AND STRUCTURE PURPOSE This manual is aimed at users of the TASKING M16C C Compiler It assumes that you are conversant with the C and C language MANUAL STRUCTURE Related Publications Conven
115. is finished the linker is invoked Note that simply because the prelinker completes successfully does not assure that the linker will not detect errors Unresolvable template references and other linker errors will not be diagnosed by the prelinker Overview 1 7 1 2 2 THE MUNCHER PHASE The muncher phase implements global initialization and termination code The muncher phase is a special part of the linker that creates sections containing a list of pointers to the initialization and termination routines The list of pointers is consulted at run time by startup code invoked from _main and the routines on the list are invoked at the appropriate times 1 8 Chapter 1 1 3 ENVIRONMENT VARIABLES This section contains an overview of the environment variables used by the M16C toolchain Environment Variable Description ASM16CINC With this variable you specify one or more additional directories in which the assembler asm16c looks for include files The assembler first looks in these directories then always looks in the default productXinclude directory CM16CINC With this variable you specify one or more additional directories in which the C compiler cm16c looks for include files The compiler first looks in these directories then always looks in the default product include directory CCM16CBIN With this variable you specify the directory in which the control program ccm16c looks for the
116. is incompatible with formal parameter A 76 Appendix A 1034 asmfunc not allowed use extern asm instead of _asmfunc for external assembly functions UTILITY PROGRAMS ail TASKING M XIGNAddV Utility Programs B 3 1 INTRODUCTION This appendix describes the prelinker utility program that is delivered with the C compiler The utility program helps with various link time issues and is meant to be called from the control program amp When you use a UNIX shell Bourne shell C shell arguments containing special characters such as and must be enclosed with or escaped The option in the C shell becomes or 2 PRELINKER The prelinker is invoked at link time by the control program to manage automatic instantiation of template entities It is given a complete list of the object files and libraries that are to be linked together It examines the external names defined and referenced within those files and finds cases where template entities are referenced but not defined It then examines information in the object files that describes instantiations that could have been done during compilation and assigns the needed instantiations to appropriate files The prelinker then invokes the compiler again to compile those files which will do the necessary instantiations The invocation syntax of the C prelinker is prelkm16c option files where
117. ist no match for addr of overloaded function no instance of entity kind entity matches the required type delete_count_anachronism delete array size expression used anachronism bad return type for op arrow operator for class type returns invalid type type cast_to abstract class a cast to abstract class type is not allowed bad use of main function main may not be called or have its address taken initializer not allowed _on array new a new initializer may not be specified for an array member function redecl outside class member function entity may not be redeclared outside its class ptr_to_incomplete_class_type_not allowed pointer to incomplete class type is not allowed ref to nested function var reference to local variable of enclosing function is not allowed A 30 0395 0397 0398 0399 0400 0401 0403 0404 0405 0406 0407 0408 Appendix A single arg postfix incr decr anachronism single argument function used for postfix xxxx anachronism bad default assignment implicitly generated assignment operator cannot copy nonstd array_cast cast to array type is nonstandard treated as cast to type class_with_op_new_but no op delete entity kind entity has an operator newxxxx but no default operator deletexxxx class_with_op_delete_but_no_op_new entity kind entity
118. ist missing initializer list initialization with 4 expected for aggregate object incompatible_ptr_to_member_selection_operands pointer to member selection class types are incompatible type and type self friendship pointless friend declaration period used as gualifier used in place of to form a gualified name cfront anachronism const function anachronism non const function called for const object anachronism dependent_stmt_is_ declaration a dependent statement may not be a declaration void_param_not_allowed a parameter may not have void type bad templ arg expr operator this operator is not allowed in a template argument expression missing handler try block reguires at least one handler missing exception declaration handler reguires an exception declaration masked by_default handler handler is masked by default handler Error Messages A 39 0533 0534 0535 0536 0540 0541 0542 0543 0544 0545 0546 0548 0549 masked by_handler handler is potentially masked by previous handler for type type local_type_used_in_exception use of a local type to specify an exception redundant_exception_specification_type redundant type in exception specification incompatible exception specification exception specification is incompatible with that of previous entity kind entity declared at line xxxx no_ excepti
119. kers are considered at the same time as other measures of the goodness of the match of an argument value and the corresponding parameter type this is the standard approach In late tie breaker processing tie breakers are ignored during the initial comparison and considered only if two functions are otherwise equally good on all arguments the tie breakers can then be used to choose one function over another Example cpml6c late tiebreaker test cc Compiler Use embedded Option embedded no embedded Default embedded Description Enable or disable support for embedded C language extension keywords Example To disable embedded C language extension keywords enter cpml6c no embedded test cc 3 39 3 40 Chapter 3 embedded c Option embedded c Description Enable the diagnostics of noncompliance with the Embedded C subset from which templates exceptions namespaces new style casts RTTI multiple inheritance virtual base classes and mutable are excluded Example To enable the diagnostics of noncompliance with the Embedded C subset enter cpml6c embedded ctr test cc Compiler Use 3 41 enum overloading Option enum overloading no enum overloading Default enum overloading Description Enable or disable support for using operator functions to overload builtin operations on enum typed operands Example
120. kind entity provides no initializer for cannot initialize fields implicitly generated constructor for class ype cannot initialize no ctor but const or ref member entity kind entity defines no constructor to initialize the following var_with_uninitialized_member entity kind entity has an uninitialized const or reference member var_with_uninitialized_field entity kind entity has an uninitialized const field missing const_assignment_operator class type has no assignment operator to copy a const object no_suitable_assignment_operator class type has no suitable assignment operator ambiguous_assignment_operator ambiguous assignment operator for class type missing typedef name declaration reguires a typedef name virtual not allowed virtual is not allowed static not allowed static is not allowed bound function cast anachronism cast of bound function to normal function pointer anachronism Error Messages A 29 0380 0381 0382 0384 0386 0387 0388 0389 0390 0391 0392 0393 0394 expr_not_ptr_to_member expression must have pointer to member type extra semicolon extra ignored nonstd_const member nonstandard member constant declaration standard form is a static const integral member no matching new function no instance of overloaded entity matches the argument l
121. l6CINC include cpml6c demo cc 4 When an include file is not found with the rules mentioned above the compiler tries the subdirectories include cpp and include one directory higher than the directory containing the cpm16c binary For example PC cpm16c exe is installed in the directory C CM16C BIN The directories searched for the include file are C CM16C INCLUDE CPP and C CM16C INCLUDE UNIX cpm16c is installed in the directory usr local cml6c bin The directories searched for the include file are usr local cml6c include cpp and usr local cml6c include The compiler determines run time which directory the binary is executed from to find this include directory 5 If the include file is still not found the directories specified in the sys include option are searched A directory name specified with the I option or in CPM16CINC may or may not be terminated with a directory separator because cpm 16c inserts this separator if omitted 3 118 Chapter 3 When you specify more than one directory to the environment variable CPMI1GCINC you have to use one of the following separator characters PC Space eg set CPM16CINC include proj include UNIX Space eg setenv CPMI6CINC include proj include If the include directory is specified as e g I the option indicates the point in the list of I or include directory options at which the search for file names enclosed in lt
122. le or a specific definition is provided an error is issued template lt class T gt void fl T No body provided template lt class T gt void gl T No body provided Language Implementation 2 33 void fl int Specific definition void main int i double d f1 i f1 d gl i gl d pragma instantiate void fl int error specific definition pragma instantiate void gl int error no body provided 1 double and gl double will not be instantiated because no bodies were supplied but no errors will be produced during the compilation if no bodies are supplied at link time a linker error will be produced A member function name e g A lt int gt can only be used as a pragma argument if it refers to a single user defined member function i e not an overloaded function Compiler generated functions are not considered so a name may refer to a user defined constructor even if a compiler generated copy constructor of the same name exists Overloaded member functions can be instantiated by providing the complete member function declaration as in pragma instantiate char A lt int gt f int char The argument to an instantiation pragma may not be a compiler generated function an inline function or a pure virtual function 2 34 Chapter 2 2 6 4 IMPLICIT INCLUSION When implicit inclusion is enabled the C compiler is given permission to assume that if it needs
123. les contain information about things that could have been instantiated in each compilation For any source file that makes use of a template instantiation an associated ii file is created if one does not already exist e g the compilation of abc cc would result in the creation of abc ii When the object files are linked together a program called the prelinker prelkm16c is run It examines the object files looking for references and definitions of template entities and for the added information about entities that could be instantiated 3 Isn t this always the case No Suppose that file A contains a definition of class X and a reference to Stack lt X gt push and that file B contains the definition for the member function push There would be no file containing both the definition of push and the definition of x Language Implementation 2 29 3 If the prelinker finds a reference to a template entity for which there is no definition anywhere in the set of object files it looks for a file that indicates that it could instantiate that template entity When it finds such a file it assigns the instantiation to it The set of instantiations assigned to a given file is recorded in the associated instantiation reguest file with by default a ii suffix 4 The prelinker then executes the compiler again to recompile each file for which the ii file was changed The original compilation command line options saved in the template
124. lgorithm is used to try to open the include file 1 If the filename is enclosed in and it is not an absolute pathname does not begin with a for PC or a for UNIX the include file is searched for in the directory of the file containing the include line For example in PC cpml6c source test cc UNIX cpml6c source test cc cpmJ16c first searches in the directory source source for UNIX for include files If you compile a source file in the directory where the file is located cpm16c test cc the compiler searches for include files in the current directory amp This first step is not done for include files enclosed in lt gt 2 Use the directories specified with the I or include directory option in a left to right order For example PC cpml6c I include demo cc UNIX cpml6c I include demo cc 3 Check if the environment variable CPM16CINC exists If it does exist use the contents as a directory specifier for include files You can specify more than one directory in the environment variable CPM16CINC by using a separator character Instead of using I as in the example above you can specify the same directory using CPM16CINC Compiler Use 3 117 PC set CPM16CINC include cpml6c demo cc UNIX if using the Bourne shell sh CPM16CINC include export CPM16CINC cpml6c demo cc or if using the C shell csh setenv CPM
125. lified function type a gualified function type cannot be used to declare a nonmember function or a static member function bad gualified function _type_paramcter a gualified function type cannot be used to declare a parameter ptr_or ref to gualified function type cannot create a pointer or reference to gualified function type nonstd braces extra braces are nonstandard A 74 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 Appendix A bad cmd line macro invalid macro definition nonstandard ptr minus ptr subtraction of pointer types type and type is nonstandard empty_template_param list an empty template parameter list is not allowed in a template template parameter declaration exp_class expected class struct_not allowed the class keyword must be used when declaring a template template parameter virtual function decl hidden entity kind entity is hidden by entity virtual function override intended no gualified friend definition a gualified name is not allowed for a friend declaration that is a function definition not compatible_with templ templ param entity kind entity is not compatible with entity kind entity storage class reguires function or variable a storage class may not be specified here member using must_be_visible in direct base class member designated by a using declaration must
126. lowed to introduce a new type name struct A friend B h The third operand of the operator is a conditional expression instead of an assignment expression as it is in the modern language A reference to a pointer type may be initialized from a pointer value without use of a temporary even when the reference pointer type has additional type gualifiers above those present in the pointer value For example int p const int amp r p No temporary used A reference may be initialized with a null Because cfront does not check the accessibility of types access errors for types are issued as warnings instead of errors 2 18 Chapter 2 When matching arguments of an overloaded function a const variable with value zero is not considered to be a null pointer constant In general in overload resolution a null pointer constant must be spelled 0 to be considered a null pointer constant e g N0 is not considered a null pointer constant Inside the definition of a class type the gualifier in the declarator for a member declaration is dropped if that gualifier names the class being defined struct S void S f hi An alternate form of declaring pointer to member function variables is supported for example struct A void f int static void sf int typedef void A T3 int nonstd typedef decl typedef void T2 int std typedef hi typedef void A T int nonstd typedef decl T pmf amp A
127. manual 2 42 Index messages 3 88 performance 2 44 pragmas 2 43 prefix 2 41 use 2 42 3 109 predefined macros 2 35 predefined symbols 3 106 prelinker 1 5 B 3 prelinker prelkm16c 2 28 Q qualifier deduction 3 76 raw listing 3 66 remark 4 3 remarks 3 93 return values 4 6 run time type information 3 95 S signals 4 6 special function registers 3 26 stack 2 25 STLport library 2 3 string literals const 3 30 suffix include file 3 118 symbols predefined 3 106 syntax checking 3 73 system include directory 3 101 3 118 Index Index 9 T template 2 25 distinct signatures 3 36 guiding declarations 3 55 specialization 3 82 template instantiation 2 25 pragma directives 2 31 automatic 2 26 3 22 directory 3 65 implicit inclusion 2 34 3 57 instantiation modes 2 30 3 63 one file per object 3 84 pending 3 90 temporary files setting directory 1 9 tie breakers 3 38 timing information 3 102 tool chain 1 4 muncher 1 7 prelinker 1 5 type information 3 99 typename keyword 3 105 U using declaration allow unqualified name 3 77 utilities B 1 prelinker B 3 Vv version information 3 112 virtual function table 3 52 3 100 W warning 4 3 warnings suppress 3 79 3 80 wchar_t keyword 3 113 Index 10 INDEX Index
128. mation This option causes the compiler to display the amount of CPU time and elapsed time used by each phase of the compilation and a total for the entire compilation Example cpml6c test cc processed 180 lines at 8102 lines min Compiler Use 3 103 trace includes H Option H trace includes Description Do preprocessing only Instead of the normal preprocessing output generate on the preprocessing output file a list of the names of files included Examples cpml6c H test cc iostream h string h d gt preprocess E no line commands P 3 104 Chapter 3 tsw diagnostics Option tsw diagnostics no tsw diagnostics Default tsw diagnostics Description Enable or disable a mode in which the error message is given in the TASKING style So in the same format as the TASKING C compiler messages Example cpml6c no tsw diagnostics test cc d gt brief diagnostics Chapter Compiler Diagnostics and Appendix Error Messages Compiler Use typename Option typename no typename Default typename Description Enable or disable recognition of the typename keyword Example cpml6c no typename test cc d gt implicit typename 3 105 3 106 Chapter 3 undefine U Option Uname undefine name Arguments The name macro you want to undefine Description Remove any initial definition of id
129. ment with single or double guotes If you want to use single guotes as part of the argument surround the argument by double guotes and vise versa This has a single quote embedded This has a double guote embedded This has a double quote and a single quote embedded When a text line reaches its length limit use a to continue the line Whitespace between guotes is preserved This is a continuation line gt This is a continuation line It is possible to nest command line files up to 25 levels 3 50 Chapter 3 Example Suppose the file myoptions contains the following lines I proj include test cc Specify the option file to the C compiler cpml6c f myoptions This is equivalent to the following command line cpml6c I proj include test cc Compiler Use 3 51 for init diff warning Option for init diff warning no for init diff warning Default for init diff warning Description Enable or disable a warning that is issued when programs compiled under the new for init scoping rules would have had different behavior under the old rules The diagnostic is only put out when the new rules are used Example cpml6c no for init diff warning test cc d gt new for init old for init 3 52 Chapter 3 force vtbl Option force vtbl Description Force definition of virtual function tables in cases where the heuri
130. n Ouiet mode Turns off verbose mode Do not stop after the maximum number of iterations The instantiation process is iterative a recompilation may bring up new template entities that need to be instantiated which reguires another recompilation etc Some recursive templates can cause iteration that never terminates because each iteration introduces another new entity that was not previously there By default this process is stopped after a certain number of iterations Override the number of reserved instantiation information file lines to be used Specifies whether the prelinker should check for entities that are referenced as both explicit specializations and generated instantiations If number is zero the check is disabled otherwise the check is enabled Suppress instantiation flags in the object files Set the target CPU type This name is used to determine the actual location of the system libraries relative to the default lib directory Utility Programs u vV Specify that external names do not have an added leading underscore By default external names get a leading underscore With this option you specify that the leading underscore belongs to the external name Verbose mode B 5 B 6 UTILITIES Appendix B INDEX ail TASKING M X3GaNI Index Index 3 Symbols define 3 32 include 3 60 3 116 system include directory 3 101 pragma 3 119 undef 3 106
131. n Read command line arguments from file include directory dir ldir sys include dir incl suffixes suffixes include file file f file Compiler Use Description Option Preprocess options Preprocess only Keep line control preprocess information and remove comments Preprocess only Remove line control information and comments Keep comments in the preprocessed output Do syntax checking only Specify that a full compilation should be done not just preprocessing Put out line control information in the form nnn instead of line nnn Forces pcc style preprocessing Preprocess only Emit dependencies for make Preprocess only Generate list of included files Define preprocessor macro Remove preprocessor macro Allow or disallow macros with a variable number of arguments Allow or disallow macros with a variable number of arguments and allow the naming of the list no line commands P comments C no code gen n no preproc only old line commands old style preprocessing dependencies M trace includes H define macro parm list def Dmacro parm list def undefine macro Umacro variadic macros no variadic macros extended variadic macros no extended variadic macros Language control options Strict ANSI C Issue errors on non ANSI features Strict ANSI C Issue warn
132. n of entity kind entity bad_template_declaration xxxx is not a function or static data member A 34 0458 0459 0460 0461 0463 0464 0466 0467 0468 0469 0470 0471 0472 Appendix A bad_nontype_template_arg argument of type type is incompatible with template parameter of type type init needing temp_ not allowed initialization reguiring a temporary or conversion is not allowed decl hides function _parameter declaration of xxxx hides function parameter nonconst ref init from rvalue initial value of reference to non const must be an lvalue template_not allowed template is not allowed not a_class_template type is not a class template function template named main main is not a valid name for a function template union nonunion mismatch invalid reference to entity kind entity union nonunion mismatch local_type_in_template_arg a template argument may not reference a local type tag kind incompatible with declaration tag kind of xxxx is incompatible with declaration of entity kind entity declared at line xxxx name not tag in file scope the global scope has no tag named xxxx not a tag member entity kind entity has no tag member named xxxx ptr_to member typedef member function typedef allowed for cfront compatibility Error Messages A 35 0473 0475 0476 0477 0478
133. nd and digraphs enter cpml6c no alternative tokens test cc Compiler Use anachronisms Option anachronisms no anachronisms Default no anachronisms Description Enable or disable anachronisms Example cpml6c anachronisms test cc d gt nonconst ref anachronisms cfront 2 1 b cfront 3 0 Section Anachronisms Accepted in chapter Language Implementation 3 19 3 20 Chapter 3 arg dep lookup Option arg dep lookup no arg dep lookup Default arg dep lookup Description Controls whether argument dependent lookup of ungualified function names is performed Example cpml6c no arg dep lookup test cc Compiler Use array new and delete Option array new and delete no array new and delete Default array new and delete Description Enable or disable support for array new and delete Example cpml6c no array new and delete test cc 3 21 3 22 Chapter 3 auto instantiation T Option T auto instantiation no auto instantiation Default auto instantiation Description T is equivalent to auto instantiation Enable or disable automatic instantiation of templates Example cpml6c no auto instantiation test cc d gt instantiate t Section Template Instantiation in chapter Language Implementation Compiler Use 3 23 base assign op is default Opti
134. ng form test cc line 5 a break statement may only be used within a loop or switch break amp Note that the message identifies the file and line involved and that the source line itself with position indicated by the follows the message If there are several diagnostics in one source line each diagnostic will have the form above with the result that the text of the source line will be displayed several times with an appropriate position each time 4 4 Chapter 4 Long messages are wrapped to additional lines when necessary A configuration flag controls whether or not the string error appears i e the C compiler can be configured so that the severity string is omitted when the severity is error The command line option brief diagnostics may be used to reguest a shorter form of the diagnostic output in which the original source line is not displayed and the error message text is not wrapped when too long to fit on a single line The command line option display error number may be used to reguest that the error number be included in the diagnostic message When displayed the error number also indicates whether the error may have its severity overridden on the command line with one of the diag severity options If the severity may be overridden the error number will include the suffix D for discretionary otherwise no suffix will be present Test_name cc line 7 error 64 D declaration do
135. ntaining this field old_fashioned_ptr_field_selection pointer does not point to struct or union containing this field var_retained_incomp_type variable xxxx was declared with a never completed type Error Messages A 19 0236 0237 0238 0239 0240 0241 0242 0243 0244 0245 0246 0247 0248 0249 boolean controlling expr is constant controlling expression is constant switch selector expr is constant selector expression is constant bad param specifier invalid specifier on a parameter bad_specifier_outside_class_decl invalid specifier outside a class declaration dupl decl specifier duplicate specifier in declaration base_class_not allowed for union a union is not allowed to have a base class access already_specified multiple access control specifiers are not allowed missing class definition class or struct definition is missing name not member of class _or base classes qualified name is not a member of class type or its base classes member ref reguires_object a nonstatic member reference must be relative to a specific object nonstatic member def not allowed a nonstatic data member may not be defined outside its class already_defined entity kind entity has already been defined pointer_to_reference pointer to reference is not allowed reference_to_reference reference to reference is not allowed A 20 0250
136. nted Partial ordering of function templates is implemented Function declarations that match a function template are regarded as independent functions not as guiding declarations that are instances of the template It is possible to overload operators using functions that take enum types and no class types Explicit specification of function template arguments is supported Unnamed template parameters are supported The new lookup rules for member references of the form x A B and p gt A B are supported The notation template and gt template etc is supported In a reference of the form gt g with g a static member function is evaluated The ARM specifies that the left operand is not evaluated in such cases enum types can contain values larger than can be contained in an int Default arguments of function templates and member functions of class templates are instantiated only when the default argument is used in a call String literals and wide string literals have const type Language Implementation 2 9 2 4 2 Class name injection is implemented Argument dependent Koenig lookup of function names is implemented Class and function names declared only in ungualified friend declarations are not visible except for functions found by argument dependent lookup A void expression can be specified on a return statement in a void function Function try blocks i e try blocks that are t
137. ntiations 32 test cc d gt Section Template Instantiation in chapter Language Implementation Compiler Use 3 91 preprocess E Option E preprocess Description Do preprocessing only Write preprocessed text to the preprocessing output file with comments removed and with line control information When you use the E option use the output option to separate the output from the header produced by the compiler Example cpml6c E output preout test cc d gt comments C dependencies M no line commands P 3 92 Chapter 3 r8c Option r8c Description By default the compiler generates code for the M16C 60 core With this option you tell the C compiler to compile for the R8C tiny core You must use this option always and only then when you select an R8C target with the option Ccpu In EDE this option is automatically enabled when you select an R8C target Example To specify to the C compiler to look for a file named regm30624a sfr and to use this file as a special function register definition file enter cpml6c r8c Cr8c10 test cc d gt Ccpu Compiler Use remarks r Option r remarks Description Issue remarks which are diagnostic messages even milder than warnings Example To enable the display of remarks enter cpml6c r test cc 3 93 3 94 Chapter 3 remove unneeded entities Option remo
138. ntiations of template functions member functions of template classes and static data members of template classes hereafter referred to as template entities are not necessarily done immediately for several reasons e One would like to end up with only one copy of each instantiated entity across all the object files that make up a program This of course applies to entities with external linkage e The language allows one to write a specialization of a template entity i e a specific version to be used in place of a version generated from the template for a specific data type One could for example write a version of Stack lt int gt or of just Stack lt int gt push that replaces the template generated version often such a specialization provides a more efficient representation for a particular data type Since the compiler cannot know when compiling a reference to a template entity if a specialization for that entity will be provided in another compilation it cannot do the instantiation automatically in any source file that references it The language also dictates that template functions that are not referenced should not be compiled that in fact such functions might contain semantic errors that would prevent them from being compiled Therefore a reference to a template class should not automatically instantiate all the member functions of that class It should be noted that certain template entities are always instan
139. nvirtual_function pure specifier 0 allowed only on virtual functions bad_pure_specifier badly formed pure specifier only 0 is allowed bad_data_member_initialization data member initializer is not allowed abstract_class_object_not_allowed object of abstract class type type is not allowed function returning abstract class function returning abstract class type is not allowed Error Messages A 25 0324 0325 0326 0327 0328 0329 0330 0332 0333 0334 0335 0336 0337 duplicate friend decl duplicate friend declaration inline and nonfunction inline specifier allowed on function declarations only inline not allowed inline is not allowed bad storage class with inline invalid storage class for an inline function bad member storage _class invalid storage class for a class member local class_function def missing local class member entity kind entity requires a definition inaccessible special function entity kind entity is inaccessible missing const_copy_constructor class type has no copy constructor to copy a const object definition_of_implicitly_declared_function defining an implicitly declared member function is not allowed no_suitable_copy_constructor class type has no suitable copy constructor linkage_specifier_not_allowed linkage specification is not allowed bad_linkage_specifier
140. ompiled header processing is enabled This means the C compiler will automatically look for a qualifying precompiled header file to read in and or will create one for use on a subsequent compilation The PCH file will contain a snapshot of all the code preceding the header stop point The header stop point is typically the first token in the primary source file that does not belong to a preprocessing directive but it can also be specified directly by pragma hdrstop see below if that comes first For example include xxx h include yyy h int i The header stop point is int the first non preprocessor token and the PCH file will contain a snapshot reflecting the inclusion of xxx h and yyy h If the first non preprocessor token or the pragma hdrstop appears within a if block the header stop point is the outermost enclosing if To illustrate heres a more complicated example Language Implementation 2 39 include xxx h ifndef YYY_H define YYY_H 1 include yyy h endif if TEST int i endif Here the first token that does not belong to a preprocessing directive is again int but the header stop point is the start of the if block containing it The PCH file will reflect the inclusion of xxx h and conditionally the definition of YYY_H and inclusion of yyy h it will not contain the state produced by if TEST A PCH file will be produced only if the header stop point and the code preceding it ma
141. on base assign op is default no base assign op is default Default base assign op is default in cfront compatibility mode Description Enable or disable the anachronism of accepting a copy assignment operator that has an input parameter that is a reference to a base class as a default copy assignment operator for the derived class Example cpml6c base assign op is default test cc 3 24 bool Option bool no bool Default bool Description Enable or disable recognition of the bool keyword Example cpml6c no bool test cc Chapter 3 Compiler Use 3 25 brief diagnostics Option brief diagnostics no brief diagnostics Default brief diagnostics Description Enable or disable a mode in which a shorter form of the diagnostic output is used When enabled the original source line is not displayed and the error message text is not wrapped when too long to fit on a single line Example cpml6c no brief diagnostics test cc d gt wrap diagnostics Chapter Compiler Diagnostics and Appendix Error Messages 3 26 Chapter 3 C Option Ccpu Arguments The cpu name which identifies your M16C derivative Description Use special function register definitions for cpu The filename looked for is regcpu sfr in the same way include files whose names are enclosed in are searched Example To specify to the C com
142. on has been provided If the instantiation is no longer needed it is removed from the list internally the file will be updated later and the file is flagged as reguiring recompilation The prelinker then examines any symbols referenced by the input file The responsibility for generating an instantiation of a given entity that has not already been defined is assigned to the first file that is capable of generating that instantiation Once all of the assignments have been updated the prelinker once again goes through the list of object files For each if the corresponding instantiation information file must be updated the new file is written Only source files whose corresponding ii file has been modified will be recompiled At this point each ii file contains the information needed to recompile the source file and a list of instantiations assigned to the source file in the form of mangled function and static data member names If an error occurs during a recompilation the prelinker exits without updating the remaining information files and without attempting any additional compilations If all recompilations complete without error the prelink process is repeated since an instantiation can produce the demand for another instantiation This prelink cycle finding uninstantiated templates updating the appropriate ii files and dispatching recompilations continues until no further recompilations are reguired When the prelinker
143. on support support for exception handling is disabled omitted exception specification omission of exception specification is incompatible with previous entity kind entity declared at line xxxx cannot create instantiation request file could not create instantiation request file xxxx non arith operation in templ arg non arithmetic operation not allowed in nontype template argument local type in nonlocal var use of a local type to declare a nonlocal variable local type in function use of a local type to declare a function branch past initialization transfer of control bypasses initialization of branch into handler transfer of control into an exception handler used before set entity kind entity is used before its value is set A 40 0550 0551 0552 0553 0554 0555 0556 0558 0559 0560 0561 0562 0563 Appendix A set_but_not used entity kind entity was set but never used bad scope for definition entity kind entity cannot be defined in the current scope exception_specification_not_allowed exception specification is not allowed template_and_instance_linkage conflict external internal linkage conflict for entity kind entity declared at line xxxx conversion function not usable entity kind entity will not be called for implicit or explicit conversions tag_kind_incompatible_with_template_parameter tag kind of xxx
144. ons modifying an arithmetic a structure a union or an incomplete type in a declaration 15 e 31 nesting levels of parenthesized declarators within a full declarator P gt 31 e 32 nesting levels of parenthesized expressions within a full expression P gt 32 e 31 significant characters in an external identifier full ANSI C mode 120 significant characters in an external identifier non ANSI C mode e 511 external identifiers in one translation unit D e 127 identifiers with block scope declared in one block D e 1024 macro identifiers simultaneously defined in one translation unit D 31 parameters in one function declaration D 31 arguments in one function call D e 31 parameters in one macro definition D e 31 arguments in one macro call D e 509 characters in a logical source line 1500 e 509 characters in a character string literal or wide string literal after concatenation 1500 3 122 Chapter 3 8 nesting levels for included files 50 257 case labels for a switch statement excluding those for any nested switch statements D 127 members in a single structure or union D 127 enumeration constants in a single enumeration D 15 levels of nested structure or union definitions in a single struct declaration list D COMPILER DIAGNOSTICS ail TASKING M diLdVHO Compiler Diagnostics 4 3 4 1 DIAGNOSTIC MESSAGES Diagnostic messages have an associated se
145. ons now does something that approximates the two phase lookup rule of the standard When a name is looked up as part of a template instantiation but is not found in the local context of the instantiation it is looked up in a synthesized instantiation context The C compiler follows the new instantiation lookup rules for namespaces as closely as possible in the absence of a complete implementation of the new template name binding rules Here is an example namespace N int g int int x 0 template lt class T gt struct A T T t return g t T return x hi namespace M int x 99 double g double N A lt int gt ai int i ai f 0 N A lt int gt f int calls N g int int i2 ai f N A lt int gt f returns 0 N x N A lt double gt ad double d ad f 0 N A lt double gt f double calls M g double double d2 ad f N A lt double gt f also returns 0 N x The lookup of names in template instantiations does not conform to the rules in the standard in the following respects e Although only names from the template definition context are considered for names that are not functions the lookup is not limited to those names visible at the point at which the template was defined 2 24 Chapter 2 e Functions from the context in which the template was referenced are considered for all function calls in the template Functions from the refe
146. op 2 38 2 43 ident 3 120 implicit inclusion 2 34 include files 3 116 at beginning of compilation 3 61 default directory 3 117 setting search directories 1 8 suffix 3 59 3 118 inline function 3 47 inlining 3 62 instantiate 3 119 instantiation 2 25 automatic 2 28 directory 3 65 one file per object 3 84 pending 3 90 template 3 63 instantiation information file 1 5 instantiation mode 2 30 all 2 31 local 2 31 none 2 30 used 2 30 instantiation pragmas 2 31 internal error 4 3 introduction 1 3 invocation 3 3 K keyword bool 3 24 typename 3 105 wchar t 3 113 L language extensions 3 98 language implementation 2 1 libraries setting search directories 1 8 library 2 3 license wait for available license 1 8 license file setting search directory 1 8 lifetime 3 68 limits compiler 3 121 list file 3 66 long arithmetic conversion rules 3 69 lookup of unqualified function names 3 20 macros predefined 2 35 variable argument list 3 46 3 111 messages diagnostic 4 3 termination 4 5 muncher 1 7 namespace 2 23 3 71 std 3 110 no_pch 2 43 3 119 Index 6 o once 3 119 operator keywords 3 18 option file 3 49 options AG SAL 3 102 3 37 alternative tokens 3 18 anacbronisms 3 19 arg dep lookup 3 20 array new and delete 3 21 aulo instantiation 3 22 base assign op is default 3 23 bool 3 24 brief diagn
147. operator function can be used to overload both prefix and postfix operations The base class name may be omitted in a base class initializer if there is only one immediate base class Assignment to this in constructors and destructors is allowed This is allowed only if anachronisms are enabled and the assignment to this configuration parameter is enabled A bound function pointer a pointer to a member function for a given object can be cast to a pointer to a function A nested class name may be used as a non nested class name provided no other class of that name has been declared The anachronism is not applied to template classes A reference to a non const type may be initialized from a value of a different type A temporary is created it is initialized from the converted initial value and the reference is set to the temporary A reference to a non const class type may be initialized from an rvalue of the class type or a derived class thereof No additional temporary is used A function with old style parameter declarations is allowed and may participate in function overloading as though it were prototyped Default argument promotion is not applied to parameter types of such functions when the check for compatibility is done so that the following declares the overloading of two functions named f int f int int f x char x 4 return x Note that in C this code is legal but has a different meaning a tenta
148. or enum type cl enum oveloading option only in cplusplus option enum _ overloading can be used only when compiling C destructor gualifier type mismatch qualifier of destructor name type does not match type type type_qualifier_ignored type qualifier ignored cl_nonstandard_qualifier_deduction_option_only_in_cplusplus option nonstd gualifier deduction can be used only when compiling C bad_declspec_property incorrect property specification correct form is __ declspec property getznamel putzname2 dupl get or put property has already been specified declspec_property_not allowed __ declspec property is not allowed on this declaration no get property member is declared with __ declspec property but no get function was specified get property function missing the _ declspec property get function xxxx is missing no_put property member is declared with __ declspec property but no put function was specified Error Messages A 67 0911 0912 0913 0914 0915 0916 0917 0918 0919 0920 0921 0922 put property_function missing the _ declspec property put function xxxx is missing dual lookup ambiguous name ambiguous class member reference entity kind entity declared at line xxxx used in preference to entity kind entity declared at line xxxx bad allocate segname missing or invalid
149. ostics 3 25 cfront 2 1 3 27 cfront 3 0 3 27 class name injection 3 28 comments 3 29 const string literals 3 30 create pch 3 31 define 3 32 dependencies 3 33 diag error 3 34 diag remark 3 34 diag suppress 3 34 diag warning 3 34 display error number 3 35 distinct template signatures 3 36 dollar 3 37 early tiebreaker 3 38 embedded 3 39 embedded c 3 40 enum ovwerloading 3 41 error limit 3 42 error ouiput 3 43 exceptions 3 44 explicit 3 45 extended variadic macros 3 46 extern inline 3 47 Index for init diff warning 3 51 force vtbl 3 52 friend injection 3 53 gen c file uame 3 54 guiding decls 3 55 implicit exlern c type conwersion 3 56 implicit include 3 57 implicit typename 3 58 incl suffixes 3 59 include directory 3 60 include file 3 61 inlining 3 62 instantiate 3 63 instantiation dir 3 65 ate tiebreaker 3 38 list file 3 66 long lifetime temps 3 68 ong preserving rules 3 69 namespaces 3 71 new for inil 3 72 no alternative tokens 3 18 no anachronisms 3 19 no arg dep lookup 3 20 no array new and delete 3 21 no auto instantiation 3 22 no base assign op is default 3 23 no bool 3 24 no brief diasnostics 3 25 no class name injection 3 28 no code gen 3 73 no const string literals 3
150. p does not justify the creation of another PCH file pragma no_pch may be used to suppress precompiled header processing for a given source file Command line option pch dir directory name is used to specify the directory in which to search for and or create a PCH file Moreover when the host system does not support memory mapping and preallocated memory is used instead then one of the command line options pch create pch or use pch if it appears at all must be the first option on the command line 2 44 Chapter 2 2 8 4_ PERFORMANCE ISSUES The relative overhead incurred in writing out and reading back in a precompiled header file is guite small for reasonably large header files In general it does not cost much to write a precompiled header file out even if it does not end up being used and if it 7s used it almost always produces a significant speedup in compilation The problem is that the precompiled header files can be guite large from a minimum of about 250K bytes to several megabytes or more and so one probably does not want many of them sitting around Thus despite the faster recompilations precompiled header processing is not likely to be justified for an arbitrary set of files with nonuniform initial seguences of preprocessing directives Rather the greatest benefit occurs when a number of source files can share the same PCH file The more sharing the less disk space is consumed With sharin
151. pecified name Use a precompiled header file of the specified name Specify directory dir in which to search for and or create a precompiled header file Enable or disable the display of a message indicating that a precompiled header file was created or used in the current compilation Generate a message when a precompiled header file cannot be used create pch file use pch file pch dir dir pch messages no pch messages pch verbose Output file options Write preprocess output in file Specify name of generated C output file output file gen c file name file o file Diagnostic options Display invocation syntax Display version header only Generate compilation timing information Send diagnostics to error list file Generate raw list file file Generate cross reference file xfile Override normal error severity Display error number in diagnostic messages version V V timing error output efile list file file L file xref xfile X xfile diag suppress tag tag diag remark tag tag diag warning tag tag diag error tag tag display error number 3 16 Chapter 3 Description Option Specify maximum number of errors Issue remarks Suppress all warning messages Suppress warnings on local automatic variables that are used before their values are set
152. piler to look for a file named regm30624a sfr and to use this file as a special function register definition file enter cpml6c Cm30624a test cc d gt Section Calling the Compiler in chapter Using the Compiler of the M16C C Compiler Assembler Linker User s Manual Compiler Use 3 27 cfront version b Option b cfront 2 1 cfront 3 0 Default Normal C mode Description b is equivalent to cfront 2 1 cfront 2 1 or cfront 3 0 enable compilation of C with compatibility with cfront version 2 1 or 3 0 respectively This causes the compiler to accept language constructs that while not part of the C language definition are accepted by the AT amp T C Language System cfront release 2 1 or 3 0 respectively These options also enable acceptance of anachronisms Example To compile C compatible with cfront version 3 0 enter cpml6c cfront 3 0 test cc d gt anachronisms Section Extensions Accepted in Cfront 2 1 and 3 0 Compatibility Mode in chapter Language Implementation 3 28 Chapter 3 class name injection Option class name injection no class name injection Default class name injection Description Controls whether the name of a class is injected into the scope of the class as reguired by the standard or is not injected as was true in carlier versions of the C language Example cpml6c no class name injection test cc
153. py assignment operator 3 23 CPM16CINC 3 116 cross reference 3 115 derivatives 3 26 detailed option description compiler 3 16 3 115 development flow 1 4 diagnostics 4 1 brief 3 25 error severity 3 34 4 3 TASKING style 3 104 wrap 3 114 digraph 3 18 directory separator 3 117 do_not_instantiate 3 119 dollar signs 3 37 embedded C 3 39 3 40 entities remove unneeded 3 94 enum overloading 3 41 environment variables ASM16CINC 1 8 CCM16CBIN 1 8 CCM16COPT 1 8 CM16CINC 1 8 CPM16CINC 1 8 3 116 LIBM16C 1 8 LIBRSC 1 8 LM_LICENSE_FILE 1 8 overview of 1 8 PATH 1 9 TASKING_LIC_WAIT 1 8 TMPDIR 1 9 used by tool chain 1 8 error 4 3 Index error level 4 6 error limit 3 42 error messages A 1 error number 3 35 error output file 3 43 error severity 3 34 4 3 exception 3 44 exit status 4 6 explicit specifier 3 45 extension 1 10 a 1 10 abs 1 10 asm 1 10 c 1 10 cc 1 10 cpp 1 10 cxx 1 10 elf 1 10 elk 1 11 eln 1 10 err 1 11 ers 1 11 bex 1 10 ic 1 10 sl 1 10 Ast 1 11 map 1 11 obj 1 10 S 1 10 src 1 10 extensions to C 2 4 2 6 extern C 3 56 extern C 3 56 extern inline 3 47 F file extensions 1 10 3 3 floating point single precision 3 48 for init statement 3 51 3 72 friend injection 3 53 Index Index 5 function names unqualified 3 20 G guiding declarations 3 55 hdrstop 3 119 header st
154. r A amp h By default as well as in cfront compatibility mode there will be no implicit declaration of B operator const B amp whereas in strict ANSI mode B operator A amp is not a copy assignment operator and B operator const B amp is implicitly declared Implicit type conversion between a pointer to an extern C function and a pointer to an extern C function is permitted Here s an example extern C void f f s type has extern C linkage void pf pf points to an extern C function amp f error unless implicit conversion is allowed This extension is allowed in environments where C and C functions share the same calling conventions It is enabled by default it can also be enabled in cfront compatibility mode or with option implicit extern c type conversion It is disabled in strict ANSI mode A operator whose second and third operands are string literals or wide string literals can be implicitly converted to char or wehar_t Recall that in C string literals are const There is a deprecated implicit conversion that allows conversion of a string literal to char dropping the const That conversion however applies only to simple string literals Allowing it for the result of a operation is an extension char p x abc def Except in strict ANSI mode default arguments may be specified for function parameters other
155. ration that matches an instance of a function template but has no explicit definition since its definition derives from the function template For example template lt class T gt void f T void f int When regarded as a guiding declaration int is an instance of the template otherwise it is an independent function for which a definition must be supplied If no guiding decls is combined with old specializations a specialization of a non member template function is not recognized it is treated as a definition of an independent function Example cpml6c no guiding decls test cc d gt old specializations 3 56 Chapter 3 implicit extern c type conversi on Option implicit extern c type conversion no implicit extern c type conversion Default implicit extern c type conversion Description Enable or disable an extension to permit implicit type conversion in C between a pointer to an extern C function and a pointer to an extern C function This extension is allowed in environments where C and C functions share the same calling conventions Example cpml6c no implicit extern c type conversion test cc Compiler Use 3 57 implicit include B Option B implicit include no implicit include Default no implicit include Description Enable or disable implicit inclusion of source files as a method of finding definitions of templa
156. rd C PF and PCF are different and incompatible types PF is a pointer to an extern C function whereas PCF is a pointer to an extern c function and the two declarations of f create an overload set Functions declared inline have internal linkage enum types are regarded as integral types An uninitialized const object of non POD class type is allowed even if its default constructor is implicitly declared struct A virtual void f int i const A a A function paramcter type is allowed to involve a pointer or reference to array of unknown bounds If the user declares an operator function in a class but not one that can serve as the default operator and bitwise assignment could be done on the class a default operator is not generated only the user written operator functions are considered for assignments and therefore bitwise assignment is not done A member function declaration whose return type is omitted and thus implicitly int and whose name is found to be that of a type is accepted if it takes no parameters typedef int I struct S I Accepted in Cfront mode declares int S I I int Not accepted hi Language Implementation 2 23 2 5 NAMESPACE SUPPORT Namespaces are enabled by default except in the cfront modes You can use the command line options namespaces and no namespaces to enable or disable the features Name lookup during template instantiati
157. re are two other possibilities to steer the code generator command line options and keywords The compiler acknowledges these three groups using the following rule Command line options can be overruled by keywords and pragmas Keywords can be overruled by pragmas So the pragma has the highest priority This approach makes it possible to set a default optimization level for a source module which can be overridden temporarily within the source by a pragma cpm16c supports the following pragmas and all pragmas that are described in the C Compiler Assembler Linker User s Manual instantiate do_not_instantiate can_instantiate These are template instantiation pragmas They are described in detail in the section Template Instantiation in chapter Language Implementation hdrstop no_pch These are precompiled header pragmas They are described in detail in the section Precompiled Headers in chapter Language Implementation once When placed at the beginning of a header file indicates that the file is written in such a way that including it several times has the same effect as including it once Thus if the C compiler sees pragma once at the start of a header file it will skip over it if the file is included again A typical idiom is to place an ifndef guard around the body of the file with a define of the guard variable after the ifndef 3 120 ident Chapter 3 pragma once optional ifndef FILE H define F
158. rencing context should only be visible for dependent function calls The lookup rules for overloaded operators are implemented as specified by the standard which means that the operator functions in the global scope overload with the operator functions declared extern inside a function instead of being hidden by them The old operator function lookup rules are used when namespaces are turned off This means a program can have different behavior depending on whether it is compiled with namespace support enabled or disabled struct A A operator A double void f A al A operator A int al 1 0 calls operator A double with namespaces enabled but otherwise calls operator A int Language Implementation 2 25 2 6_ TEMPLATE INSTANTIATION The C language includes the concept of templates A template is a description of a class or function that is a model for a family of related classes or functions For example one can write a template for a Stack class and then use a stack of integers a stack of floats and a stack of some user defined type In the source these might be written Stack lt int gt Stack lt float gt and Stack lt X gt From a single source description of the template for a stack the compiler can create inslantiations of the template for each of the types reguired The instantiation of a class template is always done as soon as it is needed in a compilation However the insta
159. rived class type base class is virtual no matching constructor no instance of constructor entity matches the argument list ambiguous copy_constructor copy constructor for class type is ambiguous no_default_constructor no default constructor exists for class type not a field or base class xxxx is not a nonstatic data member or base class of class type indirectnonvirtual base_class_not allowed indirect nonvirtual base class is not allowed bad union field invalid union member class type has a disallowed member function bad rvalue array invalid use of non lvalue array Error Messages A 23 0297 0298 0299 0300 0301 0302 0304 0305 0306 0307 0308 0309 0510 exp_ operator expected an operator inherited member_not allowed inherited member is not allowed indeterminate_overloaded function cannot determine which instance of entity kind entity is intended bound function must be called a pointer to a bound function may only be used to call the function duplicate_typedef typedef name has already been declared with same type function_redefinition entity kind entity has already been defined no matching function no instance of entity kind entity matches the argument list type def not allowed in func type decl type definition is not allowed in function return type declaration defa
160. rsion function must be a nonstatic member function bad template declaration scope template declaration is not allowed here exp lt 299 expected a lt exp_ gt expected a gt missing template_param template parameter declaration is missing Error Messages A 33 0441 0442 0443 0445 0446 0447 0449 0450 0451 0452 0456 0457 missing template arg list argument list for entity kind entity is missing too few_template args too few arguments for entity kind entity too many_template args too many arguments for entity kind entity not used in template function params entity kind entity is not used in declaring the parameter types of entity kind entity cfront_multiple_nested_types two nested types have the same name entity and entity declared at line xxxx cfront compatibility cfront global defined after nested type global entity was declared after nested entity declared at line xxxx cfront compatibility ambiguous_ ptr to overloaded function more than one instance of entity kind entity matches the required type nonstd long long the type long long is nonstandard nonstd friend decl omission of xxxx is nonstandard return_type_on_conversion_function return type may not be specified on a conversion function runaway_recursive_instantiation excessive recursion at instantiatio
161. ruct or union type old fashioned assignment_ operator old fashioned assignment operator old fashioned initializer old fashioned initializer expr_not integral constant expression must be an integral constant expression Error Messages A 15 0158 0159 0160 0161 0163 0164 0165 0166 0167 0168 0169 0170 0171 expr not an lvalue or function designator expression must be an lvalue or a function designator decl incompatible_with_ previous use declaration is incompatible with previous entity declared at line XXXX external name clash name conflicts with previously used external name xxxx unrecognized pragma unrecognized pragma cannot_open_temp file could not open temporary file xxxx temp file dir name _too long name of directory for temporary files is too long xxxx too_few_arguments too few arguments in function call bad float_constant invalid floating constant incompatible_param argument of type type is incompatible with parameter of type type function_type_not_allowed a function type is not allowed here exp declaration expected a declaration pointer_outside_base_object pointer points outside of underlying object bad_cast invalid type conversion A 16 0172 0173 0174 0175 0177 0178 0179 0180 0181 0182 0183 0184 0185 Appendix A linkage conflict external internal
162. s option guiding decls can be used only when compiling C Error Messages A 63 0857 0858 0859 0860 0861 0862 0863 0864 0865 0866 0867 0868 0869 member partial spec_not in namespace a partial specialization of a class template must be declared in the namespace of which it is a member pure_virtual_function entity kind entity is a pure virtual function no_overrider for pure virtual function pure virtual entity kind entity has no overrider decl modifiers ignored __ declspec attributes ignored invalid char invalid character in input line incomplete return type function returns incomplete type type local_pragma_pack effect of this pragma pack directive is local to entity kind entity not_a_template xxxx is not a template friend partial specialization a friend declaration may not declare a partial specialization exception specification ignored exception specification ignored unexpected type for size_t declaration of size_t does not match the expected type type exp_gt not shift right space required between adjacent gt delimiters of nested template argument lists gt gt is the right shift operator bad_multibyte_char_locale could not set locale xxxx to allow processing of multibyte characters A 64 0870 0871 0872 0873 0874 0875 0876 0877 0878 0879 0880
163. s A 43 0592 0593 0594 0595 0596 0597 0598 0599 0600 0601 0602 0603 0604 cl strict ansi incompatible_with_cfront strict ANSI mode is incompatible with cfront mode cl missing source file name missing source file name cl output file incompatible_with multiple inputs output files may not be specified when compiling several input files cl too many arguments too many arguments on command line cl no output file needed an output file was specified but none is needed cl il display reguires il file name IL display reguires name of IL file void_template_parameter a template parameter may not have void type too_many_unused_instantiations excessive recursive instantiation of entity kind entity due to instantiate all mode cl_strict_ansi_incompatible_with_anachronisms strict ANSI mode is incompatible with allowing anachronisms void_throw a throw expression may not have void type cl tim local conflicts_with auto instantiation local instantiation mode is incompatible with automatic instantiation abstract_class_param_type parameter of abstract class type type is not allowed array_of abstract class array of abstract class type is not allowed A 44 0605 0606 0607 0608 0609 0611 0612 0613 0614 0615 0616 0617 0618 Appendix A float_template_parameter floating point template parameter is nons
164. s in overload resolution Enable or disable support for embedded C language extension keywords Enable the diagnostics of noncompliance with the Embedded C subset Enable or disable operator functions to overload builtin operators on enum typed operands Specify maximum number of errors Send diagnostics to error list file Enable or disable support for exception handling Enable or disable support for the explicit specifier on constructor declarations Chapter 3 Option Description extended variadic macros no extended variadic macros extern inline no extern inline F f file force vtbl for init diff warning no for init diff warning friend injection no friend injection gen c file name file o file guiding decls no guiding decls implicit extern c type conversion Allow or disallow macros with a variable number of arguments and allow the naming of the list Enable or disable inline function with external C linkage Single precision floating point Read command line arguments from file Force definition of virtual function tables Enable or disable warning when old style or scoping is used Control the visibility of friend declarations Specify name of generated C output file Enable or disable recognition of guiding declarations of template functions no implicit extern c type conversion implicit
165. specialized entity kind entity is not an entity that can be explicitly specialized specialization_of_referenced_entity explicit specialization of entity kind entity must precede its first use A 58 0794 0795 0798 0799 0800 0801 0802 0803 0804 0805 0806 Appendix A template_param in elab type template parameter xxxx may not be used in an elaborated type specifier old specialization not allowed specializing entity kind entity requires template lt gt syntax cl_old_specializations_option_only_in_cplusplus option old_specializations can be used only when compiling C nonstd_old_specialization specializing entity kind entity without template lt gt syntax is nonstandard bad linkage for decl this declaration may not have extern C linkage not a_template_name xxxx is not a class or function template name in the current scope nonstd default arg on function template redecl specifying a default argument when redeclaring an unreferenced function template is nonstandard default arg on function template_ not allowed specifying a default argument when redeclaring an already referenced function template is not allowed pm derived class from_virtual base cannot convert pointer to member of base class type to pointer to member of derived class type base class is virtual bad exception specification for sp
166. specify that a full compilation should be done not just preprocessing When used with the implicit inclusion option this makes it possible to generate a preprocessed output file that includes any implicitly included files Examples cpml6c E B mnno preproc only test cc d gt preprocess E implicit include B no line commands P Compiler Use no use before set warnings j Option j no use before set warnings Description Suppress warnings on local automatic variables that are used before their values are set Example cpml6c j test cc d gt no warnings w 3 79 3 80 no warnings w Option wW no warnings Description Suppress all warning messages Error messages are still issued Example To suppress all warnings enter cpml6c w test cc Chapter 3 Compiler Use 3 81 old line commands Option old line commands Description When generating source output put out line directives in the form used by the Reiser cpp that is nnn instead of line nnn Example To do preprocessing only without comments and with old style line control information enter cpml6c E old line commands test cc preprocess E no line commands P 3 82 Chapter 3 old specializations Option old specializations no old specializations Default old specializations Description Enable or
167. ss 3 91 r8C 3 92 remarks 3 93 remove unneeded entities 3 94 riti 3 95 short lifetime temps 3 68 signed chars 3 96 special subscripi cost 3 97 strict 3 98 strict warnings 3 98 suppress typeinfo vars 3 99 suppress vtbl 3 100 sys include 3 101 timing 3 102 trace includes 3 103 tsw diagnostics 3 104 typename 3 105 undefine 3 106 unsigned chars 3 108 use pch 3 109 using std 3 110 variadic macros 3 111 version 3 112 wchar_t keyword 3 113 wrap diagnostics 3 114 xref 3 115 A 3 98 a 3 98 B 3 57 b 3 27 C 3 26 3 29 D 3 32 E 3 91 e 3 42 F 3 48 f 3 49 H 3 103 I 3 60 Jj 3 79 L 3 66 M 3 33 Mmodel 3 70 Index 8 n 3 73 0 3 54 P 3 74 r 3 93 s 3 96 T 3 22 t 3 63 U 3 106 u 3 108 V 3 112 v 3 112 w 3 80 X 3 115 x 3 44 detailed description 3 16 overview 3 3 overview in functional order 3 10 priority 3 3 output file 3 54 3 85 overview 1 1 P pch mode automatic 2 38 3 86 manual 2 42 3 31 3 109 pragma can_instantiate 2 32 3 119 do_not_instantiate 2 31 3 119 hdrstop 2 38 2 43 3 119 ident 3 120 instantiate 2 31 3 119 no_pch 2 43 3 119 once 3 119 pragmas 3 119 precompiled header 2 38 automatic 2 38 3 86 creale 2 42 3 31 directory 2 42 2 43 3 87 file cannot be used 3 89
168. stantiate only the template entities that are used in this compilation all Instantiate all template entities whether or not they are used local Instantiate only the template entities that are used in this compilation and force those entities to be local to this compilation 3 64 Chapter 3 Example To specify to instantiate only the template entities that are used in this compilation enter cpml6c tused test cc d gt auto instantiation T Section Template Instantiation in chapter Language Implementation Compiler Use 3 65 instantiation dir Option instantiation dir directory Arguments The name of the directory to write instantiation files to Description You can use this option in combination with option one instantiation per object to specify a directory into which the generated object files should be put Example To create separate instantiation files in directory proj template enter cpml6c one instantiation per object instantiation dir proj template test cc d gt Section Template Instantiation in chapter Language Implementation one instantiation per object 3 66 Chapter 3 list file L Option Lifile list file file Arguments The name of the list file Description Generate raw listing information in the file tle This information is likely to be used to generate a formatted listing The raw listing file contains r
169. stic used by the C compiler to decide on definition of virtual function tables provides no guidance See suppress vtbl Example cpml6c force vtbl test cc d gt suppress vtbl Compiler Use 3 53 friend injection Option friend injection no friend injection Default no friend injection Description Controls whether the name of a class or function that is declared only in friend declarations is visible when using the normal lookup mechanisms When friend names are injected they are visible to such lookups When friend names are not injected as required by the standard function names are visible only when using argument dependent lookup and class names are never visible Example cpml6c friend injection test cc d gt arg dep lookup 3 54 Chapter 3 gen c file name o Option o file gen c file name file Arguments An output filename Default Module name with ic suffix Description This option specifies the file name to be used for the generated C output Example To specify the file out ic as the output file instead of test ic enter cpml6c gen c file name out ic test cc Compiler Use 3 55 guiding decls Option guiding decls no guiding decls Default guiding decls Description Enable or disable recognition of guiding declarations of template functions A guiding declaration is a function decla
170. t Option output file Arguments An output filename specifying the preprocessing output file Default No preprocessing output file is generated Description Use file as output filename for the preprocessing output file Example To use the file my pre as the preprocessing output file enter cpml6c E output my pre test cc d gt preprocess E no line commands P 3 86 Chapter 3 pch Option pch Description Automatically use and or create a precompiled header file For details see the Precompiled Headers section in chapter Language Implementation If use pch or create pch manual PCH mode appears on the command line following this option its effect is erased Example cpml6c pch test cc d gt use pch create pch Section Precompiled Headers in chapter Language Implementation Compiler Use 3 87 pch dir Option pch dir dir name Arguments The name of the directory to search for and or create a precompiled header file Description Specify the directory in which to search for and or create a precompiled header file This option may be used with automatic PCH mode pch or manual PCH mode create pch or use pch Example To use the directory usr include pch to automatically create precompiled header files enter cpml6c pch dir usr include pch pch test cc d gt pch use pch create pch S
171. tandard pragma_must_precede_declaration this pragma must immediately precede a declaration pragma_must_precede_statement this pragma must immediately precede a statement pragma_must_precede_decl_or_stmt this pragma must immediately precede a declaration or statement pragma_may_not_be_used_here this kind of pragma may not be used here partial_override overloaded virtual function entity is only partially overridden in entity kind entity specialization of called inline template function specific definition of inline template function must precede its first use cl invalid error tag invalid error tag cl invalid error number invalid error number param type _ptr_to array_of unknown bound paramcter type involves pointer to array of unknown bound param type ref array_of unknown bound parameter type involves reference to array of unknown bound ptr to member cast to_ptr_to function pointer to member function cast to pointer to function no named fields struct or union declares no named members Error Messages A 45 0619 0620 0622 0623 0624 0625 0626 0627 0628 0629 0630 0631 nonstd unnamed field nonstandard unnamed field nonstd_unnamed member nonstandard unnamed member cl invalid_pch_output file invalid precompiled header output file cl cannot open pch output file cannot open precompiled header output file
172. te entities to be instantiated B is equivalent to implicit include Example cpml6c implicit include test cc d gt instantiate t Section Template Instantiation in chapter Language Implementation 3 58 Chapter 3 implicit typename Option implicit typename no implicit typename Default implicit typename Description Enable or disable implicit determination from context whether a template parameter dependent name is a type or nontype Example cpml6c no implicit typename test cc d gt typename Compiler Use 3 59 incl suffixes Option include suffixes suffixes Arguments A colon separated list of suffixes e g h hpp Description Specifies the list of suffixes to be used when searching for an include file whose name was specified without a suffix If a null suffix is to be allowed it must be included in the suffix list The default suffix list is no extension h and hpp Example To allow only the suffixes h and hpp as include file extensions enter cpml6c incl suffixes h hpp test cc d gt Section 3 2 Include Files 3 60 Chapter 3 include directory I Option Idirectory include directory direciory Arguments The name of the directory to search for include file s Description Change the algorithm for searching include files whose names do not have an absolute pathname to look in directory Example
173. temporaries Enable or disable K amp R arithmetic conversion rules for longs Select memory model small medium or large Enable or disable the support for namespaces New style for scoping rules Do syntax checking only Preprocess only Remove line control information and comments Enable or disable the anachronism of allowing a reference to nonconst to bind to a class rvalue of the right type Use or do not use a non standard template argument deduction method 3 7 Chapter 3 Option Description nonstd using decl no nonstd using decl no preproc only no use before set warnings j no warnings W old for init old line commands old specializations no old specializations old style preprocessing one instantiation per object output file pch pch dir dir pch messages no pch messages pch verbose pending instantiations n preprocess r8c Allow or disallow ungualified name in non member using declaration Specify that a full compilation should be done not just preprocessing Suppress warnings on local automatic variables that are used before their values are set Suppress all warning messages Old style for scoping rules Put out line control information in the form nnn instead of line nnn Enable or disable old style template specialization Forces pcc style preprocessing Create separate instantiation
174. tent lbracket digraph use of alternative token lt appears to be unintended probable inadvertent sharp digraph use of alternative token 96 appears to be unintended namespace def not allowed namespace definition is not allowed missing namespace name name must be a namespace name namespace alias def not allowed namespace alias definition is not allowed namespace gualified name reguired namespace gualified name is reguired namespace_ name not allowed a namespace name is not allowed Error Messages A 53 0729 0730 0731 0732 0733 0734 0735 0736 0737 0738 0741 0742 0744 bad_combination_of_dll_attributes invalid combination of DLL attributes sym_not_a_class_template entity kind entity is not a class template array_of incomplete_type array with incomplete element type is nonstandard allocation_operator in namespace allocation operator may not be declared in a namespace deallocation_operator in namespace deallocation operator may not be declared in a namespace conflicts_with using decl entity kind entity conflicts with using declaration of entity kind entity using decl conflicts_with_prev_decl using declaration of entity kind entity conflicts with entity kind entity declared at line xxxx cl namespaces option only in cplusplus namespaces option can be used only when compiling C useless_ using
175. ter variable taking the address of a register variable is not allowed address _of bit field taking the address of a bit field is not allowed too_many_arguments too many arguments in function call all proto_params_must_be_ named unnamed prototyped parameters not allowed when body is present expr_not pointer to object expression must have pointer to object type program too large program too large or complicated to compile bad initializer type a value of type type cannot be used to initialize an entity of type rype A 14 0145 0146 0147 0148 0149 0150 0151 0152 0153 0154 0155 0156 0157 Appendix A cannot initialize entity kind entity may not be initialized too_many_initializer_values too many initializer values not _compatible_with_ previous decl declaration is incompatible with entity kind entity declared at line xxxx already _initialized entity kind entity has already been initialized bad file scope storage class a global scope declaration may not have this storage class type_cannot_be_ param name a type name may not be redeclared as a parameter typedef cannot be param name a typedef name may not be redeclared as a parameter non zero int conv_to_ pointer conversion of nonzero integer to pointer expr_not class expression must have class type expr not struct_or union expression must have st
176. ter_statements declaration may not appear after executable statement in block inaccessible_base_class implicit conversion to inaccessible base class type is not allowed improperly_terminated macro call improperly terminated macro invocation id must_be_class_or namespace name name followed by must be a class or namespace name bad friend decl invalid friend declaration value returned in constructor a constructor or destructor may not return a value bad_destructor_decl invalid destructor declaration class_and_member_name_conflict invalid declaration of a member with the same name as its class global_qualifier_not_allowed global scope qualifier leading is not allowed name not found in file scope the global scope has no xxxx A 22 0283 0284 0285 0286 0287 0288 0289 0290 0291 0292 0293 0294 0296 Appendix A gualified name not allowed gualified name is not allowed null reference NULL reference is not allowed brace initialization not allowed initialization with is not allowed for object of type type ambiguous_ base_ class base class type is ambiguous ambiguous_ derived class derived class type contains more than one instance of class type derived class from virtual base cannot convert pointer to base class type to pointer to de
177. th unknown bounds as parameter types are diagnosed as errors Language Implementation 2 7 e A functional notation cast of the form A can be used even if A is a class without a nontrivial constructor The temporary created gets the same default initialization to zero as a static object of the class type e A cast can be used to select one out of a set of overloaded functions when taking the address of a function e Template friend declarations and definitions are permitted in class definitions and class template definitions e Type template parameters are permitted to have default arguments e Function templates may have nontype template parameters e A reference to const volatile cannot be bound to an rvalue e Qualification conversions such as conversion from T toT const const are allowed e Digraphs are recognized e Operator keywords e g not and bitand etc are recognized e Static data member declarations can be used to declare member constants e wchar_t is recognized as a keyword and a distinct type e bool is recognized e RTTI run time type identification including dynamic_cast and the typeid operator is implemented e Declarations in tested conditions in if switch for and while statements are supported e Array new and delete are implemented e New style casts static_cast reinterpret cast and const_cast are implemented e Definition of a nested class outside its enclosing class
178. than those of a top level function declaration e g they are accepted on typedef declarations and on pointer to function and pointer to member function declarations Language Implementation 2 13 2 4 5 EXTENSIONS ACCEPTED IN CFRONT 2 1 COMPATIBILITY MODE The following extensions are accepted in cfront 2 1 compatibility mode in addition to the extensions listed in the 2 1 3 0 section following i e these are things that were corrected in the 3 0 release of cfront The dependent statement of an if while do while or for is not considered to define a scope The dependent statement may not be a declaration Any objects constructed within the dependent statement are destroyed at exit from the dependent statement Implicit conversion from integral types to enumeration types is allowed A non const member function may be called for a const object A warning is issued A const void value may be implicitly converted to a void value e g when passed as an argument When in determining the level of argument match for overloading a reference parameter is initialized from an argument that requires a non class standard conversion the conversion counts as a user defined conversion When a built in operator is considered alongside overloaded operators in overload resolution the match of an operand of a built in type against the built in type required by the built in operator is considered a standard conversion in all
179. tiated when used e g inline functions 1 Since templates are descriptions of entities typically classes that are parameterizable according to the types they operate upon they are sometimes called parameterized types 2 26 Chapter 2 From these reguirements one can see that if the compiler is responsible for doing all the instantiations automatically it can only do so on a program wide basis That is the compiler cannot make decisions about instantiation of template entities until it has seen all the source files that make up a complete program This C compiler provides an instantiation mechanism that does automatic instantiation at link time For cases where you want more explicit control over instantiation the C compiler also provides instantiation modes and instantiation pragmas which can be used to exert fine grained control over the instantiation process 2 6 1 AUTOMATIC INSTANTIATION The goal of an automatic instantiation mode is to provide painless instantiation You should be able to compile source files to object code then link them and run the resulting program and never have to worry about how the necessary instantiations get done In practice this is hard for a compiler to do and different compilers use different automatic instantiation schemes with different strengths and weaknesses e AT amp T USL Novell s cfront product saves information about each file it compiles in a special directory call
180. tions Used In This Manual Chapters 1 Overview Provides an overview of the TASKING M16C toolchain and gives you some familiarity with the different parts of it and their relationship A sample session explains how to build an application from your C file 2 Language Implementation Concentrates on the approach of the M16C architecture and describes the language implementation The C language itself is not described in this document 3 Compiler Use Deals with invocation command line options and pragmas 4 Compiler Diagnostics Describes the exit status and error warning messages of the C compiler Appendices A Error Messages Contains an overview of the error messages B Utitily Programs Contains a description of the prelinker which is delivered with the C compiler package VIII Manual Purpose and Structure RELATED PUBLICATIONS The C Programming Language second edition by Bjarne Straustrup 1991 Addison Wesley ISO IEC 14882 1998 C standard ANSI More information on the standards can be found at http www ansi org The Annotated C Reference Manual by Margaret A Ellis and Bjarne Straustrup 1990 Addison Wesley The C Programming Language second edition by B Kernighan and D Ritchie 1988 Prentice Hall ISO IEC 9899 1999 E Programming languages C ISO IEC More information on the standards can be found at http www ansi org M16C C Compiler Assembler Linker User s Man
181. tive declaration of is followed by its definition Language Implementation 2 11 2 4 4 When nonconst ref anachronism is enabled a reference to a non const class can be bound to a class rvalue of the same type or a derived type thereof struct A A int A operator A amp A operatort const A amp LA main A b 1 b A 1 A 2 Allowed as anachronism EXTENSIONS ACCEPTED IN NORMAL C MODE The following extensions are accepted in all modes except when strict ANSI violations are diagnosed as errors A friend declaration for a class may omit the class keyword class A friend B Should be friend class B hi Constants of scalar type may be defined within classes class A const int size 10 int a size h In the declaration of a class member a gualified name may be used struct A int A f Should be int f h The preprocessing symbol c_plusplus is defined in addition to the standard __ cplusplus A pointer to a constant type can be deleted 2 12 Chapter 2 An assignment operator declared in a derived class with a parameter type matching one of its base classes is treated as a default assignment operator that is such a declaration blocks the implicit generation of a copy assignment operator This is cfront behavior that is known to be relied upon in at least one widely used library Here is an example struct A struct B public A B amp operato
182. truct func func const char msg hi D D void D Init const char t Should call B func calls func func instead new func t The global scope name must be present in a base class B func in this example for the nonstandard lookup to occur Even if the derived class were to have a member named func it is still the presence of B func that determines how the lookup will be performed A parameter of type const void is allowed on operator delete it is treated as equivalent to void A period 7 may be used for qualification where should be used Only may be used as a global qualifier Except for the global gualifier the two kinds of gualifier operators may not be mixed in a given name i e you may say A B C or A B C but not A B C or A B C A period may not be used in a vacuous destructor reference nor in a gualifier that follows a template reference such as A lt T gt B Cfront 2 1 does not correctly look up names in friend functions that are inside class definitions In this example function f should refer to the functions and variables e g 1 and a1 from the class declaration Instead the global definitions are used 2 16 Chapter 2 int al int el void fl class A int al void fl friend void f int il al cfront uses global al f1 cfront uses global fl h Only the innermost class scope is incorrectly skipped by cfront
183. ual TASKING MA299 024 00 00 M16C C Compiler Assembler Linker Reference Manual TASKING MA299 024 00 00 M16C CrossView Pro Debugger User s Manual TASKING MA299 041 00 00 Manual Purpose and Structure IX CONVENTIONS USED IN THIS MANUAL The notation used to describe the format of call lines is given below Items shown inside curly braces enclose a list from which you must choose an item Items shown inside sguare brackets enclose items that are optional The vertical bar separates items in a list It can be read as OR italics Items shown in italic letters mean that you have to substitute the item If italic items are inside square brackets they are optional For example filename means type the name of your file in place of the word filename An ellipsis indicates that you can repeat the preceding item zero or more times screen font Represents input examples and screen output examples bold font Represents a command name an option or a complete command line which you can enter For example command option filename This line could be written in plain English as execute the command command with the optional options option and with the file filename Illustrations The following illustrations are used in this manual amp This is a note It gives you extra information A This is a warning Read the information carefully Manual Purpose and Structure XQ This illustr
184. ued An expression of type void may be supplied on the return statement in a function with a void return type A warning is issued Cfront has a bug that causes a global identifier to be found when a member of a class or one of its base classes should actually be found This bug is emulated in cfront compatibility mode A warning is issued when because of this feature a nonstandard lookup is performed The following conditions must be satisfied for the nonstandard lookup to be performed A member in a base class must have the same name as an identifier at the global scope The member may be a function static data member or non static data member Member type names do not apply because a nested type will be promoted to the global scope by cfront which disallows a later declaration of a type with the same name at the global scope The declaration of the global scope name must occur between the declaration of the derived class and the declaration of an out of line constructor or destructor The global scope name must be a type name No other member function definition even one for an unrelated class may appear between the destructor and the offending reference This has the effect that the nonstandard lookup applies to only one class at any given point in time For example struct B void func const char hi Language Implementation 2 15 struct D public B public D void Init const char s
185. uld have been entity kind entity declared at line xxxx cl for init diff warning option only in cplusplus option to control warnings on for init differences can be used only when compiling C Error Messages A 57 0782 0783 0784 0785 0786 0787 0788 0789 0790 0791 0792 0793 unnamed_class_virtual_function_def_missing definition of virtual entity kind entity is required here svr4_token_pasting comment empty comment interpreted as token pasting operator 4 storage class in friend decl a storage class is not allowed in a friend declaration templ param list_not allowed template parameter list for entity is not allowed in this declaration bad member _template sym entity kind entity is not a valid member class or function template bad member _template decl not a valid member class or function template declaration specialization follows_param list a template declaration containing a template parameter list may not be followed by an explicit specialization declaration specialization_of referenced template explicit specialization of entity kind entity must precede the first use of entity kind entity explicit_specialization_not_in_namespace_scope explicit specialization is not allowed in the current scope partial_specialization_not_allowed partial specialization of entity kind entity is not allowed entity_cannot_be_
186. ult arg not at end default argument not at end of parameter list default arg already defined redefinition of default argument ambiguous overloaded function more than one instance of entity kind entity matches the argument list ambiguous_constructor more than one instance of constructor entity matches the argument list bad default arg type default argument of type type is incompatible with parameter of type type A 24 0311 0312 0513 0314 0515 0316 0317 0318 0319 0320 0321 0322 0323 Appendix A return_type_cannot_distinguish_functions cannot overload functions distinguished by return type alone no_user_defined_conversion no suitable user defined conversion from type to type exists function_qualifier_not_allowed type qualifier is not allowed on this function virtual_static_not_allowed only nonstatic member functions may be virtual unqual_function_with_qual_object the object has type qualifiers that are not compatible with the member function too_many_virtual_ functions program too large to compile too many virtual functions bad_return_type_on_virtual_function_override return type is not identical to nor covariant with return type type of overridden virtual function entity kind entity ambiguous_virtual_function_override override of virtual entity kind entity is ambiguous pure_specifier_on_no
187. umentation except as provided in an executed license agreement covering the software and documentation Altium reserves the right to change specifications embodied in this document without prior notice TABLE OF CONTENTS ail TASKING M SLNALNOD Table of Contents OVERVIEW 1 1 11 Introduction to C Compiler veed 1 3 1 2 Development Structure 6 00 eee 1 4 1 2 1 The Prelinker Phase 2 0 00 Fa 1 5 1 2 2 The Muncher Phase csipi errien aiie iaee a l 1 3 Environment Variables 00 00 cc cece 1 8 1 4 File Extensions seon penyiar tees 1 10 LANGUAGE IMPLEMENTATION 2 1 2 1 LntroductiOn ug dw pnts GA FFA Ge ks 2 3 2 2 CAP Dray erpai DE ET RWY EE Eke Os bed 2 3 2 3 C Language Extension Keywords 2 4 2 4 C Dialect Accepted 2 0 0 0 eee eee 2 6 2 4 1 New Language Features Accepted 2 6 2 4 2 New Language Features Not Accepted 2 9 2 4 3 Anachronisms Accepted uaaa 2 9 2 4 4 Extensions Accepted in Normal C Mode 2 11 2 4 5 Extensions Accepted in Cfront 2 1 Compatibility Mode 2 13 2 4 6 Extensions Accepted in Cfront 2 1 and 3 0 Compatibility Mode 0 6 eae 2 17 2 5 Namespace Support 0 FF FF FF eee 2 23 2 6 Template Instantiation FFF eee 2 25 2 6 1 Automatic Instantiation Y FF YU 2 26 2 6 2 Instantiation Modes Y FF a 2 30 2 6 3 Instantiation pragma D
188. uses the cfront compatibility modes select long by default Example cpml6c long lifetime temps test cc Compiler Use 3 69 long preserving rules Option long preserving rules no long preserving rules Default no long preserving rules Description Enable or disable the K amp R usual arithmetic conversion rules with respect to long This means the rules of K amp R I Appendix A 6 6 The significant difference is in the handling of long op unsigned int when int and long are the same size The ANSI ISO rules say the result is unsigned long but K amp R I says the result is long unsigned long did not exist in K amp R I The default is the ANSI ISO rule Example cpml6c long preserving rules test cc 3 70 Chapter 3 Mmodel Option Mmodel Arguments The memory model to be used where model is one of s small default m medium 1 large Default Ms Description Select memory model to be used Example cpml6c Ml test c d gt Section Memory Models in chapter C Language of the M16C C Compiler Assembler Linker User s Manual Compiler Use namespaces Option namespaces no namespaces Default namespaces Description Enable or disable support for namespaces Example cpml6c no namespaces test cc d gt using std Section Namespace Support in chapter Language Implementation 3 71 3 72 Chapter 3
189. ve unneeded entities no remove unneeded entities Default remove unneeded entities Description Enable or disable an optimization to remove unneeded entities from the generated intermediate C file Something may be referenced but unneeded if it is referenced only by something that is itself unneeded certain entities such as global variables and routines defined in the translation unit are always considered to be needed Example cpml6c no remove unneeded entities test cc Compiler Use 3 95 rtti Option rtti no rtti Default no rtti Description Enable or disable support for RTTI run time type information features dynamic cast typeid Example cpml6c rtti test cc 3 96 Chapter 3 signed chars s Option S signed chars Description Treat character type variables as signed character variables When plain char is signed the macro __ SIGNED CHARS _ is defined Example cpml6c s test cc d gt unsigned chars u Compiler Use 3 97 special subscript cost Option special subscript cost no special subscript cost Default no special subscript cost Description Enable or disable a special nonstandard weighting of the conversion to the integral operand of the operator in overload resolution This is a compatibility feature that may be useful with some existing code The special cost is enabled by d
190. verity as follows e Catastrophic errors also called fatal errors indicate problems of such severity that the compilation cannot continue For example command line errors internal errors and missing include files If multiple source files are being compiled any source files after the current one will not be compiled e Errors indicate violations of the syntax or semantic rules of the C language Compilation continues but object code is not generated e Warnings indicate something valid but questionable Compilation continues and object code is generated if no errors are detected e Remarks indicate something that is valid and probably intended but which a careful programmer may want to check These diagnostics are not issued by default Compilation continues and object code is generated if no errors are detected e The last class of messages are the internal compiler errors These errors are caused by failed internal consistency checks and should never occur However if such a SYSTEM error appears please report the occurrence to TASKING using a Problem Report form Please include a diskette or tape containing a small C program causing the error By default tsw diagnostics diagnostics are written to stderr with a form like the following test cc 5 break E 116 a break statement may only be used within a loop or switch With the command line option no tsw diagnostics the message appear in the followi
191. x is incompatible with template parameter of type type template_operator_new function template for operator new size_t is not allowed bad member type in_ptr_to member pointer to member of type type is not allowed ellipsis_on_operator function ellipsis is not allowed in operator function parameter list unimplemented keyword entity is reserved for future use as a keyword cl invalid macro definition invalid macro definition cl invalid macro undefinition invalid macro undefinition cl invalid_preprocessor_output file invalid preprocessor output file Error Messages A 41 0564 0565 0566 0567 0568 0569 0570 0571 0572 0573 0574 0575 0576 0578 cl cannot_open_preprocessor output file cannot open preprocessor output file cl il file must_be_specified IL file name must be specified if input is cl invalid il output file invalid IL output file cl cannot open il output file cannot open IL output file cl invalid C output file invalid C output file cl cannot open C output file cannot open C output file cl error in debug option argument error in debug option argument cl invalid option invalid option cl back end reguires il file back end reguires name of IL file cl could not open il file could not open IL file cl invalid number invalid number cl incorrect host id incorrect host CP
192. y instead of calling the function by using the inline keyword assembly functions Assembly functions can be called from C when they are prototyped with the __ asmfunc keyword interrupt functions You can specify interrupt functions directly through interrupt vectors in the C language _ interrupt _ interrupt_ fixed keyword You may also specify another register bank to be used _ bankswitch And you can specify which registers must be saved for a particular interrupt function _ frame intrinsic functions A number of pre declared functions can be used to generate inline assembly code at the location of the intrinsic built in function call This avoids the overhead which is normally used to do parameter passing and context saving before executing the called function pragmas The C compiler supports the same pragmas as the C compiler Pragmas give directions to the code generator of the compiler All of the language extensions mentioned above are described in detail in the C Compiler Assembler Linker User s Manual 2 6 Chapter 2 E 2 4 C DIALECT ACCEPTED The C compiler accepts the C language as defined by the ISO IEC 14882 1998 standard with the exceptions listed below The C compiler also has a cfront compatibility mode which duplicates a number of features and bugs of cfront 2 1 and 3 0 x Complete compatibility is not guaranteed or intended the mode is there to allow programmers who h
193. ypedef name that is the synonym for a class name e g typedef class A T class T pa No error in cfront mode No warning is issued on duplicate size and sign specifiers short short int i No warning in cfront mode Virtual function table pointer update code is not generated in destructors for base classes of classes without virtual functions even if the base class virtual functions might be overridden in a further derived class For example struct A virtual void f A AO O he struct B public A B B 3 Should call A f according to ARM 12 7 ye struct C public B void f c In cfront compatibility mode B 7B calls C f An extra comma is allowed after the last argument in an argument list as for example in f l 2 A constant pointer to member function may be cast to a pointer to function A warning is issued Language Implementation 2 21 struct A int main int p p int A f Okay with warning e Arguments of class types that allow bitwise copy construction but also have destructors are passed by value i e like C structures and the destructor is not called on the copy In normal mode the class object is copied into a temporary the address of the temporary is passed as the argument and the destructor is called on the temporary after the call returns Note that because the argument is passed differently by value
Download Pdf Manuals
Related Search
Related Contents
取扱説明書 - GENTOS user`s manual la2124a Hovap Hygienic Process Valves, Model Varioflow 8700 RMX 2000 Administrator`s Guide - Support Copyright © All rights reserved.
Failed to retrieve file