This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bound-checks


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
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]