This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

"no return statement" warning weirdness


Hello,

we've just noticed that in this test case:
static inline int f1 (void)
{
}

static inline long f2 (void)
{
}

int main (void)
{
  f1 ();
  f2 ();
}

function f1 triggers the warning:
testcase.c: In function `f1':
testcase.c:4: warning: no return statement in function returning non-void

but for function f2 this warning is not generated.
However, when using 'long int' instead of 'long', the warning is back.

This appears to be due to a check for C_FUNCTION_IMPLICIT_INT before
emitting the warning: when using just 'long', this flag is set to 1,
and if the flag is 1 the warning is not output.

Is this supposed to work that way?

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]