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: out of bound memory check


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


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