return-type-2.c

来自「gcc3.2.1源代码」· C语言 代码 · 共 48 行

C
48
字号
/* Bogus warnings claiming we fall off the end of a non-void function.   By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/27/2000.  *//* { dg-do compile } *//* { dg-options "-O2 -Wreturn-type" } */extern void abort (void) __attribute__ ((__noreturn__));intfoo1 (int i){  if (i)    return i;  abort ();} /* { dg-bogus "control reaches end of non-void function" "warning for falling off end of non-void function" } */__inline__ intfoo2 (int i){  if (i)    return i;  abort ();} /* { dg-bogus "control reaches end of non-void function" "warning for falling off end of non-void function" } */static intfoo3 (int i){  if (i)    return i;  abort ();} /* { dg-bogus "control reaches end of non-void function" "warning for falling off end of non-void function" } */static __inline__ intfoo4 (int i){  if (i)    return i;  abort ();} /* { dg-bogus "control reaches end of non-void function" "warning for falling off end of non-void function" } */int bar (int i){  return foo1 (i) + foo2 (i) + foo3 (i) + foo4 (i);}

⌨️ 快捷键说明

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