home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c500 / 1.ddi / WCCOPTS.HPK / WCCOPTS.HLP (.txt)
Encoding:
OS/2 Help File  |  1992-05-28  |  24.5 KB  |  710 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 
  49.      expression 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 
  71.  of 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 
  79.  the above intrinsic functions is made. Selecting  Math Optimizations  causes 
  80.  the compiler to generate specialized floating-point instructions instead of 
  81.  calls 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  disables the optimization where a "call" 
  91.  intstruction followed by a "ret" (return) instruction is changed into a "jmp" 
  92.  (jump) instruction. 
  93.  
  94.  In-line Intrinsic Functions 
  95.  
  96.  Selecting  In-line intrinsic functions  causes the compiler to generate 
  97.  certain library functions in-line. You must include the appropriate header 
  98.  file containing the prototype for the desired function so that it will be 
  99.  generated in-line. The functions that can be generated in-line are: abs, 
  100.  _disable, div, _enable, fabs, labs, ldiv, _lrotl, _lrotr, inp, inpw, memchr, 
  101.  memcmp, memcpy, memset, movedata, outp, outpw, _rotl, _rotr, strcat, strchr, 
  102.  strcpy, and strlen. 
  103.  
  104.  The macro "__INLINE_FUNCTIONS__"  is also predefined by the compiler. 
  105.  
  106.  Relax Alias Checking 
  107.  
  108.  Selecting  Relax alias checking  causes the code optimizer to assume that 
  109.  global variables are not indirectly referenced through pointers. This 
  110.  assumption may reduce the size of the code that is generated. The following 
  111.  example helps to illustrate this point. 
  112.  
  113.   extern int i;
  114.  
  115.   void rtn( int *pi ) {
  116.  
  117.       int k;
  118.  
  119.       for( k = 0; k < 10; ++k ) {
  120.           (*pi)++;
  121.           i++;
  122.       }
  123.   }
  124.  
  125.  In the above example, if "i" and "*pi" referenced the same integer object then 
  126.  "i" would be incremented by 2 each time through the "for" loop and we would 
  127.  call the pointer reference "*pi" an alias for the variable "i". In this 
  128.  situation, the compiler could not bind the variable "i" to a register without 
  129.  making sure that the "in-memory" copy of "i" was kept up-to-date. In most 
  130.  cases, the above situation does not arise. Rarely would we reference the same 
  131.  variable directly by name and indirectly through a pointer in the same 
  132.  routine. This option instructs the code generator that such cases do not arise 
  133.  in the module to be compiled. The code generator will be able to produce more 
  134.  efficient code when it does not have to worry about the alias "problem". 
  135.  
  136.  Instruction Scheduling 
  137.  
  138.  Selecting  Instruction scheduling  causes the compiler to perform an 
  139.  optimization phase called instruction scheduling. When instruction scheduling 
  140.  is performed, the compiler will generate instructions in an an order that 
  141.  attempts to maximize the use of the instruction pipeline. 
  142.  
  143.  Expand Functions In-line 
  144.  
  145.  Selecting  Instruction scheduling  causes the compiler to expand certain 
  146.  user-defined functions in-line. The criteria for which functions are selected 
  147.  for in-line expansion is based on the "size" of the function in terms of the 
  148.  number of operations generated for the function. The number of operations 
  149.  corresponds closely to the number of operators. Functions which require more 
  150.  than a certain number of operations are not expanded in-line. This value can 
  151.  be specified by selecting  # of operations.  The default number is 20. This 
  152.  optimization is useful when locally-referenced functions are small in size. 
  153.  
  154.  Generate Stack Frames As Needed 
  155.  
  156.  Selecting  Generate stack frames as needed  forces the generation of traceable 
  157.  stack frames for functions that contain calls or require stack frame setup. 
  158.  For near functions, the following function prologue sequence is generated. 
  159.  
  160.       push EBP
  161.       mov  EBP,ESP
  162.  
  163.  For far functions, the following function prologue sequence is generated. 
  164.  
  165.       inc  EBP
  166.       push EBP
  167.       mov  EBP,ESP
  168.  
  169.  The EBP value on the stack will be even or odd depending on the code model. 
  170.  
  171.  Always Generate Stack Frames 
  172.  
  173.  Selecting  Always Generate Stack Frames  forces the generation of traceable 
  174.  stack frames even if they are not required. 
  175.  
  176.  Space Versus Time Optimizations 
  177.  
  178.  Selecting  Space optimizations  causes the compiler to generate smaller code 
  179.  at the expense of execution speed. 
  180.  
  181.  Selecting  Time optimizations  causes the compiler to generate faster 
  182.  executing code at the expense of code size. The generated code may be larger 
  183.  but will execute faster. 
  184.  
  185.  Selecting  Average space and time  causes the compiler to select a balance 
  186.  between space and time. 
  187.  
  188.  
  189. ΓòÉΓòÉΓòÉ 3. Debugging Information ΓòÉΓòÉΓòÉ
  190.  
  191. Debugging information is generated by the compiler when creating an object 
  192. file. The linker, when instructed to do so, will collect debugging information 
  193. from object files and place it in the executable file. The debugging 
  194. information in the executable file can then be used by the debugger. 
  195.  
  196. The dialog entitled  Debugging Information  allows you to specify the amount of 
  197. debugging information you wish the compiler to generate. 
  198.  
  199. Selecting  No debugging information  causes the compiler to generate no 
  200. debugging information. 
  201.  
  202. Selecting  Line number information  causes the compiler to generate only line 
  203. numbering information. This allows source-level debugging of your application. 
  204. If optimizations are not disabled, the mapping of a line of source to its 
  205. equivalent assembly language intructions may not be accurate. 
  206.  
  207. Selecting  Line # and automatic symbol information  causes the compiler to 
  208. generate line number and automatic symbol debugging information. In addition to 
  209. source-level debugging, this level of debugging information allows the 
  210. referencing automatic variables by name. 
  211.  
  212. Selecting  Full debugging information  causes the compiler to generate line 
  213. numbering information as well as local symbol and typing information. Local 
  214. symbol and typing information allows you to examine the contents of the 
  215. variables in your function by referencing their name. Note that optimizations 
  216. will be disabled automatically when requesting full debugging information. 
  217.  
  218. Selecting  Emit routine names in code  causes the compiler to emit the function 
  219. name into the object code as a string of characters just before the function 
  220. prologue sequence is generated. The string is terminated by a byte count of the 
  221. number of characters in the string. This option is intended for developers of 
  222. embedded systems (ROM-based applications). 
  223.  
  224.  
  225. ΓòÉΓòÉΓòÉ 4. File Management Options ΓòÉΓòÉΓòÉ
  226.  
  227. The dialog entitled  File Management Options  allows you to control the 
  228. generation and contents of output files produced by the compiler. 
  229.  
  230. Selecting  Force Include File:  allows you to specify a file that is included 
  231. as if a 
  232.  
  233. #include "<file_name>"
  234.  
  235. directive were placed at the start of the source file. Simply type the name of 
  236. the include file in the field immediately below (a cursor should be present). 
  237.  
  238. Selecting  Include Directories:  allows you to specify a list of directories in 
  239. which the compiler will search for files included using the "include" compiler 
  240. directive. To add a directory, select  Include Directories: . A cursor will 
  241. appear in the entry field immediately below. Type the name of the directory and 
  242. press the "Enter" key. The directory will be displayed in the list box 
  243. immediately below. To delete a directory from the list, select it from the list 
  244. of directories and then select the  Delete  push button. 
  245.  
  246. The name of the object file is constructed from the source file name and has 
  247. file extension "OBJ". Selecting  Name object file:  allows you to specify an 
  248. alternate name for the object file or the destination of the object file. 
  249.  
  250. Examples: 
  251.  
  252.  c:\c\obj\ 
  253.      specifies that the object file is to be placed in the directory 
  254.      "c:\c\obj". Note that a trailing "\" must be specified with directory 
  255.      names, otherwise the directory name will be assumed to be a file name. 
  256.  
  257.  c:\c\obj\*.dbo 
  258.      specifies the the object file is to be placed in the directory "c:\c\obj" 
  259.      with file extension "DBO" instead of "OBJ". The file name will be the same 
  260.      as the file name of the source file. 
  261.  
  262.  Selecting  Generate function prototypes  will cause the compiler to output 
  263.  function declarations to a file with the same filename as the C source file 
  264.  but with extension ".def". This file, called a definition file, may be used as 
  265.  an include file when compiling other modules in order to take advantage of the 
  266.  compiler's function and argument type checking. 
  267.  
  268.  Selecting  Generate function declarations  will also cause a definition file 
  269.  to be created. The output is similar to that created when  Generate function 
  270.  prototypes  is selected except that function declarations will be output to 
  271.  the definitino file using base types (i.e., typedefs are reduced to their base 
  272.  type). 
  273.  
  274.  If  Do not generate definition file  is selected no definition file will be 
  275.  generated. 
  276.  
  277.  
  278. ΓòÉΓòÉΓòÉ 5. Code Generation Strategy ΓòÉΓòÉΓòÉ
  279.  
  280. The dialog entitled  Code Generation Strategy  allows you to specify the memory 
  281. model, floating-point model, calling convention and the target processor to be 
  282. used for code generation. 
  283.  
  284. Memory Models 
  285.  
  286. Memory models are distinguished by two properties: the code model used to 
  287. implement function calls and the data model used to reference data. 
  288.  
  289. There are two code models; small and big. A small code model is one in which 
  290. all calls to a function are made with near calls. In a near call, the 
  291. destination address is 32 bits and is relative to the segment value in segment 
  292. register CS. A big code model is one in which all calls to a function are made 
  293. with far calls. In a far call, the destination address consists of a 16-bit 
  294. segment and a 32-bit offset relative to the segment value. 
  295.  
  296. There are also two data models; small and big. A small data model is one in 
  297. which all references to data are made with near pointers. Near pointers are 32 
  298. bits; all data references are made relative to the segment value in segment 
  299. register DS. A big data model is one in which all references to data are made 
  300. with far pointers. Far pointers consist of a 16-bit segment and a 32-bit offset 
  301. relative to the segment value. 
  302.  
  303. The following memory models are supported by the compiler. 
  304.  
  305.  Flat memory model 
  306.      Small code and small data models are used. The applications code and data 
  307.      reside in the same linear address space. That is, an offset in the data 
  308.      segment refers to the same memory location as that offset in the code 
  309.      segment. 
  310.  
  311.  Small memory model 
  312.      Small code and small data models are used. The flat memory model requires 
  313.      that the applications code and data must reside in the same linear address 
  314.      space; the small memory model does not. 
  315.  
  316.  Medium memory model 
  317.      Big code and small data models are used. 
  318.  
  319.  Compact memory model 
  320.      Small code and big data models are used. 
  321.  
  322.  Large memory model 
  323.      Big code and big data models are used. 
  324.  
  325.   CAUTION:
  326.  If you are developing an OS/2 2.x application, you should only specify the 
  327.  flat memory model. Other memory models are available for developing 
  328.  applications for other target environments. 
  329.  
  330.  Floating-point Models 
  331.  
  332.  There are four floating-point models. 
  333.  
  334.  In-line 80287 instructions 
  335.      The compiler will generate floating-point instructions in-line. Only 80287 
  336.      instructions will be generated. This is required if you will be running 
  337.      your application on a 386 machine that is equipped with an 80287 math 
  338.      coprocessor. 
  339.  
  340.  In-line 80387 instructions 
  341.      The compiler will generate floating-point instructions in-line. The 
  342.      generated floating-point instructions will only run on a machine that is 
  343.      equipped with an 80387 math coprocessor. 
  344.  
  345.  In-line 80x87 with emulator 
  346.      The compiler will generate floating-point instructions in-line and will 
  347.      cause an emulator to be linked with your application. Since OS/2 2.x has a 
  348.      built-in emulator, this is equivalent to selecting  In-line 80387 
  349.      instructions  This option is to be used when the operating system under 
  350.      which your application is to run does not support emulation of a math 
  351.      coprocessor. 
  352.  
  353.  Floating-point calls 
  354.      The compiler will generate calls to run-time routines to perform 
  355.      floating-point operations. The floating-point run-time routines check for 
  356.      the existence of a math coprocessor. If one is present it will be used; 
  357.      otherwise the operations will be implemented using 80386 instructions. 
  358.  
  359.  Calling Conventions 
  360.  
  361.  There are two calling conventions that can be selected through compiler 
  362.  options. 
  363.  
  364.  Register-based 
  365.      The compiler will pass arguments in registers EAX, EDX, EBX and ECX. All 
  366.      registers, including floating-point registers, will be saved and restored 
  367.      accross calls. 
  368.  
  369.  Stack-based 
  370.      The compiler will pass arguments using the 80386 stack. Only registers 
  371.      EBX, ESI and EDI will be saved and restored accross calls; all other 
  372.      registers, including floating-point registers, will not. 
  373.  
  374.  Target Processor 
  375.  
  376.  Selecting  Assume 80486 processor  instructs the compiler that you wish to 
  377.  target your application for an 80486 processor. In this case, specialized code 
  378.  sequences can be generated that will result in improved execution speed on 
  379.  computers equipped with an 80486. Note that the code will still execute on a 
  380.  computer equipped with an 80386 processor but may execute slower than the code 
  381.  generated if this option was not selected. Select  Assume 80386 processor  if 
  382.  you wish to optimize your application strictly for an 80386 processor. 
  383.  
  384.  
  385. ΓòÉΓòÉΓòÉ 6. Code Generation Options ΓòÉΓòÉΓòÉ
  386.  
  387. The dialog entitled  Code Generation Options  allows you to specify options 
  388. that affect the generated code. 
  389.  
  390. Selecting  Name Code Group:  allows you to specify a group name for code 
  391. segments. To specify the code group, select  Name Code Group: . A cursor will 
  392. appear in the entry field immediately to the right at which point you may type 
  393. the name of the code group. By default, code segments are not placed in a 
  394. group. 
  395.  
  396. Selecting  Name Code Class:  allows you to specify an alternate name for the 
  397. code class. To specify the code class, select  Name Code Class: . A cursor will 
  398. appear in the entry field immediately to the right at which point you may type 
  399. the name of the code class. The default code class name is "CODE". 
  400.  
  401. Selecting  Name Data Segment:  allows you to specify a prefix for all segments 
  402. that belong to the default data segment. The prefix is also used to name the 
  403. default data segment. To specify the prefix to be used, select  Name Data 
  404. Segment: . A cursor will appear in the entry field immediately to the right at 
  405. which point you may type the prefix. 
  406.  
  407. Selecting  Name Text Segment:  allows you to specify an alternate name for the 
  408. text segment. The text segment is the segment in which generated code is 
  409. placed. To specify the name of the text segment, select  Name Text Segment: . A 
  410. cursor will appear in the entry field immediately to the right at which point 
  411. you may type the name of the text segment. By default, the text segment name is 
  412. "_TEXT" for small code models and "<module_name>_TEXT" for large code models. 
  413.  
  414. Selecting  Name of Module:  allows you to specify the module name that is 
  415. placed into the object file. To specify the module name, select  Name of 
  416. Module: . A cursor will appear in the entry field immediately to the right at 
  417. which point you may type the module name. By default, the object file name and 
  418. the module name that is placed within it are constructed from the source file 
  419. name. 
  420.  
  421. Selecting  Generate default libraries  instructs the compiler to generate 
  422. default libraries in the object file. The default libraries generated are 
  423. selected based on the memory model, floating-point model, and calling 
  424. convention. 
  425.  
  426. Selecting  Easy OMF-386 object files  instructs the compiler to generate object 
  427. files that conform to the Phar Lap Easy OMF-386 object module specification. 
  428. This option should only be specified if you are using Phar Lap development 
  429. tools to create 386 DOS protected mode applications. 
  430.  
  431. Selecting  Save/Restore segment registers  instructs the compiler to generate 
  432. function prologue and epilogue sequences that save and restore any segment 
  433. registers that are modified by the function. 
  434.  
  435. CAUTION:
  436. If the value of the segment register being restored matches the value of a 
  437. segment that was freed within the function, a general protection fault will 
  438. occur. 
  439.  
  440. Selecting  Segment register DS is fixed  instructs the compiler the segment 
  441. register DS cannot be used by the generated code. 
  442.  
  443. CAUTION:
  444. Under OS/2, segment register DS must not be modified as it is used to access 
  445. data in the application's linear address space. 
  446.  
  447. Selecting  Segment register FS is fixed  tells the compiler that segment 
  448. register FS cannot be used by the generated code. 
  449.  
  450. CAUTION:
  451. Under OS/2, segment register FS contains the segment of the thread information 
  452. block of the current thread and must not be modified. 
  453.  
  454. Selecting  Segment register SS not data segment  tells the compiler that 
  455. segment register SS does not contain the segment address of the default data 
  456. segment. 
  457.  
  458. CAUTION:
  459. Under OS/2, segment register SS must not be modified as it is used to access 
  460. the stack in the application's linear address space. 
  461.  
  462. Selecting  Place functions in separate segment  instructs the compiler to place 
  463. each function in its own code segment. This option is used in paging 
  464. environments where special segment ordering may be employed. The "alloc_text" 
  465. pragma is often used in conjunction with this option to place functions into 
  466. specific segments. The disadvantages to this option are: 
  467.  
  468.   1. Static functions are "far called" in big code models. The "near call" 
  469.      optimization is lost. 
  470.  
  471.   2. The "common epilogue" optimization is lost. 
  472.  
  473.  Selecting  Constants in code segment  instructs the compiler to place constant 
  474.  data in the code segment. This includes character literals and numeric 
  475.  constants. 
  476.  
  477.  
  478. ΓòÉΓòÉΓòÉ 7. Diagnostics ΓòÉΓòÉΓòÉ
  479.  
  480. The dialog entitled  Diagnostics  allows you to specify what level of 
  481. diagnostic information is required at compile-time and run-time. 
  482.  
  483. Warning messages have a severity number associated with them. Only warning 
  484. messages whose severity is less than or equal a given severity level will be 
  485. issued. Severity 1 warning messages are the most severe while severity 3 
  486. warning messages are the least severe. Selecting  Warning level 0  suppresses 
  487. all warning messages. Selecting  Warning level 1  causes only severity 1 
  488. warning messages to be issued. This is the default. Selecting  Warning level 2 
  489. causes severity 1 and 2 warning messages to be issued. Selecting  Warning level 
  490. 3  causes severity 1, 2 and 3 warning messages to be issued. 
  491.  
  492. Selecting  Treat warnings as errors  instructs the compiler to treat all 
  493. warnings as errors, thereby preventing the compiler from creating an object 
  494. file if there are warnings found within a module. By default, the compiler will 
  495. continue to create an object file when there are warnings produced. 
  496.  
  497. Selecting  Error Count:  allows you to specify the number of errors the 
  498. compiler will diagnose before stopping the compilation. To specify the maximum 
  499. number of errors, select  Error Count: . A cursor will appear in the entry 
  500. field immediately to the right at which point you may type the maximum number 
  501. of errors. By default, the compiler will stop compilation after 20 errors. 
  502.  
  503. Selecting  Enable extensions  instructs the compiler to allow extensions to the 
  504. ANSI C specification. 
  505.  
  506. Selecting  Stack checking  instructs the compiler to generate a run-time call 
  507. at the beginning of each function that checks for stack overflows. 
  508.  
  509. The OS/2 operating system allocates the stack as a sparse object in multiples 
  510. of 4K. When you specify a stack size, it is rounded up to the nearest multiple 
  511. of 4K. The 4K pages that comprise the stack are not all committed. Initially, 
  512. only the page with the largest address is committed and the page below it is 
  513. called a guard page. When the guard page is accessed, a guard-page exception is 
  514. generated and handled by attempting to get another guard page below the one 
  515. that caused the exception. If this is successful, the original guard page 
  516. becomes committed and is now part of the regular stack. This process continues 
  517. until a new guard page cannot be allocated. In this way the stack grows 
  518. automatically. If a function's prologue requires more than 4K of automatic 
  519. storage, it is possible to access a part of the stack that is below the guard 
  520. page. If this happens, a protection-violation exception is generated and the 
  521. application is terminated. 
  522.  
  523. Selecting  Automatic stack growing  causes the compiler to generate code that 
  524. ensures that any access to automatic storage is not below the guard page. 
  525.  
  526.  
  527. ΓòÉΓòÉΓòÉ 8. Source Processing Options ΓòÉΓòÉΓòÉ
  528.  
  529. The dialog entitled  Source Processing  allows you to specify how the compiler 
  530. will process source code. 
  531.  
  532. Selecting  Run preprocessor only  instructs the compiler to generate "#line" 
  533. directives when the preprocessor is run. The "#line" directives allow the 
  534. compiler to issue error messages in terms of the original source file line 
  535. numbers. 
  536.  
  537. Selecting  Preserve comments  instructs the compiler to preserve comments in 
  538. the original source file. 
  539.  
  540. Selecting  Insert #line directives  instructs the compiler to only run the 
  541. preprocessor. No code is generated and no object file is produced. The output 
  542. of the preprocessor is written to the standard output file, although it can 
  543. also be redirected to a file using the "fo" option. 
  544.  
  545. A number of compiler directives are available that allow conditional 
  546. compilation of source code. 
  547.  
  548. To define a macro symbol, select  Macro: . A cursor will appear in the entry 
  549. field immediately to the right. Type the name of the macro symbol and press the 
  550. "Enter" key. If you wish to specify a value, place an equal sign after the 
  551. macro name followed by the text that the macro is to be defined as. The macro 
  552. information will be displayed in the box immediately below and will be preceded 
  553. with a dot. The dot indicates that the macro is defined. To undefine a macro 
  554. symbol, select it from the list of macro symbols and then select the  Undefine 
  555. push button. The dot preceding the macro symbol will disappear. Note that the 
  556. macro symbol has not been removed from the list. To delete a macro from the 
  557. list, select it from the list of macro symbols and then select the  Delete 
  558. push button. If you wish to redefine a macro that has been undefined, select it 
  559. from the list of macro symbols and then select the  Define  push button. The 
  560. dot preceding the macro symbol will reappear. 
  561.  
  562. Selecting  Syntax check only  instructs the compiler to scan the source code 
  563. and make sure that it is syntactically correct; no object code will be 
  564. generated. 
  565.  
  566. Selecting  Force enums to be type int  instructs the compiler to allocate an 
  567. 'int' for all enumerated types. By default, the compiler will allocate the 
  568. smallest storage unit required to hold all possible values given for an 
  569. enumerated list. 
  570.  
  571. Selecting  Change char default to signed  instructs the compiler to change the 
  572. default "char" type from an unsigned to a signed quantity. 
  573.  
  574. Selecting  Structure packing alignment  allows you to specify the alignment of 
  575. members in a structure. The default value for the structure alignment is 1. The 
  576. alignment of structure members is described in the following table. If the size 
  577. of the member is 1, 2, 4 or 8, the alignment is given in the table. If the 
  578. member of the structure is an array or structure, the alignment is described by 
  579. the row "x". 
  580.  
  581.                             Alignment
  582.                     1       2       4       8
  583. sizeof(member)  \-------------------------------
  584.         1       |   0       0       0       0
  585.         2       |   0       2       2       2
  586.         4       |   0       2       4       4
  587.         8       |   0       2       4       8
  588.         x       |   aligned to largest member
  589.  
  590. An alignment of 0 means no alignment, 2 means word boundary, 4 means doubleword 
  591. boundary, etc. If the largest member of structure "x" is 1 byte then "x" is not 
  592. aligned. If the largest member of structure "x" is 2 bytes then "x" is aligned 
  593. according to row 2. If the largest member of structure "x" is 4 bytes then "x" 
  594. is aligned according to row 4. If the largest member of structure "x" is 8 
  595. bytes then "x" is aligned according to row 8. 
  596.  
  597. To understand why structure member alignment may be important, consider the 
  598. following example. 
  599.  
  600. typedef struct memo_el {
  601.     char           date[9];
  602.     struct memo_el *prev,*next;
  603.     ref_number     int;
  604. } memo;
  605.  
  606. In the above example, the default alignment value of 1 will cause the pointer 
  607. and integer items to be aligned on odd addresses since the array "date" is 9 
  608. bytes in length. On computer systems that have a 16-bit (or 32-bit) bus, 
  609. improved performance can be obtained when these items are aligned on an even 
  610. boundary. 
  611.  
  612.  
  613. ΓòÉΓòÉΓòÉ 9. Miscellaneous Compiler Options ΓòÉΓòÉΓòÉ
  614.  
  615. The dialog entitled  Miscellaneous Compiler Options  lists a number of 
  616. miscellaneous compiler options. 
  617.  
  618. Selecting  Messages to terminal  instructs the compiler to display all messages 
  619. to the terminal. 
  620.  
  621. Selecting  Ignore WCL386 environment variable  causes the WCL386 environment 
  622. variable to be ignored. The WCL386 environment can also be used to specify 
  623. options. 
  624.  
  625. Selecting  Data threshold:  allows you to set the minimum size for data objects 
  626. to be included in the default data segment. This option is only useful for 
  627. memory models that have big data models where arrays larger than the data 
  628. threshold are allocated outside the default data segment. 
  629.  
  630. Double-Byte Character Support 
  631.  
  632. The compiler can recognize double-byte characters in strings. When the compiler 
  633. scans a text string enclosed in quotes ("), it will recognize the first byte of 
  634. a double-byte character and suppress lexical analysis of the second byte. This 
  635. will prevent the compiler from misinterpreting the second byte as a "\" or 
  636. quote (") character. 
  637.  
  638. Selecting  Kanji  causes the compiler to process strings for Japanese 
  639. double-byte characters (range 0x81 - 0x9F and 0xE0 - 0xFC). The characters in 
  640. the range A0 - DF are single-byte Hiragana. 
  641.  
  642. Selecting  Chinese/Taiwanese  causes the compiler to process strings for 
  643. Traditional Chinese and Taiwanese double-byte characters (range 0x81 - 0xFC). 
  644.  
  645. Selecting  Chinese/Taiwanese  causes the compiler to process strings for Korean 
  646. Hangeul double-byte characters (range 0x81 - 0xFD). 
  647.  
  648. Selecting  No double-byte character support  suppresses the double-byte 
  649. character processing by the compiler. 
  650.  
  651.  
  652. ΓòÉΓòÉΓòÉ 10. Linker Options ΓòÉΓòÉΓòÉ
  653.  
  654. The dialog entitled  Linker Options  allows you to specify options that affect 
  655. the linking of your application. 
  656.  
  657. Selecting  Compile only, no linking  will cause your application to be compiled 
  658. only; the linker will not be invoked. 
  659.  
  660. Selecting  Stack size:  allows you to set the size of the stack created for 
  661. your application during execution. 
  662.  
  663. Selecting  System name:  allows you to specify the system name the linker will 
  664. use to create your application. Pre-defined system names can be found in the 
  665. file "wlink.lnk" which is located in the "binb" directory of the directory in 
  666. which you installed WATCOM C/386. 
  667.  
  668. Selecting  Map file:  causes the linker to generate a map file. Once you have 
  669. chosen to generate a map file, you can specify the name of the map file by 
  670. selecting  Map: . A cursor will appear in the entry field immediately to the 
  671. right. Simply type the name of the map file. If no file name is specified, the 
  672. map file will have the same file name as the executable file and file extension 
  673. "MAP". 
  674.  
  675. Selecting  Directive file:  will place the linker directives used to link your 
  676. applications in a file. Once you have chosen to generate a linker directive 
  677. file, you can specify the name of the directive file by selecting  Directive: . 
  678. A cursor will appear in the entry field immediately to the right. Simply type 
  679. the name of the directive file. If no file name is specified, the directive 
  680. file will have file name "__WCL__.LNK". 
  681.  
  682. Selecting  Executable:  allows you to specify the name of the executable file 
  683. generated by the linker. A cursor will appear in the entry field immediately to 
  684. the right. Simply type the name of the executable file. If no file name is 
  685. specified, the executable file will have the same file name as the first object 
  686. file encountered by the linker and extension "EXE". 
  687.  
  688. Selecting  Additonal linker directives:  allows you to specify additional 
  689. linker directives. 
  690.  
  691.  
  692. ΓòÉΓòÉΓòÉ 11. Application Type ΓòÉΓòÉΓòÉ
  693.  
  694. The dialog entitled  Application Type  allows you to specify the type of 
  695. application you are creating. 
  696.  
  697. Selecting  Build dynamic link library  indicates that you are creating a 
  698. dynamic link library. Special libraries are required to link an application 
  699. that is a dynamic link library. 
  700.  
  701. Selecting  Build multi-threaded application  indicates that you are creating a 
  702. multi-threaded application and the multi-threaded version of the libraries 
  703. should be used to link your application. 
  704.  
  705. The run-time libraries contain a default windowing system that allows a 
  706. character-mode application to display output in a desktop window. The desktop 
  707. window is not to be confused with a PM compatible window. It is a PM window 
  708. created using the PM API functions. Selecting  Build default-windowed 
  709. application:  causes the default windowing system to be used by your 
  710. application.