Find (memory) bugs over multiple translation units (files) in C


I want to be able to track memory bugs, e.g double frees over multiple
C-files. When one function allocates memory and passes the pointer to
another function in another file, then a double free is not found anymore.

#include <stdlib.h>
#include "file2.h"
int main(int argc, void** argv) {
    void* p = malloc(1);

#include <stdlib.h>
void foo(void* p) {

void foo(void* p);

There have been some question on this previously:

Has anything changed since then?

Also wouldn't it be possible to just merge the different ASTs together
and analyze the program as a whole?

Is there a specific reason why this hasn't been implemented? If it is
not too big a task I could extend clang for this scenario as part of my
bachelor's thesis.

I'm looking forward to your insights.

Thank you very much in advance

Florian Scheibner