Valgrind 不会检测缓冲区溢出

Valgrind won't detect buffer overflow

#include <stdio.h>
main()
{     
    char buf[8];
    sprintf(buf,"AAAA%3s","XXssssssssXXXsssssXXX");
    printf("%s\n",buf);
}

我希望 valgrind 能够用上面的代码检测到缓冲区溢出。但它不报告任何错误或警告。我需要为此启用任何特殊标志吗?

来自Valgrind Tutorial

valgrind 不是什么

Although valgrind is an extremely useful program, it will not miraculously tell you about every memory bug in your program. There are several limitations that you should keep in mind. It does not do bounds checking on stack/static arrays ..