我的目的是使用Clang作为
Windows上Valgrind的替代品,在我写的C/C++程序中查找缓冲区溢出,动态内存滥用等.我已经按照
here提供的指示成功修建了Clang.
我尝试使用-faddress-sanitizer选项(如指定here)编译一个简单的C程序,并且以下错误被抛出 –
gcc.exe: error: unrecognized command line option '-faddress-sanitizer' Using built-in specs. COLLECT_GCC=C:/MinGW/bin/gcc.exe Target: mingw32 Configured with: ../gcc-4.7.0/configure --enable-languages=c,c++,ada,fortran,objc,obj- c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --disable-build-poststage1-with-cxx --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw Thread model: win32 gcc version 4.7.0 (GCC) clang: error: assembler (via gcc) command Failed with exit code 1 (use -v to see invocation)
为什么cl铛(据我所知)援引海湾合作委员会?当然,GCC不支持-faddress-sanitizer选项.
我真的很高兴使用这个可能性,因为我一直在试图找到一个好的(免费)替代Valgrind一段时间.有人可以帮忙吗?
解决方法
AddressSanitizer在Windows上工作得更好,但这仍然是一个正在进行的工作.
https://github.com/google/sanitizers/wiki/AddressSanitizerWindowsPort有一些文档
原文地址:https://www.jb51.cc/c/114016.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。