bf04.c

来自「开放源码的编译器open watcom 1.6.0版的源代码」· C语言 代码 · 共 34 行

C
34
字号
#include "fail.h"

// we don't handle bitfields in static anonymous unions
static union {
    unsigned char x:2;
    int q;
};

struct S {
    union {
	unsigned char x:2;
	int q;
    };
};

int test( S *p )
{
    union {
	unsigned char y:2;
	int q;
    };
    q = 0;
    return ( x == 3 ) && ( p->x == 2 ) && ( y == 0 );
}

int main() {
    S x;
    q = -1;
    x.q = -1;
    x.x = 2;
    if( test( &x ) != 1 ) _fail;
    _PASS;
}

⌨️ 快捷键说明

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