develooper Front page | perl.perl5.porters | Postings from July 2007

something to try out: gcc -fmudflap

Thread Next
From:
Jarkko Hietaniemi
Date:
July 31, 2007 05:00
Subject:
something to try out: gcc -fmudflap
Message ID:
46AF246D.4010403@iki.fi
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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About