Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ User's Guide - the "ze" option (default) enables the use of the following compiler http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
The "ze" option (default) enables the use of the following compiler
extensions:
 1. The requirement for at least one external definition per module is
    relaxed.

 2. When using the C compiler, some forgiveable pointer type mismatches
    become warnings instead of errors.

 3. In-line math functions are allowed (note that errno will not be set by
    in-line functions).

 4. When using the C compiler, anonymous structs/unions are allowed (this is
    always permitted in C++).

    Example:

         struct {
             int a;
             union {
                 int   b;
                 float alt_b;
             };
             int c;
         } x;

    In the above example, "x.b" is a valid reference to the "b" field.

 5. For C only, ANSI function prototype scope rules are relaxed to allow the
    following program to compile without any errors.

    Example:

         void foo( struct a *__p );

         struct a {
             int b;
             int c;
         };

         void bar( void )
         {
             struct a x;
             foo( &x );
         }

    According to a strict interpretation of the ANSI C standard, the
    function prototype introduces a new scope which is terminated at the
    semicolon (;).  The effect of this is that the structure tag "a" in the
    function "foo" is not the same structure tag "a" defined after the
    prototype.  A diagnostic must be issued for a conforming ANSI C
    implementation.

 6. A trailing comma (,) is allowed after the last constant in an enum
    declaration.

    Example:

         enum colour { RED, GREEN, BLUE, };

 7. The ANSI requirement that all enums have a base type of int is relaxed.
    The motivation for this extension is conservation of storage.  Many
    enums can be represented by integral types that are smaller in size than
    an int.

    Example:

         enum colour { RED, GREEN, BLUE, };

         void foo( void )
         {
             enum colour x;

             x = RED;
         }

    In the example, "x" can be stored in an unsigned char because its values
    span the range 0 to 2.

 8. The ANSI requirement that the base type of a bitfield be int or unsigned
    is relaxed.  This allows a programmer to allocate bitfields from smaller
    units of storage than an int (e.g., unsigned char).

    Example:

         struct {
             unsigned char a : 1;
             unsigned char b : 1;
             unsigned char c : 1;
         } x;

         struct {
             unsigned a : 1;
             unsigned b : 1;
             unsigned c : 1;
         } y;

    In the above example, the size of "x" is the same size as an unsigned
    char whereas the size of "y" is the same size as an unsigned int.

 9. The following macros are defined.


         _near, near
         _far, far, SOMDLINK (16-bit)
         _huge, huge
         _based
         _segment
         _segname
         _self
         _cdecl, cdecl, _Cdecl, SOMLINK (16-bit)
         _pascal, pascal, _Pascal
         _fortran, fortran
         _interrupt, interrupt
         _export
         _loadds
         _saveregs
         _syscall, _System, SOMLINK (32-bit), SOMDLINK (32-bit)
         _far16, _Far16


See also the description of the "za" option.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson