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]

mudflap problem


Hello,

I tried mudflap on some test programs and found that the following program works:

int a[1024];
int b[1024];

int
main(void)
{
       int i;

       for (i = 0 ; i < 2048 ; i++) {
               b[i] = 0;
       }
       return 0;
}

When compiled with -fmudflap the code runs with no error. In the memory map
the array b is before array a. So the code above first fills array b with 0 and then a.
I assumed mudflap should warn me about buffer overruns. It does not in this case.


If I replace 'b[i] = 0' with 'a[i] = 0' I get the expected errors.

Herman.


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