public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "lh_mouse at 126 dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/80635] [8/9/10 regression] std::optional and bogus -Wmaybe-uninitialized warning Date: Thu, 09 Apr 2020 06:02:48 +0000 [thread overview] Message-ID: <bug-80635-4-f2ikdjmTuz@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-80635-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80635 --- Comment #53 from Liu Hao <lh_mouse at 126 dot com> --- For people who are not willing to turn off this warning: This warning may be suppressed by introducing a volatile member in the union that is used as the storage. Using Martin Sebor's testcase, this look likes this: ``` union { T t; char x[sizeof (T)]; volatile char dont_use; // this silences such warnings. }; ``` (the `sizeof (T)` thing is unnecessary, as the union will always have correct size and alignment w/o it.) Hope it helps.
next prev parent reply other threads:[~2020-04-09 6:02 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-80635-4@http.gcc.gnu.org/bugzilla/> 2020-01-06 18:08 ` jason at gcc dot gnu.org 2020-03-17 15:12 ` jamborm at gcc dot gnu.org 2020-03-17 15:32 ` law at redhat dot com 2020-04-09 6:02 ` lh_mouse at 126 dot com [this message] 2020-10-15 18:02 ` [Bug tree-optimization/80635] [8/9/10/11 " cuzdav at gmail dot com 2020-11-16 23:10 ` law at redhat dot com 2020-12-27 1:39 ` alexmudmiko at gmail dot com 2021-02-18 21:05 ` law at redhat dot com 2021-02-22 22:02 ` msebor at gcc dot gnu.org 2021-02-23 11:54 ` jakub at gcc dot gnu.org 2021-02-23 12:33 ` jakub at gcc dot gnu.org 2021-02-25 9:21 ` cvs-commit at gcc dot gnu.org 2021-02-25 9:27 ` [Bug tree-optimization/80635] [8/9/10 " jakub at gcc dot gnu.org 2021-05-14 9:48 ` [Bug tree-optimization/80635] [9/10 " jakub at gcc dot gnu.org 2021-06-01 8:08 ` rguenth at gcc dot gnu.org 2021-06-25 10:23 ` paul.f.fee at gmail dot com 2022-05-27 9:37 ` [Bug tree-optimization/80635] [10 " rguenth at gcc dot gnu.org 2022-06-28 10:33 ` jakub at gcc dot gnu.org 2022-11-16 10:30 ` mail at milianw dot de 2022-11-20 4:08 ` law at gcc dot gnu.org 2023-07-07 7:39 ` rguenth 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-80635-4-f2ikdjmTuz@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: linkBe 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).