public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/29521]  New: Confusing warning for return with expression in function returning void
@ 2006-10-20  6:17 muntyan at tamu dot edu
  2006-10-20  9:09 ` [Bug c/29521] " rguenth at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: muntyan at tamu dot edu @ 2006-10-20  6:17 UTC (permalink / raw)
  To: gcc-bugs

Consider the following code:

void func () 
{
}

void func2 ()
{
    return func ();
}

gcc -pedantic correctly warns about "return func();", but the warning text is
very confusing:
   'return' with a value, in function returning void
It talks about "value" where there is no value involved.
It took me a while to understand what exactly is wrong. Warning says "value",
so I obviously checked signatures first; then I looked for a problem with
includes; then I asked in comp.lang.c.

It would be better if gcc said something like
   'return' with an expression, in function returning void
or
   ISO C forbids ...

The latter would be the best, I guess.


-- 
           Summary: Confusing warning for return with expression in function
                    returning void
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: muntyan at tamu dot edu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29521


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-02-13  1:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-20  6:17 [Bug c/29521] New: Confusing warning for return with expression in function returning void muntyan at tamu dot edu
2006-10-20  9:09 ` [Bug c/29521] " rguenth at gcc dot gnu dot org
2007-01-18 18:06 ` patchapp at dberlin dot org
2007-02-12 23:15 ` patchapp at dberlin dot org
2007-02-13  0:29 ` manu at gcc dot gnu dot org
2007-02-13  1:52 ` manu at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).