Modules compiled with and without bounds checking may be linked together without special preparation.

Checked pointers may be passed to modules compiled without bounds checking.

Structures containing pointers may be passed between modules compiled with and without bounds checking.

Modules compiled without bounds checking still check some pointer accesses.

Checked pointers (pointers created by malloc or by modules compiled with
bounds checking) are checked in calls to the str* and mem*
library functions and in calls to modules compiled with bounds checking.

The checks are similar to a malloc debug library, except more powerful because they
also check local and static variables created in modules compiled with checking.

The GCC_BOUNDS_OPTS environment variable passes options to the bounds checker.

You can run the bounds checking gcc from its build area using the script
/u/gnu/bgcc-x.y/gcc/bounds/bgcc
For more build information, see the README file.
or the files created by the patches in /u/gnu/bgcc-x.y/gcc/bounds/.

You may freely mix object modules compiled with and without bounds checking.
The bounds checker also includes replacements for
mem* and str* routines
and can detect invalid calls against checked memory objects, even from modules
compiled without bounds checking.

These patches are unrelated to the fat pointer bounds checking patches by
Greg McGary gkm@eng.ascend.com which change the size of pointers and require
building modified versions of libc and most other libraries that your program
calls. Greg's patches will eventually be incorporated into GCC.
If you can use Greg's fat pointer bounds checker, it has the advantage of
better run-time performance and support for languages other than C.

Valgrind by Julian Seward is another open-source memory debugger for Intel x86-based Linux systems.
Valgrind runs unmodified ELF x86 Linux executables within a Pentium emulator and detects
accesses to uninitialized variables, accesses to unallocated memory, and memory leaks.
In comparison to bounds checking gcc, valgrind has the advantages of detecting accesses to
uninitialized variables, of not requiring recompilation or relinking, and of supporting C++.
Valgrind has the disadvantages of working only on x86-based Linux systems and of not detecting
out-of-bounds array accesses as long as the accesses still produce valid addresses (so it often
misses off-by-one accesses to local arrays).
Valgrind has more memory overhead than bounds checking gcc but about the same amount of cpu overhead.
I regularly use both bounds checking gcc and valgrind.
Valgrind Home
http://valgrind.kde.org/
Valgrind freshmeat project
http://freshmeat.net/projects/valgrind/
Valgrind HowTo
http://www.tldp.org/HOWTO/Valgrind-HOWTO/