admin管理员组

文章数量:1297116

Unfortunately my Mac is a little old (x86_64-apple-darwin19.6.0) so it's not compatible with fsanitize=leak when I want to analize memory leaks in programs.

leak.c:

#include <stdlib.h>

int main(){

    int* bytes = (int*)malloc(sizeof(int));

    return 0;
}

I get the following error:

clang: error: unsupported option '-fsanitize=leak' for target 'x86_64-apple-darwin19.6.0'

Is there a workaround to use it? What would you recommend I use in order to analyze memory leaks for my particular situation?

本文标签: gccHow to use fsanitizeleak in older mac versionsStack Overflow