Giter VIP home page Giter VIP logo

Comments (4)

mattmccutchen-cci avatar mattmccutchen-cci commented on September 13, 2024

I'm starting to look into this using bh as an example (though I may soon check the other example programs to see whether I can get more improvement for the work there).

So it's legitimate to change orig to reduce diffs for the purpose of our experiment? Changing whitespace and splitting multi-decls is OK? What about adding parameter types to function declarations? That's required by Checked C and not required by plain C; I think there's consensus that newly written C code should have parameter types, but some of the codebases to which we envision real users applying 3C might be old enough not to have them, so I'm unsure whether adding them to orig to reduce diffs makes our results more or less valid with respect to the target usage of 3C. Can any more general statement be made about what kinds of changes to orig are legitimate?

from analyze-conversion.

mattmccutchen-cci avatar mattmccutchen-cci commented on September 13, 2024

Another example from git diff --ignore-all-space --no-index src/Olden/bh/{orig,revert}/newbh.c:

   if (Type(n) == BODY) {
-    Next((bodyptr) n) = bp_free_list;
-    bp_free_list = (bodyptr) n;
+    bodyptr p = 0;
+     { p = (bodyptr)n; }
+    Next(p) = bp_free_list;
+    bp_free_list = p;
   }

Here the extra local variable and block were introduced so that the manual port could add an _Unchecked annotation on the block and an _Assume_bounds_cast inside it. IIUC, currently the diff above is being counted as a refactoring. Is that what we want, or should we apply the change to orig so that this (arguably artificial and formulaic) change is counted as neither a refactoring nor an annotation? Or does it not matter because we'll rely more on the semantic statistics from 3C than on the line diffs?

from analyze-conversion.

mwhicks1 avatar mwhicks1 commented on September 13, 2024

So it's legitimate to change orig to reduce diffs for the purpose of our experiment? Changing whitespace and splitting multi-decls is OK? What about adding parameter types to function declarations?

Changing whitespace and splitting multidecls is OK.

The rest, I would say, should be left alone. Part of the porting process is to add types to parameters that don't have them. So we should not change orig to do that.

OTOH, it's also OK to change manual so that it does a better job of porting without making diffs that aren't needed. The bzero and #undef comment I made in the issue description is an example.

from analyze-conversion.

mwhicks1 avatar mwhicks1 commented on September 13, 2024

should we apply the change to orig so that this (arguably artificial and formulaic) change is counted as neither a refactoring nor an annotation? Or does it not matter because we'll rely more on the semantic statistics from 3C than on the line diffs?

It should count as a refactoring (in the line diffs) because it was required by Checked C for the program to typecheck. So we should not change it in orig. At the same time, it won't play into the semantic stats, as you've pointed out.

from analyze-conversion.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.