public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dcb314 at hotmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/102074] New: include/bits/atomic_timed_wait.h:215: possible missing return ?
Date: Thu, 26 Aug 2021 09:19:37 +0000	[thread overview]
Message-ID: <bug-102074-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102074

            Bug ID: 102074
           Summary: include/bits/atomic_timed_wait.h:215: possible missing
                    return ?
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

libstdc++-v3/include/bits/atomic_timed_wait.h:215:6: error: Found a exit path
from function with non-void return type that has missing return statement
[missingReturn]

Source code is

        {
#ifdef _GLIBCXX_HAVE_PLATFORM_TIMED_WAIT
          return __platform_wait_until(__addr, __old, __atime);
#else
          __platform_wait_t __val;
          __atomic_load(__addr, &__val, __ATOMIC_RELAXED);
          if (__val == __old)
            {
              lock_guard<mutex> __l(_M_mtx);
              return __cond_wait_until(_M_cv, _M_mtx, __atime);
            }
#endif // _GLIBCXX_HAVE_PLATFORM_TIMED_WAIT
        }

I see no code for __val != __old, not even some rarely executed error handling
code.

Static analyser cppcheck found this possible problem.

             reply	other threads:[~2021-08-26  9:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26  9:19 dcb314 at hotmail dot com [this message]
2021-08-26 12:16 ` [Bug libstdc++/102074] " redi at gcc dot gnu.org
2021-08-28 10:19 ` redi at gcc dot gnu.org
2021-08-31 16:46 ` cvs-commit at gcc dot gnu.org
2021-10-12 10:58 ` cvs-commit at gcc dot gnu.org
2022-01-16  1:16 ` rodgertq 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=bug-102074-4@http.gcc.gnu.org/bugzilla/ \
    --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).