This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: out of bound memory check
- From: Bo Thorsen <bo at sonofthor dot dk>
- To: Amol Kumar Lad <amolk at ishoni dot com>, gcc at gcc dot gnu dot org
- Date: Wed, 28 Aug 2002 12:37:44 +0200
- Subject: Re: out of bound memory check
- References: <1030545766.2601.65.camel@amol.in.ishoni.com>
On Wednesday 28 August 2002 16:42, Amol Kumar Lad wrote:
> Hi,
> Is is possible to catch out of bound memory access in gcc ?
> For example
>
> int a[100];
> int *p = a;
>
> *(p + 200) = 5; <-- I need to catch this
>
> Is there any compiler support ??
> I also don't know how Rational purify and other mem-tools catch
> overbound access..
>
> Please cc me as I am not subscribed to list
Check out valgrind, a great memory debugger that catches stuff like this:
http://developer.kde.org/~sewardj/
(Don't be fooled by this being a kde page; kde just hosts the project and uses
it intensely.)
Bo.
--
Bo Thorsen | Praestevejen 4
Free software developer | 5290 Marslev
SuSE Labs | Denmark