[cfe-dev] bug in clang

Andrew Wells amtaw at comcast.net
Mon Nov 22 06:49:16 PST 2010


Hi,
     I was coding a USACO practice problem mhen I came across this bug 
which causes a Segmentation fault (I am using Fedora 14 x86_64).  Please 
consider the following code:

#include <stdio.h>

int main ()
{

     FILE *fout = fopen ("test.txt", "w");
     char character[5];
     int i;
     for(i = 0; i < 6; i++)
     {
         character[i] = 'A'; //This statement causes an error
     }


fprintf(fout, "Point 1\n");

     return (0);
}

God bless you,
Andrew Wells










More information about the cfe-dev mailing list