public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/97067] New: UBSAN: False positive maybe-uninitialized
@ 2020-09-16  9:28 vincent.lebourlot at starqube dot com
  2020-09-17 16:24 ` [Bug sanitizer/97067] " msebor at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: vincent.lebourlot at starqube dot com @ 2020-09-16  9:28 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97067
           Summary: UBSAN: False positive maybe-uninitialized
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vincent.lebourlot at starqube dot com
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at gcc dot gnu.org
  Target Milestone: ---

Compiling with -Wall -fsanitize=undefined the following code causes a false
positive:

```
void nothing(){return;}
int toto=[](){nothing();return 0;}();
int main(){return 0;}
````

warnings are:

main.cpp: In function ‘void __static_initialization_and_destruction_0(int,
int)’:
main.cpp:3:35: warning: ‘<unknown>’ may be used uninitialized
[-Wmaybe-uninitialized]
    3 | int toto=[](){nothing();return 0;}();
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~^~
main.cpp:3:10: note: by argument 1 of type ‘const<lambda()>*’ to ‘<lambda()>’
declared here
    3 | int toto=[](){nothing();return 0;}();
      |          ^
main.cpp:3:10: note: ‘<anonymous>’ declared here
    3 | int toto=[](){nothing();return 0;}();
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~

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

* [Bug sanitizer/97067] UBSAN: False positive maybe-uninitialized
  2020-09-16  9:28 [Bug sanitizer/97067] New: UBSAN: False positive maybe-uninitialized vincent.lebourlot at starqube dot com
@ 2020-09-17 16:24 ` msebor at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: msebor at gcc dot gnu.org @ 2020-09-17 16:24 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
                 CC|                            |msebor at gcc dot gnu.org
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
I'm not able to reproduce the warning on trunk.  I'm assuming it's been fixed
by r11-3237 (pr96295).  If the warning persists, please reopen the bug and
provide all the information requested at https://gcc.gnu.org/bugs.

*** This bug has been marked as a duplicate of bug 96295 ***

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

end of thread, other threads:[~2020-09-17 16:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-16  9:28 [Bug sanitizer/97067] New: UBSAN: False positive maybe-uninitialized vincent.lebourlot at starqube dot com
2020-09-17 16:24 ` [Bug sanitizer/97067] " 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).