On 25 March 2012 03:59, Oleg Endo<oleg.endo@t-online.de> wrote:
I might be misunderstanding the idea...
Let's assume you've got a program that doesn't compile, and you leave
out those erroneous blocks to enforce successful compilation of the
broken program. How are you going to figure out for which blocks it is
actually safe to be removed and for which it isn't?
I can do it by tracing the code blocks which are dependent on the
erroneous block. i.e if any block is data/control dependent(the output
or written value of the erroneous part is read) on this erroneous
block or line of code will be eliminated.
Effectively, you'll
be changing the original semantics of a program, and those semantic
changes might be completely not what the programmer originally had in
mind. In the worst case, something might end up with an (un)formatted
harddisk...*
Cheers,
Oleg
Thank you sir for your great feedback. You have understood it
correctly. Now the programmer will be informed about the change in
code and the semantics.(Notice that this plug-in is not going to
modify the original code!, it just copy the original code and perform
all the operations on the temporary file!!!) Even from the partial
execution of the code the programmer will get an overview of his
actual progress.
suppose the program written by the programmer be:
1 int main(void)
2 {
3 int arr[]={3,4,-10,22,33,37,11};
4 sort(arr);
5 int a = arr[3] // Now suppose the programmer missed the semicolon
here. Which generates a compilation error at line 5;
6 printf("%d\n",a);
7 for(i=0;i<7;i++)
8 {
9 printf("%d\n",arr[i]);
10 }
11 }
Now if we just analyze the data (i.e. variable), we can easily find
that there is only data dependency exists between line 5 and line 6.
The rest of the program is not being effected due to elimination or
commenting line 5.