Issue 203213
Summary [LifetimeSafety] Enable lifetime analysis for C language
Labels clang:temporal-safety
Assignees
Reporter NeKon69
    Clang lifetime safety analysis currently does not run for C code.

It would be useful to support C as well, at least for primitive objects and C-compatible attribute spelling such as `__attribute__((lifetimebound))`.

Example:

```c
int *id(int *p __attribute__((lifetimebound))) {
  return p;
}

int *bad(void) {
  int local;
  return id(&local);
}
```
Expected result: enabling lifetime safety warnings in C mode should diagnose cases where a pointer to a local object escapes its lifetime.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to