out of bound memory check

Bo Thorsen bo@sonofthor.dk
Wed Aug 28 03:37:00 GMT 2002


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



More information about the Gcc mailing list