This is the mail archive of the gcc-patches@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]

PR 29521 Confusing warning for return with expression in function returning void


:ADDPATCH c:

Simple fix for PR 29521. Given the testcase:

void func ()
{
}

void func2 ()
{
   return func ();
}

The patch replaces:

warning: 'return' with a value, in function returning void

with:

ISO C forbids 'return' with expression in function returning void

OK for mainline?

2007-01-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org>

 PR c/29521
 * c-typeck.c (c_finish_return): Improve warning message.

testsuite/
 * gcc.dg/c90-return-1.c: Update output.
 * gcc.dg/c99-return-1.c: Likewise.

Attachment: return-void-msg.diff
Description: Text document


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