wstrict-aliasing-float-ref-int-obj.c

来自「用于进行gcc测试」· C语言 代码 · 共 11 行

C
11
字号
/* { dg-do compile } *//* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */int foo() {  int x;  float& q = reinterpret_cast<float&> (x);  /* { dg-warning "type-punn" } */  q = 1.0;  return x;}

⌨️ 快捷键说明

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