uninit-4.c

来自「linux下的gcc编译器」· C语言 代码 · 共 53 行

C
53
字号
/* Spurious uninit variable warnings, case 4.   Simplified version of cppexp.c (cpp_parse_expr).   This one is really fragile, it gets it right if you take out case   1, or if the structure is replaced by an int, or if the structure   has fewer members (!) *//* { dg-do compile } *//* { dg-options "-O -Wuninitialized" } */extern void abort (void);struct operation {    short op;    char rprio;    char flags;    char unsignedp;    long value;};extern struct operation cpp_lex (void);voidcpp_parse_expr (void){  int rprio; /* { dg-bogus "rprio" "uninitialized variable warning" { xfail *-*-* } } */  struct operation op;  for (;;)    {      op = cpp_lex ();      switch (op.op)	{	case 0:	  break;	case 1:	  return;	case 2:	  rprio = 1;	  break;	default:	  return;	}      if (op.op == 0)	return;      if (rprio != 1)	abort();    }}

⌨️ 快捷键说明

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