v10p0a.pat

来自「开放源码的编译器open watcom 1.6.0版的源代码」· PAT 代码 · 共 1,313 行 · 第 1/3 页

PAT
1,313
字号

===========================================================
::::94/11/02 (AFS)

    Added support for __declspec(dllexport) and
    __declspec(dllimport) for Win32 (i.e., WinNT 3.5
    and Win95) programs.  Here are some examples:
    
    __declspec(dllexport) int a;        // export 'a' variable
    __declspec(dllexport) int b()       // export 'b' function
    {
    }
    
    struct __declspec(dllexport) S {
        static int a;                   // export 'a' static member
        void b();                       // export 'b' member fn
    };
    
    extern __declspec(dllimport) int a; // import 'a' from a .DLL
    extern __declspec(dllimport) int b();//import 'b' from a .DLL
    
    struct __declspec(dllimport) I {
        static int a;                   // import 'a' static member
        void b();                       // import 'b' member fn
    };

===========================================================
::::94/11/03 (AFS)

    C++ compiler generates better error messages for in-class
    initializations and pure virtual functions.
    
        struct S {
            static int const a = 0;
            static int const b = 1;
            void foo() = 0;
            void bar() = 1;
            virtual void ack() = 0;
            virtual void sam() = 1;
        };

===========================================================
::::94/11/04 (AFS)

    Fixed macro processing code so that the following program
    compiles correctly.  The compiler was not treating
    "catch" as a keyword after the expansion of "catch_all".
    
        #define catch(n) catch(n &exception)
        #define xall (...)
        #define catch_all catch xall
        
        main()
        {
            try{
            }
            catch_all{
            }
        }

===========================================================
::::94/11/04 (AFS)

    Fixed a problem where #pragma code_seg caused a page
    fault in the compiler when the code_seg was empty.

===========================================================
::::94/11/07 (AFS)

    Fixed a rare problem where a #include of a file that
    was previously included caused the primary source file
    to finish up if the CR/LF pair for the line the #include
    was on, straddled the C++ compiler's internal buffering
    boundary.

===========================================================
::::94/11/07 (AFS)

    Added support for #pragma message( "message text" ).
    Outputs message to stdout when encountered.  Used
    in MS SDK header files to warn about directly including
    header files and obsolete files.

===========================================================
::::94/11/11 (AFS)

    Fixed #pragma code_seg/data_seg to properly set the
    class name of the new segment in the object file.

===========================================================
::::94/11/13 (AFS)

    Fixed a problem with the -zm -d2 options that caused
    a compiler fault in some circumstances.

===========================================================
::::94/11/17 (AFS)

    Fixed default library records in .OBJ file so that user
    libraries are ahead of default compiler libraries in
    the linker search order.

===========================================================
::::94/11/18 (AFS)

    Fixed handling of intrinsic math functions so that code
    generator will treat functions like sqrt as an operator.

===========================================================
::::94/11/18 (JWW)

    Added support for using OS-specific exception handling
    mechanisms for C++ exception handling during code
    generation.  Enable with the new -zo option.

===========================================================
::::94/11/21 (AFS)

    __stdcall functions now have MS Visual C/C++ compatible
    name mangling.  The -zz option can be used to get the
    old 10.0GA naming convention for __stdcall.

===========================================================
::::94/11/21 (AFS)

    __cdecl functions now preserve EBX for MS Visual C/C++
    compatibility.

===========================================================
::::94/11/22 (AFS)

    Fixed processing of option response files with more than
    one line in them.

===========================================================
::::94/11/22 (AFS)

    __far16 __cdecl and __pascal function definitions are
    compiled with the best register save set now (previous
    save set was conservative)

===========================================================
::::94/11/24 (AFS)

    Diagnose the following code when compiling for strict
    ANSI mode:
    
        void foo();
        static void foo();

===========================================================
::::94/12/06 (AFS)

    Fixed a case where the compiler optimized a virtual call
    to a direct call in such a way that a weak extern was
    used to import the function name thus libraries would
    not be searched for the virtual function.  The actual
    code generated was correct so if the function was resolved
    through other means, the program functioned properly.

    struct B {
        virtual void foo( int = 0 );
        virtual void bar( int );
    };
    
    void g( B x )
    {
        x.foo();
        x.bar(1);
    }

===========================================================
::::94/12/06 (AFS)

    Fixed a compiler optimization where in large code models,
    a static function was made into a NEAR function under
    certain conditions.  Inline functions (which default
    to 'static' storage class) can be generated out of line.
    If two modules have out-of-line inline functions and one
    module optimized the inline function to NEAR, then depending
    on what module is chosen by the linker to supply the out of
    line code, one of the callers does not match the function
    actually called.  The fix was to never optimize the out-of-line
    function to NEAR so that all modules agree on the calling
    convention.

    // module #1
    // compiler decides out-of-line copy is NEAR
    inline int fact( int x ) {
        if( x == 0 ) {
            return 1;
        }
        return x + fact( x - 1 );
    }
    void bar( void ) {
        int x = fact( 5 );      // calls a NEAR function
    }
    
    // module #2
    // compiler decides out-of-line copy is FAR
    inline int fact( int x ) {
        if( x == 0 ) {
            return 1;
        }
        return x + fact( x - 1 );
    }
    void sam( void ) {
        int x = fact( 5 );      // calls a FAR function
    }

