This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: bound-checks
- From: "S.Hockenhull" <potam at sympatico dot ca>
- To: "Dave Korn" <dk at artimi dot com>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Mon, 28 Jun 2004 14:18:27 -0400
- Subject: Re: bound-checks
- References: <NUTMEGM3SuC4j6OTR63000005a2@NUTMEG.CAM.ARTIMI.COM>
On June 28, 2004 12:26, Dave Korn wrote:
> > -----Original Message-----
> > From: gcc-owner On Behalf Of S.Hockenhull
> > Sent: 28 June 2004 16:06
> >
> > On June 27, 2004 23:56, llewelly wrote:
> > > It doesn't bounds check pointers or arrays, but you could try
> > > configuring with --enable-libstdcxx-debug and compiling with
> > > -D_GLIBCXX_DEBUG . This does bounds checking for standard C++
> > > library containers;
> >
> > sorry, wont do.
> > I need pointer/array checks.
> > something like CodeGuard (on Borland compiler) or
> > BoundChecker (on MSVC).
>
> Sounds like you want Valgrind.
>
> http://valgrind.kde.org/
>
>
> cheers,
> DaveK
Ha-ha! thanks!
yup, that's pretty much it and it seem to work somewhat (not sure if its stuck
in an infinite loop or just extremely slow, maybe both) but it already found
some old leftover
"if(uninitialized_var == something) { some_ignored_var = something; }" and a
few bugs/warnings in X11 libs, SDL libs, OpenGL, and pthread lib.
it'd still be nice to have an equivalent in gcc-generated code so it'll work
on just about any platform and a bit faster than the emulated x86 method of
valgrind, altho with the drawback of not finding bugs in pre-compiled libs
(that could also be a plus) and requiring recompilation.
something inserted between the language frontend and generic backend that way
it wont be too language-specific.
--
Stephane Hockenhull