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

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