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

            Bug ID: 98508
           Summary: Sanitizer disable -Wall and -Wextra
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: awdawdawdawq123123 at gmx dot de
  Target Milestone: ---

Created attachment 49871
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49871&action=edit
source file

1.cpp:
```
struct S
{
    int a;
};

int main()
{
    S s = S(s);
}
```

Compiling this by calling 

g++ -Wall -Wextra  1.cpp

yields the warning:
```
1.cpp: In function ‘int main()’:
1.cpp:8:7: warning: ‘s’ is used uninitialized in this function
[-Wuninitialized]
    8 |     S s = S(s);
      |       ^
```
as expected. But when additionally using Sanitizers the call

g++ -Wall -Wextra  -fsanitize=address,undefined 1.cpp

yields no warnings. 
Attached is the source file.

Reply via email to