===========================================================
::::94/12/06 (AFS)

    Fixed diagnosis of anonymous union member unions that
    collide with a type name in the enclosing scope.
    
    struct S {
        typedef int T;
        union { int T; };
    };

===========================================================
::::94/12/08 (AFS)

    Added support for (req'd for Win32 OLE C++ headers):
    
        void foo( int, int );
        class S {
            void foo();
            // global 'foo' not member 'foo'
            friend void ::foo( int, int );
            int m;
        };

===========================================================
::::94/12/08 (AFS)

    Correctly diagnose macro references that span multiple
    lines.

        #define f(a,b) a+b
        #if f(1,
                2)
        #endif
        
===========================================================
::::94/12/12 (AFS)

    Fixed compiler so that the common type of a 0 constant
    and a near pointer is a far pointer in large data models.
    Also applies to code pointers.
    
    e.g.,
        // -ml or -mc
        int __near i;
        int *p;
        p = ( b ? &i : 0 );  // common type was 'int near *'
        if( p == NULL ) {
        }
        
===========================================================
::::94/12/13 (AFS)

    Tweaked compiler so that if a #define of a macro is
    different than a previous definition, the new definition
    is used and a warning is emitted.  In strict ANSI mode,
    this is still a hard error.
    
    e.g.,
    
        // redefinition warning but error if strict ANSI
        #define FOO 123
        #define FOO 0xa0a
        
        int x = FOO;
        
===========================================================
::::94/12/15 (AFS)

    Fixed 16-bit compiler so that DLL exported and imported
    data defaults to far in large memory models (-mc -ml -mh).
    
    e.g.,
        // -mc, -ml, -mh
        struct __export S {
            int static a;
        };
        
        void foo() {
            S::a = 1; // access as far
        }
        
===========================================================
::::95/01/03 (JWW)

    Sometimes elimination of a copy ctor, when the copied item was
    constructor with non-default calling convention, did not work.
    
    Work around: do the copy in two steps
    
    enum E {
        A,B,C
    };
    
    struct __pascal S {
        E x;
        S( E x ) : x(x) {
        }
    };
    
    S const foo()
    {
        return S( B );  // did not work
    }
    
    Replace "foo" with
    
    S const foo()
    {
        S retn( B );
        return retn;
    }

        
===========================================================
::::95/01/08 (AFS)

    Diagnose ''' character constants as illegal.
        
===========================================================
::::94/01/10 (AFS)

    Fixed a problem with += or ++ of an enumerated type
    that could cause incorrect code to be generated or
    a compiler fault.
    
    e.g.,
    
        enum E { A, B, C };
        
        void fn() {
            E x;
            
            x++;
        }
        
===========================================================
::::95/01/10 (AFS)

    Improved the location for some diagnostics.
    
    e.g.,
    
        int fn( int far x,
                int far y )
        {
        }
        
===========================================================
::::95/01/23 (AFS)

    Added support for #pragma data_seg() and #pragma code_seg().
    
    e.g.,
        #pragma data_seg( "_MYDATA" )
        
        int x = 3;      // in _MYDATA segment
        
        #pragma data_seg() // restore default data segment
        
        int y = 4;      // in _DATA segment

===========================================================
::::95/01/23 (AFS)

    Fixed a problem with derived classes that declare
    virtual functions with the same name as a base class.
    
    e.g.,
        struct B { B(); };
        struct D : B {
            virtual B();
        };

===========================================================
::::95/01/23 (JWW)

    Sometimes the compiler missed diagnosing the impossibility
    of generating a default constructor.
    
    struct S {
        S();
    };
    
    struct F {
        int _0;
        S x;
        F(int);
    };
    
    struct B : F {
        B();
    };
    
    B::B() {            // should diagnose F() as impossible
    }                   // to create
    
    Work around: none

===========================================================
::::95/01/31 (AFS)

    Allow "operator ()" to have default arguments unless
    we are compiling for strict ISO/ANSI C++.

===========================================================
::::95/01/31 (AFS)

    Fixed compiler so that it will not rescan a class
    template if it was used in a base class reference.
    
    Example:

        template <class T> struct W;
        template <class T> struct V : W<T> {
            W<T> *p;
            short x;
            V(short x=2) : p(this), x(x), W<T>(x) {
            }
        };
        template <class T> struct W {
            V<short> *q;
            short zz;
            W( short x = 3 ) : q( 0 ), zz(x) {
            }
        };
    
        W<double> *q;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?