Mac OS: Leaks Sanitizer

前端 未结 2 464
忘了有多久
忘了有多久 2021-01-03 01:38

Mac OS X Sierra 10.13

I do as wrote here https://clang.llvm.org/docs/LeakSanitizer.html

I.e. created the small application with memory leak

#         


        
2条回答
  •  春和景丽
    2021-01-03 02:14

    It seems that the Clang/LLVM shipped by Apple does not have -fsanitize=leak support. I fixed it by installing LLVM on Homebrew. A more detailed fix is on gist

    $ brew install llvm@8
    
    # Overwritten default Clang
    $ echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> .zshrc
    
    $ source ~/.zshrc
    $ which clang
    /usr/local/opt/llvm/bin/clang
    

提交回复
热议问题