Apparently gcc (4) has gained a new interesting flag, -fmudflap, which
causes gcc to instrument memory operations, so that in runtime memory
access errors can be caught (a la valgrind, a la Purify, a la etc.)
Something like this should work:
cat > mud.c
int main() {
char buf[100];
buf[100] = 0;
}
^D
gcc -o mud -fmudflap mud.c -lmudflap
./mud
***KABOOM***
I'm saying "apparently" and "should work" because none of the gccs
I have available have this feature installed even though the gcc man
page knows about this feature. What happens for me is this:
cc1: error: mf-runtime.h: No such file or directory
If someone feels like looking into this (starting from what the heck
needs to be installed), a patch for Makefile.SH and t/TEST and
pod/perlhack.pod a la valgrind etc. would be cool.
Thread Next