union2.c

来自「this is a gcc file, you can download it 」· C语言 代码 · 共 39 行

C
39
字号
// Bug: g++ crashed on empty intializers for unions.// Bug: gcc and g++ didn't zero unions with empty initializers.// Submitted by J"orn Rennecke <amylaar@cygnus.co.uk>extern "C" void exit (int);typedef union u{  union u *up;  void *vp;} u;static u v = {};void bar (u);void baz (u);void foo(){       u w = {};       u x = { &v };       baz (x);       bar (w);}void baz (u w) { }void bar (u w){  if (w.up)    exit (1);}int main (){  foo ();  return 0;}

⌨️ 快捷键说明

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