Mail Archives: djgpp/1996/10/27/19:10:21
Marc Singer <elf AT netcom DOT com> wrote:
> > > Did anybody thougt about including the
> > >
> > > 'Bounds Checking for C'
> > > (see http://www-ala.doc.ic.ac.uk/~phjk/BoundsChecking.html)
>
> What does this option do? AFAIK there is no compile-time check for
> bounds that is possible in C. If it is a runtime check, then I'm very
> much against it. There are utilities to help programmers find memory
> leaks and they are best left optional.
It is a run-time check, enabled by -fbounds-checking on the gcc
commandline. It does not check for memory leaks at all; after all,
it's a bounds-checker. It catches array overflows, bad pointer math,
illegal operations on NULL pointers, etc. It does slow down programs
quite a bit, but is a good debugging aid. Check the web page above for
more information.
-Dan Nelson
- Raw text -