public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/99612] New: Remove "#pragma GCC system_header" from atomic file to warn on incorrect memory order
@ 2021-03-16  8:32 antoshkka at gmail dot com
  2021-03-16 12:17 ` [Bug libstdc++/99612] " redi at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: antoshkka at gmail dot com @ 2021-03-16  8:32 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99612
           Summary: Remove "#pragma GCC system_header" from atomic file to
                    warn on incorrect memory order
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: antoshkka at gmail dot com
  Target Milestone: ---

GCC has -Winvalid-memory-model that warns if wrong memory model is used with
atomic

  auto ret = a.load(std::memory_order_release); // warning
  a.store(10, std::memory_order_acquire); // warning

Unfortunately, that warning does not work by default, because <atomic> header
has a "#pragma GCC system_header" in it.

The only way to get the warning is to use -Wsystem-headers that unleashes all
the warnings from all system headers.

Playground: https://godbolt.org/z/Wca5ef

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

end of thread, other threads:[~2022-01-04 21:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-16  8:32 [Bug libstdc++/99612] New: Remove "#pragma GCC system_header" from atomic file to warn on incorrect memory order antoshkka at gmail dot com
2021-03-16 12:17 ` [Bug libstdc++/99612] " redi at gcc dot gnu.org
2021-03-16 16:14 ` [Bug middle-end/99612] " msebor at gcc dot gnu.org
2021-03-16 16:15 ` msebor at gcc dot gnu.org
2021-03-16 16:18 ` msebor at gcc dot gnu.org
2021-12-08 16:50 ` msebor at gcc dot gnu.org
2022-01-04 20:57 ` cvs-commit at gcc dot gnu.org
2022-01-04 21:00 ` msebor 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).