public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/44511] Misdetects missing return with non-void return type, but only if the function is static
Date: Sun, 13 Jun 2010 14:18:00 -0000	[thread overview]
Message-ID: <20100613141828.19995.qmail@sourceware.org> (raw)
In-Reply-To: <bug-44511-19315@http.gcc.gnu.org/bugzilla/>



------- Comment #3 from rguenth at gcc dot gnu dot org  2010-06-13 14:18 -------
(In reply to comment #2)
> (In reply to comment #1)
> > 
> > instead.  So the warning you see is really warning about no return statement,
> > not about control reaching the end of a non-void function.  And it does so
> > by design just for functions with static linkage.
> > 
> > So I'd say the warning is not false, it is just not useful for the case
> > where the function does not return at all.
> > 
> > Leaving the bug as enhancement request instead of closing as wontfix/invalid.
> > 
> 
> I don't see how one can detect that the function does not return from the FE,
> so I don't think this is possible to implement without moving the warning to
> the middle-end. Perhaps we should not care about unused static functions and
> remove this warning altogether.
> 
> What happens if the static function actually returns and is used? Do you get 2
> warnings?

No, the Frontend sets TREE_NO_WARNING after it issued the warning.


-- 


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


  parent reply	other threads:[~2010-06-13 14:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-13  8:55 [Bug c/44511] New: " richard+gcc at sfere dot greenend dot org dot uk
2010-06-13 10:33 ` [Bug c/44511] " rguenth at gcc dot gnu dot org
2010-06-13 13:49 ` manu at gcc dot gnu dot org
2010-06-13 14:18 ` rguenth at gcc dot gnu dot org [this message]
     [not found] <bug-44511-4@http.gcc.gnu.org/bugzilla/>
2020-11-22  2:18 ` eggert at cs dot ucla.edu
2020-11-22 11:38 ` jakub at gcc dot gnu.org
2020-11-22 21:10 ` egallager at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100613141828.19995.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).