union-cast-2.c
来自「linux下编程用 编译软件」· C语言 代码 · 共 16 行
C
16 行
/* { dg-do compile } *//* { dg-options "-std=c89 -pedantic-errors" } *//* PR 23155 We should get two error messages, one about union cast and the other about array access for non lvalues. */union vx {short f[8]; int v;};int vec;voidfoo5 (int vec){ ((union vx) vec).f[5] = 1; /* { dg-error "(forbids subscripting)|(forbids casts to union type)" } */}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?