home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c495 / watcm951.arj / WCCOPTS.HPK / WCCOPTS.HLP (.txt)
Encoding:
OS/2 Help File  |  1993-02-16  |  29.3 KB  |  882 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. General Information on Compiler Options ΓòÉΓòÉΓòÉ
  3.  
  4. The dialog entitled  WATCOM C/386 Compiler Options  allows you to specify the 
  5. compiler options that will be used to compile your application. These options 
  6. are separated into categories. To view or modify the options in a particular 
  7. category, select the push button for that category. 
  8.  
  9. Four push buttons are located at the bottom of each dialog. Selecting the push 
  10. button entitled  OK  terminates the dialog and returns you to the main dialog, 
  11. saving all changes made to that dialog. If you select  OK  in the main dialog, 
  12. your session will also be terminated and you will be returned to the project 
  13. dialog. If  Save to project  has been selected, your changes will be updated in 
  14. the project profile so that your changes will be reflected in subsequent 
  15. sessions with this project. 
  16.  
  17. Selecting the push button entitled  Default  will set all options appearing in 
  18. the dialog to their default values. If you select  Default  in the main dialog, 
  19. all options in all dialogs will be set to their default values. 
  20.  
  21. Selecting the push button entitled  Cancel  terminates the dialog; any changes 
  22. made to the dialog will be discarded. If you select  Cancel  in the main 
  23. dialog, your session will be terminated and all changes will be discarded. 
  24.  
  25. Selecting the push button entitled  Help  provides information on all the 
  26. options appearing in the dialog. 
  27.  
  28.  
  29. ΓòÉΓòÉΓòÉ 2. Optimizations ΓòÉΓòÉΓòÉ
  30.  
  31. The C/386 optimizing compiler is capable of performing many types of 
  32. optimizations. The dialog entitled  Optimizations  allows you to specify the 
  33. optimizations you wish the compiler to perform. 
  34.  
  35. Disable Optimizations 
  36.  
  37. Selecting  Disable optimizations  causes the compiler to suppress 
  38. optimizations. The resulting code may be larger and execute slower but will be 
  39. much easier to debug. 
  40.  
  41. Loop Optimizations 
  42.  
  43. Selecting  Loop optimizations  causes the compiler to perform loop 
  44. optimizations. Loop optimizations include the following. 
  45.  
  46. Loop-invariant code motion 
  47.     If an expression exists inside a loop and its operands are not modified by 
  48.     subsequent iterations of the loop, the compiler will compute the expression 
  49.     outside of the loop. 
  50.  
  51. Loop-induction expression detection 
  52.     An induction variable is a linear function of a variable which is 
  53.     incremented by a constant value within a loop. An example is A[I] where A 
  54.     is an array appearing in a for-loop with loop-variable I. 
  55.  
  56. Reduction in strength 
  57.     Induction expressions like A[I] may be replaced by a simple pointer 
  58.     variable which is incremented by the appropriate amount on each loop 
  59.     iteration, eliminating costly multiplication operations within the loop. 
  60.  
  61. Loop-induction variable elimination 
  62.     Reduction in strength may eliminate all references to a variable like I, 
  63.     except possibly in the loop termination test. In this case, I may be 
  64.     eliminated altogether if the loop termination test is modified to use an 
  65.     introduced pointer variable. 
  66.  
  67. Math Optimizations 
  68.  
  69. When the "fpi" or "fpi87" compiler option is selected, the compiler generates 
  70. 80x87 floating-point instructions to perform the basic arithmetic operations of 
  71. addition, subtraction, multiplication and division. In addition, the math 
  72. coprocessor contains specialized floating-point instructions that can be used 
  73. to implement various mathematical intrinsic functions. For example, a single 
  74. instruction can be used to implement the SIN, COS, SQRT and TAN intrinsic 
  75. functions. Also, a relatively small number of instructions can be used to 
  76. implement the LOG10 and LOG intrinsic functions. 
  77.  
  78. By default, a call to a run-time routine is generated when a call to any of the 
  79. above intrinsic functions is made. Selecting  Math Optimizations  causes the 
  80. compiler to generate specialized floating-point instructions instead of calls 
  81. to run-time routines. 
  82.  
  83. CAUTION:
  84. Note that argument validation is not performed when math optimizations are 
  85. performed. You should select math optimizations only if the arguments to these 
  86. functions are valid ones. 
  87.  
  88. Call/Return Optimizations 
  89.  
  90. Selecting  Call/Return optimizations  causes a "call" instruction followed by a 
  91. "ret" (return) instruction to be changed into a "jmp" (jump) instruction. 
  92.  
  93. In-line Intrinsic Functions 
  94.  
  95. Selecting  In-line intrinsic functions  causes the compiler to generate certain 
  96. library functions in-line. You must include the appropriate header file 
  97. containing the prototype for the desired function so that it will be generated 
  98. in-line. The functions that can be generated in-line are: abs, _disable, div, 
  99. _enable, fabs, labs, ldiv, _lrotl, _lrotr, inp, inpw, memchr, memcmp, memcpy, 
  100. memset, movedata, outp, outpw, _rotl, _rotr, strcat, strchr, strcpy, and 
  101. strlen. 
  102.  
  103. The macro "__INLINE_FUNCTIONS__"  is also predefined by the compiler. 
  104.  
  105. Relax Alias Checking 
  106.  
  107. Selecting  Relax alias checking  causes the code optimizer to assume that 
  108. global variables are not indirectly referenced through pointers. This 
  109. assumption may reduce the size of the code that is generated. The following 
  110. example helps to illustrate this point. 
  111.  
  112. extern int i;
  113.  
  114. void rtn( int *pi ) {
  115.  
  116.     int k;
  117.  
  118.     for( k = 0; k < 10; ++k ) {
  119.         (*pi)++;
  120.         i++;
  121.     }
  122. }
  123.  
  124. In the above example, if "i" and "*pi" referenced the same integer object then 
  125. "i" would be incremented by 2 each time through the "for" loop and we would 
  126. call the pointer reference "*pi" an alias for the variable "i". In this 
  127. situation, the compiler could not bind the variable "i" to a register without 
  128. making sure that the "in-memory" copy of "i" was kept up-to-date. In most 
  129. cases, the above situation does not arise. Rarely would we reference the same 
  130. variable directly by name and indirectly through a pointer in the same routine. 
  131. This option instructs the code generator that such cases do not arise in the 
  132. module to be compiled. The code generator will be able to produce more 
  133. efficient code when it does not have to worry about the alias "problem". 
  134.  
  135. Instruction Scheduling 
  136.  
  137. Selecting  Instruction scheduling  causes the compiler to perform an 
  138. optimization phase called instruction scheduling. When instruction scheduling 
  139. is performed, the compiler will generate instructions in an an order that 
  140. attempts to maximize the use of the instruction pipeline. 
  141.  
  142. Expand Functions In-line 
  143.  
  144. Selecting  Expand functions in-line  causes the compiler to expand certain 
  145. user-defined functions in-line. The criteria for which functions are selected 
  146. for in-line expansion is based on the "size" of the function in terms of the 
  147. number of operations generated for the function. The number of operations 
  148. corresponds closely to the number of operators. Functions which require more 
  149. than a certain number of operations are not expanded in-line. This value can be 
  150. specified by selecting  # of operations.  The default number is 20. This 
  151. optimization is useful when locally-referenced functions are small in size. 
  152.  
  153. Numerical Optimizations 
  154.  
  155. Selecting  Numerical optimizations  causes the compiler to perform certain 
  156. numerical calculations in a more efficient manner. Consider the following 
  157. example. 
  158.  
  159.    z1 = x1 / y;
  160.    z2 = x2 / y;
  161.  
  162. The code generator will generate code that is equivalent to the following. 
  163.  
  164.    t = 1 / y;
  165.    z1 = x1 * t;
  166.    z2 = x2 * t;
  167.  
  168. Since floating-point multiplication is more efficient that division, the code 
  169. generator decided to first compute the reciprocol of Y and then multiply X1 and 
  170. X2 by the reciprocol of Y. 
  171.  
  172. CAUTION:
  173. Note that this optimization may produce less slightly different results since 
  174. some, for certain values, precision is lost when computing the reciprocol. By 
  175. using this option, you are indicating that you are willing to accept the loss 
  176. in precision for the gain in performance. 
  177.  
  178. Precision Optimizations 
  179.  
  180. When evaluating floating-point expressions, floating-point variables may be 
  181. cached in floating-point registers across statements. Floating-point registers 
  182. have 64 bits of precision in the mantissa. This is greater precision than a 
  183. single or double precision variable. Selecting  Precision optimizations  causes 
  184. results to be stored in memory after each statement is executed. This will 
  185. produce less accurate but more predictable floating-point results. The code 
  186. produced will also be less efficient. 
  187.  
  188. Base Pointer Optimizations 
  189.  
  190. Selecting  Base pointer optimizations  causes the compiler to use register ESP 
  191. to reference data on the stack instead of register EBP. This results in smaller 
  192. prologue/epilogue sequences and allows the code generator to use register EBP 
  193. for other purposes. 
  194.  
  195. CAUTION:
  196. Normally, on a memory overflow condition, the code generator will issue a 
  197. warning message and continue generating code using memory efficient algorithms 
  198. that may generate less optimized code. When performing this optimization, and a 
  199. memory overflow condition is reached, the code generator will issue an error 
  200. and terminate. 
  201.  
  202. Space Versus Time Optimizations 
  203.  
  204. Selecting  Space optimizations  causes the compiler to generate smaller code at 
  205. the expense of execution speed. 
  206.  
  207. Selecting  Time optimizations  causes the compiler to generate faster executing 
  208. code at the expense of code size. The generated code may be larger but will 
  209. execute faster. 
  210.  
  211. Selecting  Average space and time  causes the compiler to select a balance 
  212. between space and time. 
  213.  
  214. Traceable Stack Frames 
  215.  
  216. Selecting  Selective traceable stack frames  results in the generation of 
  217. traceable stack frames for functions that contain calls or require stack frame 
  218. setup. For near functions, the following function prologue sequence is 
  219. generated. 
  220.  
  221.     push EBP
  222.     mov  EBP,ESP
  223.  
  224. For far functions, the following function prologue sequence is generated. 
  225.  
  226.     inc  EBP
  227.     push EBP
  228.     mov  EBP,ESP
  229.  
  230. The EBP value on the stack will be even or odd depending on the code model. 
  231.  
  232. Selecting  Traceable Stack Frames Always  forces the generation of traceable 
  233. stack frames for all functions. 
  234.  
  235. Selecting  No traceable stack frames  indicates that no traceable stack frames 
  236. are to be generated. 
  237.  
  238. Unique Addresses for Functions 
  239.  
  240. Selecting  Unique addresses for functions  causes a unique address to be 
  241. assigned to all functions. The compiler will not place two function labels at 
  242. the same address even if the code for the two functions is identical. 
  243.  
  244.  
  245. ΓòÉΓòÉΓòÉ 3. Debugging Information ΓòÉΓòÉΓòÉ
  246.  
  247. Debugging information is generated by the compiler when creating an object 
  248. file. The linker, when instructed to do so, will collect debugging information 
  249. from object files and place it in the executable file. The debugging 
  250. information in the executable file can then be used by the debugger. 
  251.  
  252. The dialog entitled  Debugging Information  allows you to specify the amount of 
  253. debugging information you wish the compiler to generate. 
  254.  
  255. Selecting  No debugging information  causes the compiler to generate no 
  256. debugging information. 
  257.  
  258. Selecting  Line number information  causes the compiler to generate only line 
  259. numbering information. This allows source-level debugging of your application. 
  260. If optimizations are not disabled, the mapping of a line of source to its 
  261. equivalent assembly language intructions may not be accurate. 
  262.  
  263. Selecting  Line # and automatic symbol information  causes the compiler to 
  264. generate line number and automatic symbol debugging information. In addition to 
  265. source-level debugging, this level of debugging information allows the 
  266. referencing automatic variables by name. 
  267.  
  268. Selecting  Full debugging information  causes the compiler to generate line 
  269. numbering information as well as local symbol and typing information. Local 
  270. symbol and typing information allows you to examine the contents of the 
  271. variables in your function by referencing their name. Note that optimizations 
  272. will be disabled automatically when requesting full debugging information. 
  273.  
  274. Selecting  Emit routine names in code  causes the compiler to emit the function 
  275. name into the object code as a string of characters just before the function 
  276. prologue sequence is generated. The string is terminated by a byte count of the 
  277. number of characters in the string. This option is intended for developers of 
  278. embedded systems (ROM-based applications). 
  279.  
  280.  
  281. ΓòÉΓòÉΓòÉ 4. File Management Options ΓòÉΓòÉΓòÉ
  282.  
  283. The dialog entitled  File Management Options  allows you to control the 
  284. generation and contents of output files produced by the compiler. 
  285.  
  286. Selecting  Force Include File:  allows you to specify a file that is included 
  287. as if a 
  288.  
  289. #include "<file_name>"
  290.  
  291. directive were placed at the start of the source file. Simply type the name of 
  292. the include file in the field immediately below (a cursor should be present). 
  293.  
  294. Selecting  Include Directories:  allows you to specify a list of directories in 
  295. which the compiler will search for files included using the "include" compiler 
  296. directive. To add a directory, select  Include Directories: . A cursor will 
  297. appear in the entry field immediately below. Type the name of the directory and 
  298. press the "Enter" key. The directory will be displayed in the list box 
  299. immediately below. To delete a directory from the list, select it from the list 
  300. of directories and then select the  Delete  push button. 
  301.  
  302. The name of the object file is constructed from the source file name and has 
  303. file extension "OBJ". Selecting  Name object file:  allows you to specify an 
  304. alternate name for the object file or the destination of the object file. 
  305.  
  306. Examples: 
  307.  
  308. c:\c\obj\ 
  309.     specifies that the object file is to be placed in the directory "c:\c\obj". 
  310.     Note that a trailing "\" must be specified with directory names, otherwise 
  311.     the directory name will be assumed to be a file name. 
  312.  
  313. c:\c\obj\*.dbo 
  314.     specifies the the object file is to be placed in the directory "c:\c\obj" 
  315.     with file extension "DBO" instead of "OBJ". The file name will be the same 
  316.     as the file name of the source file. 
  317.  
  318. Selecting  Generate function prototypes  will cause the compiler to output 
  319. function declarations to a file with the same filename as the C source file but 
  320. with extension ".def". This file, called a definition file, may be used as an 
  321. include file when compiling other modules in order to take advantage of the 
  322. compiler's function and argument type checking. 
  323.  
  324. Selecting  Generate function declarations  will also cause a definition file to 
  325. be created. The output is similar to that created when  Generate function 
  326. prototypes  is selected except that function declarations will be output to the 
  327. definitino file using base types (i.e., typedefs are reduced to their base 
  328. type). 
  329.  
  330. If  Do not generate definition file  is selected no definition file will be 
  331. generated. 
  332.  
  333.  
  334. ΓòÉΓòÉΓòÉ 5. Code Generation Strategy ΓòÉΓòÉΓòÉ
  335.  
  336. The dialog entitled  Code Generation Strategy  allows you to specify the memory 
  337. model, floating-point model, calling convention and the target processor to be 
  338. used for code generation. 
  339.  
  340. Memory Models 
  341.  
  342. Memory models are distinguished by two properties: the code model used to 
  343. implement function calls and the data model used to reference data. 
  344.  
  345. There are two code models; small and big. A small code model is one in which 
  346. all calls to a function are made with near calls. In a near call, the 
  347. destination address is 32 bits and is relative to the segment value in segment 
  348. register CS. A big code model is one in which all calls to a function are made 
  349. with far calls. In a far call, the destination address consists of a 16-bit 
  350. segment and a 32-bit offset relative to the segment value. 
  351.  
  352. There are also two data models; small and big. A small data model is one in 
  353. which all references to data are made with near pointers. Near pointers are 32 
  354. bits; all data references are made relative to the segment value in segment 
  355. register DS. A big data model is one in which all references to data are made 
  356. with far pointers. Far pointers consist of a 16-bit segment and a 32-bit offset 
  357. relative to the segment value. 
  358.  
  359. The following memory models are supported by the compiler. 
  360.  
  361. Flat memory model 
  362.     Small code and small data models are used. The applications code and data 
  363.     reside in the same linear address space. That is, an offset in the data 
  364.     segment refers to the same memory location as that offset in the code 
  365.     segment. 
  366.  
  367. Small memory model 
  368.     Small code and small data models are used. The flat memory model requires 
  369.     that the applications code and data must reside in the same linear address 
  370.     space; the small memory model does not. 
  371.  
  372. Medium memory model 
  373.     Big code and small data models are used. 
  374.  
  375. Compact memory model 
  376.     Small code and big data models are used. 
  377.  
  378. Large memory model 
  379.     Big code and big data models are used. 
  380.  
  381. CAUTION:
  382. If you are developing an OS/2 2.x application, you should only specify the flat 
  383. memory model. Other memory models are available for developing applications for 
  384. other target environments. 
  385.  
  386. Floating-point Models 
  387.  
  388. There are three floating-point models. 
  389.  
  390. In-line 80x87 instructions 
  391.     The compiler will generate floating-point instructions in-line. The 
  392.     generated floating-point instructions will only run on a machine that is 
  393.     equipped with an 80x87 math coprocessor. 
  394.  
  395.     Note:  If your machine is not equipped with an 80x87 math coprocessor, an 
  396.            application compiled using this floating-point model will still 
  397.            execute since OS/2 2.x seamlessly emulates an 80x87 math 
  398.            coprocessor. 
  399.  
  400. Emulate 80x87 instructions 
  401.     The compiler will generate floating-point instructions in-line and will 
  402.     cause an emulator to be linked with your application. 
  403.  
  404.     Note:  Since OS/2 2.x has a built-in emulator, this is equivalent to 
  405.            selecting  In-line 80x87 instructions . This option is to be used 
  406.            when the operating system under which your application is to run 
  407.            does not support emulation of an 80x87 math coprocessor. 
  408.  
  409. Floating-point calls 
  410.     The compiler will generate calls to run-time routines to perform 
  411.     floating-point operations. The floating-point run-time routines check for 
  412.     the existence of an 80x87 math coprocessor. If one is present it will be 
  413.     used; otherwise the operations will be implemented using 80386 
  414.     instructions. 
  415.  
  416. In addition to specifying the floating-point model, it is also possible to 
  417. specify the level of the floating-point processor that your application will 
  418. use. There are three levels of floating-point processors. 
  419.  
  420. 80287 instructions 
  421.     The compiler will only generate 80287 instructions. This is for machines 
  422.     that have an 80386 or higher CPU but only have an 80287 math coprocessor. 
  423.  
  424. 80387 instructions 
  425.     The compiler will generate 80387 floating-point instructions. 
  426.  
  427. 80387 instructions optimized for Pentium 
  428.     The compiler will generate 80387 floating-point instructions but will use 
  429.     floating-point scheduling algorithms that improve performance on a Pentium 
  430.     processor. 
  431.  
  432. After version 9.0 of the compiler, usage of the 80x87 floating-point registers 
  433. changed that makes floating-point code incompatible with previous versions. 
  434. Select Floating-point reverse compatibility if you wish to maintain 
  435. compatibility with previous versions. 
  436.  
  437. Calling Conventions 
  438.  
  439. There are two calling conventions that can be selected through compiler 
  440. options. 
  441.  
  442. Register-based 
  443.     The compiler will pass arguments in registers EAX, EDX, EBX and ECX. All 
  444.     other CPU registers will be saved and restored accross calls. 
  445.  
  446. Stack-based 
  447.     The compiler will pass arguments using the 80386 stack. Only registers EBX, 
  448.     ESI and EDI will be saved and restored accross calls. 
  449.  
  450. Target Processor 
  451.  
  452. Selecting  80386 instructions  instructs the compiler to generate 80386 
  453. instructions and that the code is to be optimized for an 80386 processor. 
  454.  
  455. Selecting  80386 instructions optimized for 80486  instructs the compiler to 
  456. generate 80386 instructions and that the code is to be optimized for an 80486 
  457. processor. 
  458.  
  459. Selecting  80386 instructions optimized for Pentium  instructs the compiler to 
  460. generate 80386 instructions and that the code is to be optimized for a Pentium 
  461. processor. 
  462.  
  463. Note:  If you select  80386 instructions optimized for 80486  or  80386 
  464.        instructions optimized for Pentium , your application will still execute 
  465.        on a machine with an 80386 processor. 
  466.  
  467.  
  468. ΓòÉΓòÉΓòÉ 6. Code Generation Options ΓòÉΓòÉΓòÉ
  469.  
  470. The dialog entitled  Code Generation Options  allows you to specify options 
  471. that affect the generated code. 
  472.  
  473. Selecting  Name Code Group:  allows you to specify a group name for code 
  474. segments. To specify the code group, select  Name Code Group: . A cursor will 
  475. appear in the entry field immediately to the right at which point you may type 
  476. the name of the code group. By default, code segments are not placed in a 
  477. group. 
  478.  
  479. Selecting  Name Code Class:  allows you to specify an alternate name for the 
  480. code class. To specify the code class, select  Name Code Class: . A cursor will 
  481. appear in the entry field immediately to the right at which point you may type 
  482. the name of the code class. The default code class name is "CODE". 
  483.  
  484. Selecting  Name Data Segment:  allows you to specify a prefix for all segments 
  485. that belong to the default data segment. The prefix is also used to name the 
  486. default data segment. To specify the prefix to be used, select  Name Data 
  487. Segment: . A cursor will appear in the entry field immediately to the right at 
  488. which point you may type the prefix. 
  489.  
  490. Selecting  Name Text Segment:  allows you to specify an alternate name for the 
  491. text segment. The text segment is the segment in which generated code is 
  492. placed. To specify the name of the text segment, select  Name Text Segment: . A 
  493. cursor will appear in the entry field immediately to the right at which point 
  494. you may type the name of the text segment. By default, the text segment name is 
  495. "_TEXT" for small code models and "<module_name>_TEXT" for large code models. 
  496.  
  497. Selecting  Name of Module:  allows you to specify the module name that is 
  498. placed into the object file. To specify the module name, select  Name of 
  499. Module: . A cursor will appear in the entry field immediately to the right at 
  500. which point you may type the module name. By default, the object file name and 
  501. the module name that is placed within it are constructed from the source file 
  502. name. 
  503.  
  504. Selecting  Generate default libraries  instructs the compiler to generate 
  505. default libraries in the object file. The default libraries generated are 
  506. selected based on the memory model, floating-point model, and calling 
  507. convention. 
  508.  
  509. Selecting  Generate file dependency information  instructs the compiler to 
  510. generate, in the object file, the names and time stamps of all the files 
  511. referenced by the source file. This information can then be used by WMAKE to 
  512. determine that a file needs to be recompiled if any of the referenced files has 
  513. been modified since the object file was created. 
  514.  
  515. Selecting  Easy OMF-386 object files  instructs the compiler to generate object 
  516. files that conform to the Phar Lap Easy OMF-386 object module specification. 
  517. This option should only be specified if you are using Phar Lap development 
  518. tools to create 386 DOS protected mode applications. 
  519.  
  520. Selecting  Save/Restore segment registers  instructs the compiler to generate 
  521. function prologue and epilogue sequences that save and restore any segment 
  522. registers that are modified by the function. 
  523.  
  524. CAUTION:
  525. If the value of the segment register being restored matches the value of a 
  526. segment that was freed within the function, a general protection fault will 
  527. occur. 
  528.  
  529. Selecting  Segment register DS is fixed  instructs the compiler the segment 
  530. register DS cannot be used by the generated code. 
  531.  
  532. CAUTION:
  533. Under OS/2, segment register DS must not be modified as it is used to access 
  534. data in the application's linear address space. 
  535.  
  536. Selecting  Segment register FS is fixed  tells the compiler that segment 
  537. register FS cannot be used by the generated code. 
  538.  
  539. CAUTION:
  540. Under OS/2, segment register FS contains the segment of the thread information 
  541. block of the current thread and must not be modified. 
  542.  
  543. Selecting  Segment register GS is fixed  tells the compiler that segment 
  544. register GS cannot be used by the generated code. 
  545.  
  546. Selecting  Segment register SS not data segment  tells the compiler that 
  547. segment register SS does not contain the segment address of the default data 
  548. segment. 
  549.  
  550. CAUTION:
  551. Under OS/2, segment register SS must not be modified as it is used to access 
  552. the stack in the application's linear address space. 
  553.  
  554. Selecting  Place functions in separate segment  instructs the compiler to place 
  555. each function in its own code segment. This option is used in paging 
  556. environments where special segment ordering may be employed. The "alloc_text" 
  557. pragma is often used in conjunction with this option to place functions into 
  558. specific segments. The disadvantages to this option are: 
  559.  
  560.  1. Static functions are "far called" in big code models. The "near call" 
  561.     optimization is lost. 
  562.  
  563.  2. The "common epilogue" optimization is lost. 
  564.  
  565. Selecting  Constants in code segment  instructs the compiler to place constant 
  566. data in the code segment. This includes character literals and numeric 
  567. constants. 
  568.  
  569.  
  570. ΓòÉΓòÉΓòÉ 7. Diagnostics ΓòÉΓòÉΓòÉ
  571.  
  572. The dialog entitled  Diagnostics  allows you to specify what level of 
  573. diagnostic information is required at compile-time and run-time. 
  574.  
  575. Warning messages have a severity number associated with them. Only warning 
  576. messages whose severity is less than or equal a given severity level will be 
  577. issued. Severity 1 warning messages are the most severe while severity 3 
  578. warning messages are the least severe. Selecting  Warning level 0  suppresses 
  579. all warning messages. Selecting  Warning level 1  causes only severity 1 
  580. warning messages to be issued. This is the default. Selecting  Warning level 2 
  581. causes severity 1 and 2 warning messages to be issued. Selecting  Warning level 
  582. 3  causes severity 1, 2 and 3 warning messages to be issued. 
  583.  
  584. Selecting  Treat warnings as errors  instructs the compiler to treat all 
  585. warnings as errors, thereby preventing the compiler from creating an object 
  586. file if there are warnings found within a module. By default, the compiler will 
  587. continue to create an object file when there are warnings produced. 
  588.  
  589. Selecting  Error Count:  allows you to specify the number of errors the 
  590. compiler will diagnose before stopping the compilation. To specify the maximum 
  591. number of errors, select  Error Count: . A cursor will appear in the entry 
  592. field immediately to the right at which point you may type the maximum number 
  593. of errors. By default, the compiler will stop compilation after 20 errors. 
  594.  
  595. Selecting  Enable extensions  instructs the compiler to allow extensions to the 
  596. ANSI C specification. 
  597.  
  598. Selecting  Stack checking  instructs the compiler to generate a run-time call 
  599. at the beginning of each function that checks for stack overflows. 
  600.  
  601. The OS/2 operating system allocates the stack as a sparse object in multiples 
  602. of 4K. When you specify a stack size, it is rounded up to the nearest multiple 
  603. of 4K. The 4K pages that comprise the stack are not all committed. Initially, 
  604. only the page with the largest address is committed and the page below it is 
  605. called a guard page. When the guard page is accessed, a guard-page exception is 
  606. generated and handled by attempting to get another guard page below the one 
  607. that caused the exception. If this is successful, the original guard page 
  608. becomes committed and is now part of the regular stack. This process continues 
  609. until a new guard page cannot be allocated. In this way the stack grows 
  610. automatically. If a function's prologue requires more than 4K of automatic 
  611. storage, it is possible to access a part of the stack that is below the guard 
  612. page. If this happens, a protection-violation exception is generated and the 
  613. application is terminated. 
  614.  
  615. Selecting  Automatic stack growing  causes the compiler to generate code that 
  616. ensures that any access to automatic storage is not below the guard page. 
  617.  
  618. Selecting  Concise error messages (C++)  causes a less verbose form of error 
  619. and informational messages to be produced. This option should only be selected 
  620. if you are using the WATCOM C++ compiler since the WATCOM C compiler does not 
  621. support this option. 
  622.  
  623. Note:  WATCOM's WorkFrame/2 support includes the ability to resolve 
  624.        compile-time errors by selecting error messages in the output log 
  625.        window. The error message will then be parsed to determine the file and 
  626.        line number that caused the error. This information is then passed to 
  627.        the editor specified in the "Editor" dialog of the WorkFrame/2 
  628.        "Configure" menu. If this option is specified, there will not be enough 
  629.        information in the error message to support this feature. 
  630.  
  631.  
  632. ΓòÉΓòÉΓòÉ 8. Source Processing Options ΓòÉΓòÉΓòÉ
  633.  
  634. The dialog entitled  Source Processing  allows you to specify how the compiler 
  635. will process source code. 
  636.  
  637. Selecting  C  indicates that the source being processed is C source code and 
  638. causes the WATCOM C compiler to be invoked. 
  639.  
  640. Selecting  C++  indicates that the source being processed is C++ source code 
  641. and causes the WATCOM C++ compiler to be invoked. 
  642.  
  643. Selecting  Determined by file extension  indicates that the source language is 
  644. determined by the file extension of the file being compiled. A file with 
  645. extension "cc", "cpp" or "cxx" will cause the WATCOM C++ compiler to be 
  646. invoked. Otherwise, the WATCOM C compiler will be invoked. 
  647.  
  648. Selecting  Run preprocessor only  instructs the compiler to generate "#line" 
  649. directives when the preprocessor is run. The "#line" directives allow the 
  650. compiler to issue error messages in terms of the original source file line 
  651. numbers. 
  652.  
  653. Selecting  Preserve comments  instructs the compiler to preserve comments in 
  654. the original source file. 
  655.  
  656. Selecting  Insert #line directives  instructs the compiler to only run the 
  657. preprocessor. No code is generated and no object file is produced. The output 
  658. of the preprocessor is written to the standard output file, although it can 
  659. also be redirected to a file using the "fo" option. 
  660.  
  661. A number of compiler directives are available that allow conditional 
  662. compilation of source code. 
  663.  
  664. To define a macro symbol, select  Macro: . A cursor will appear in the entry 
  665. field immediately to the right. Type the name of the macro symbol and press the 
  666. "Enter" key. If you wish to specify a value, place an equal sign after the 
  667. macro name followed by the text that the macro is to be defined as. The macro 
  668. information will be displayed in the box immediately below and will be preceded 
  669. with a dot. The dot indicates that the macro is defined. To undefine a macro 
  670. symbol, select it from the list of macro symbols and then select the  Undefine 
  671. push button. The dot preceding the macro symbol will disappear. Note that the 
  672. macro symbol has not been removed from the list. To delete a macro from the 
  673. list, select it from the list of macro symbols and then select the  Delete 
  674. push button. If you wish to redefine a macro that has been undefined, select it 
  675. from the list of macro symbols and then select the  Define  push button. The 
  676. dot preceding the macro symbol will reappear. 
  677.  
  678. Selecting  Syntax check only  instructs the compiler to scan the source code 
  679. and make sure that it is syntactically correct; no object code will be 
  680. generated. 
  681.  
  682. Selecting  Force enums to be type int  instructs the compiler to allocate an 
  683. 'int' for all enumerated types. By default, the compiler will allocate the 
  684. smallest storage unit required to hold all possible values given for an 
  685. enumerated list. 
  686.  
  687. Selecting  Change char default to signed  instructs the compiler to change the 
  688. default "char" type from an unsigned to a signed quantity. 
  689.  
  690. Selecting  Structure packing alignment  allows you to specify the alignment of 
  691. members in a structure. The default value for the structure alignment is 1. The 
  692. alignment of structure members is described in the following table. If the size 
  693. of the member is 1, 2, 4 or 8, the alignment is given in the table. If the 
  694. member of the structure is an array or structure, the alignment is described by 
  695. the row "x". 
  696.  
  697.                             Alignment
  698.                     1       2       4       8
  699. sizeof(member)  \-------------------------------
  700.         1       |   0       0       0       0
  701.         2       |   0       2       2       2
  702.         4       |   0       2       4       4
  703.         8       |   0       2       4       8
  704.         x       |   aligned to largest member
  705.  
  706. An alignment of 0 means no alignment, 2 means word boundary, 4 means doubleword 
  707. boundary, etc. If the largest member of structure "x" is 1 byte then "x" is not 
  708. aligned. If the largest member of structure "x" is 2 bytes then "x" is aligned 
  709. according to row 2. If the largest member of structure "x" is 4 bytes then "x" 
  710. is aligned according to row 4. If the largest member of structure "x" is 8 
  711. bytes then "x" is aligned according to row 8. 
  712.  
  713. To understand why structure member alignment may be important, consider the 
  714. following example. 
  715.  
  716. typedef struct memo_el {
  717.     char           date[9];
  718.     struct memo_el *prev,*next;
  719.     ref_number     int;
  720. } memo;
  721.  
  722. In the above example, the default alignment value of 1 will cause the pointer 
  723. and integer items to be aligned on odd addresses since the array "date" is 9 
  724. bytes in length. On computer systems that have a 16-bit (or 32-bit) bus, 
  725. improved performance can be obtained when these items are aligned on an even 
  726. boundary. 
  727.  
  728.  
  729. ΓòÉΓòÉΓòÉ 9. Miscellaneous Compiler Options ΓòÉΓòÉΓòÉ
  730.  
  731. The dialog entitled  Miscellaneous Compiler Options  lists a number of 
  732. miscellaneous compiler options. 
  733.  
  734. Selecting  Messages to terminal  instructs the compiler to display all messages 
  735. to the terminal. 
  736.  
  737. Selecting  Ignore WCL386 environment variable  causes the WCL386 environment 
  738. variable to be ignored. The WCL386 environment can also be used to specify 
  739. options. 
  740.  
  741. Selecting  Enable exceptions (C++)  allows the use of exceptions in C++. This 
  742. option must be specified if exceptions are used in your C++ application. If 
  743. your application does not use exceptions, it is recommended that you not use 
  744. this option since it adds some code size/execution speed overhead. 
  745.  
  746. Selecting  Data threshold:  allows you to set the minimum size for data objects 
  747. to be included in the default data segment. This option is only useful for 
  748. memory models that have big data models where arrays larger than the data 
  749. threshold are allocated outside the default data segment. 
  750.  
  751. Selecting  Call prologue hook routine  causes the compiler to generate a call 
  752. to __PRO in the prologue sequence of every function. For example, your version 
  753. of __PRO may collect/record profiling information. An optional value can be 
  754. specified in the entry field labeld  to cause the compiler to allocate 
  755. temporary storage on the stack which can be used by __PRO. The temporary 
  756. storage is allocated immediately before the call to __PRO and is therefore 
  757. located at ESP + 4 (assuming a small code model). Register EBP points to the 
  758. end of the temporary storage so that the size of the temporary storage can be 
  759. calculated by evaluating EBP - ESP - 4. 
  760.  
  761. Selecting  Call epilogue hook routine  causes the compiler to generate a call 
  762. to __EPI in the epilogue sequence of every function. This function is intended 
  763. to work in conjunction with the prologue hook routine. 
  764.  
  765. Note:  When generating a call to a prologue or epilogue hook routine, traceable 
  766.        stack frames will be generated for all functions. See the section 
  767.        entitled "Traceable Stack Frames" for more information. 
  768.  
  769. Double-Byte Character Support 
  770.  
  771. The compiler can recognize double-byte characters in strings. When the compiler 
  772. scans a text string enclosed in quotes ("), it will recognize the first byte of 
  773. a double-byte character and suppress lexical analysis of the second byte. This 
  774. will prevent the compiler from misinterpreting the second byte as a "\" or 
  775. quote (") character. 
  776.  
  777. Selecting  Kanji  causes the compiler to process strings for Japanese 
  778. double-byte characters (range 0x81 - 0x9F and 0xE0 - 0xFC). The characters in 
  779. the range A0 - DF are single-byte Hiragana. 
  780.  
  781. Selecting  Chinese/Taiwanese  causes the compiler to process strings for 
  782. Traditional Chinese and Taiwanese double-byte characters (range 0x81 - 0xFC). 
  783.  
  784. Selecting  Chinese/Taiwanese  causes the compiler to process strings for Korean 
  785. Hangeul double-byte characters (range 0x81 - 0xFD). 
  786.  
  787. Selecting  No double-byte character support  suppresses the double-byte 
  788. character processing by the compiler. 
  789.  
  790.  
  791. ΓòÉΓòÉΓòÉ 10. Linker Options ΓòÉΓòÉΓòÉ
  792.  
  793. The dialog entitled  Linker Options  allows you to specify options that affect 
  794. the linking of your application. 
  795.  
  796. Selecting  Compile only, no linking  will cause your application to be compiled 
  797. only; the linker will not be invoked. 
  798.  
  799. Selecting  Stack size:  allows you to set the size of the stack created for 
  800. your application during execution. 
  801.  
  802. Selecting  System name:  allows you to specify the system name the linker will 
  803. use to create your application. Pre-defined system names can be found in the 
  804. file "wlink.lnk" which is located in the "binb" directory of the directory in 
  805. which you installed WATCOM C/386. 
  806.  
  807. Selecting  Map file:  causes the linker to generate a map file. Once you have 
  808. chosen to generate a map file, you can specify the name of the map file by 
  809. selecting  Map: . A cursor will appear in the entry field immediately to the 
  810. right. Simply type the name of the map file. If no file name is specified, the 
  811. map file will have the same file name as the executable file and file extension 
  812. "MAP". 
  813.  
  814. Selecting  Directive file:  will place the linker directives used to link your 
  815. applications in a file. Once you have chosen to generate a linker directive 
  816. file, you can specify the name of the directive file by selecting  Directive: . 
  817. A cursor will appear in the entry field immediately to the right. Simply type 
  818. the name of the directive file. If no file name is specified, the directive 
  819. file will have file name "__WCL__.LNK". 
  820.  
  821. Selecting  Executable:  allows you to specify the name of the executable file 
  822. generated by the linker. A cursor will appear in the entry field immediately to 
  823. the right. Simply type the name of the executable file. If no file name is 
  824. specified, the executable file will have the same file name as the first object 
  825. file encountered by the linker and extension "EXE". 
  826.  
  827. Selecting  Additonal linker directives:  allows you to specify additional 
  828. linker directives. 
  829.  
  830.  
  831. ΓòÉΓòÉΓòÉ 11. Application Type ΓòÉΓòÉΓòÉ
  832.  
  833. The dialog entitled  Application Type  allows you to specify the type of 
  834. application you are creating. 
  835.  
  836. Selecting  Build standard application  indicates that you are creating a 
  837. standard application (as opposed to a multi-threaded application or a dynamic 
  838. link library). 
  839.  
  840. Selecting  Build dynamic link library  indicates that you are creating a 
  841. dynamic link library. Special libraries are required to link an application 
  842. that is a dynamic link library. 
  843.  
  844. Selecting  Build multi-threaded application  indicates that you are creating a 
  845. multi-threaded application and the multi-threaded version of the libraries 
  846. should be used to link your application. 
  847.  
  848. The run-time libraries contain a default windowing system that allows a 
  849. character-mode application to display output in a desktop window. The desktop 
  850. window is not to be confused with a PM compatible window. It is a PM window 
  851. created using the PM API functions. Selecting  Build default-windowed 
  852. application:  causes the default windowing system to be used by your 
  853. application. 
  854.  
  855. Selecting  Target Operating System:  allows you to specify the "build" target. 
  856. This is useful for cross-development work. It prevents the compiler from 
  857. defining the default system macro (which is based on the host system the 
  858. compiler is running on) and instead defines a macro based on value specified in 
  859. the entry field. For example, if a value of "dos" was specified, the compiler 
  860. would define the macro "__DOS__" and prevent it from defining "__OS2__" 
  861. (assuming you are running the OS/2-hosted version of the compiler). 
  862.  
  863. Any string consisting of letters, digits and the underscore character may be 
  864. used for the target name. 
  865.  
  866.  
  867. ΓòÉΓòÉΓòÉ 12. National Language Support ΓòÉΓòÉΓòÉ
  868.  
  869. The dialog entitled  National Language Support  allows you to specify the 
  870. language (character set) that your source code is written in. 
  871.  
  872. Selecting  Standard character set  indicates that your source code uses the 
  873. standard ASCII character set. 
  874.  
  875. Selecting  Chinese character set  indicates that your source code contains 
  876. Chinese characters. 
  877.  
  878. Selecting  Japanese character set  indicates that your source code contains 
  879. Japanese characters. 
  880.  
  881. Selecting  Korean character set  indicates that your source code contains 
  882. Korean characters.