Author: Cody Moore
This directory consists of two different types of programs. All the programs with the names of prog-XX.c are different examples of some of the more common C bugs that are encountered.
Each program contains come basic output to demonstrate the C bug, and it also contains come basic comments if you wish to further know what the bug is and how to identify it.
This directory also includes a library for xmalloc to track the memory use and prevent common memory errors from occuring.
Included with the library is an example program that links the library so that you an better understand how to use it in your own code.
First thing you need to do to compile all programs is to run:
make
Or you can compile an individual test by:
make prog-XX OR make prog-XX-gcc
from within the same directory this README is in. At which point, you can then run each program test individually by:
make run-XX OR make run-XX-gcc
where XX is the number test to run.
You can compile the xmalloc library by running the command:
make xmalloc
This builds a file "xmalloc.o" which you can then link to any source you write and then write:
#include "xmalloc.h"
Finally you can compile the example code provided with the library by running
make xmalloc-test
Then run the program by entering:
./xmalloc-test
If you wish you can also clean your directory by running:
make clean
FOR SOLARIS: If you are running solaris please use gmake for all commands instead of make.