Using gcc flags -fmudflapth -lmudflap

Compile your code with the gcc flags -fmudflapth -lmudflap as they can provide additional information. For example:

gcc -fmudflapth -lmudflap my_code.c

You may want to have an alias (e.g., gcc2) that includes these flags. Do not run valgrind with code compiled with these flags.

Experiment with the following code so you get a sense of error messages you could get. In the following code, the char array is not long enough.

#include <stdio.h>
#include <string.h>

int main() {
   char keyword[4];

   strcpy(keyword, "TODO");  /* incorrect */
   printf("keyword: %s\n", keyword);

   return 0;
}
	   
Web Accessibility