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]

Re: memory check


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


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