public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/102074] New: include/bits/atomic_timed_wait.h:215: possible missing return ?
@ 2021-08-26  9:19 dcb314 at hotmail dot com
  2021-08-26 12:16 ` [Bug libstdc++/102074] " redi at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: dcb314 at hotmail dot com @ 2021-08-26  9:19 UTC (permalink / raw)
  To: gcc-bugs

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.

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

end of thread, other threads:[~2022-01-16  1:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-26  9:19 [Bug libstdc++/102074] New: include/bits/atomic_timed_wait.h:215: possible missing return ? dcb314 at hotmail dot com
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

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).