⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cv08.cpp

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 CPP
字号:
#include "dump.h"

static void good1();
static void good2();
static void good3();

#if __WATCOM_REVISION__ >= 8
// from customer

struct INT64 {
    long lo, hi;

    INT64(long h, long l) { hi = h; lo = l; good1(); }
    operator unsigned int() const
    {
	good2();
	return (unsigned int)  lo;
    }
    friend INT64 operator + (const INT64 &a, const unsigned int &b);
};
  
  
inline INT64 operator + (const INT64 &a, const unsigned int &b)
{
    good3();
    return INT64(a.hi, b);
}
  
int foo(const INT64 &a)
{
    return a + 1u;  /* the error is occuring on this line */
}
#endif

static void good1() {
    GOOD;
}
static void good2() {
    GOOD;
}
static void good3() {
    GOOD;
}

int main() {
#if __WATCOM_REVISION__ >= 8
    INT64 a( 1, 1 );
    CHECK_GOOD(36);
    foo( a );
    CHECK_GOOD(36+39+42+36)
#else
    good1();
    CHECK_GOOD(36);
    good3();
    good1();
    good2();
    CHECK_GOOD(36+39+42+36)
#endif
    return errors != 0;
}

⌨️ 快捷键说明

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