This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: memory check
- To: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Subject: Re: memory check
- From: Jean-Francois MORCILLO <Jean-Francois dot Morcillo at steria dot fr>
- Date: Thu, 07 Oct 1999 18:07:49 +0200
- Organization: Atelier B
- References: <37FC4491.20D8621B@steria.fr>
Thanks,
Now I have compiled little exemple with gcc 2.95.1
using the folowing command line
gcc -fbounds-check a.cpp -o a.out
#include <stdlib.h>
int main(void)
{
int t[10] ;
t[11] = 4 ;
char *toto = (char *)malloc(4) ;
strcpy(toto, "toto") ;
free(toto) ;
strcpy(toto, "toto") ;
}
when I start the program nothing happens....
How can I detect the out of bounds access
thanks again
N8TM@aol.com wrote:
> In a message dated 10/6/99 11:59:30 PM Pacific Daylight Time,
> Jean-Francois.Morcillo@steria.fr writes:
>
> > to generate
> > code that can detect) :
> > - an out of bounds acces to array
> recent versions, since 2.95, I believe
>
> -fbounds-check