Issue 117425
Summary [warning] Don't report function returns address of local variable
Labels new issue
Assignees
Reporter vfdff
    * test: https://gcc.godbolt.org/z/Yz1dTvbhn
```

int *foo() {
    int *p = 0;
    {
        int x = 0;
        p = &x;
        *p = 42;
    }
    *p = 42;
    return p;
}
```

 - I already use -Wall to report all warning, but the **dangling pointer** is not identified by clang
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to