Open
Description
Suppose we are converting an application A that depends on an external library B for which we have only headers. We can't modify B's original headers, but we want 3C to help us maintain our own checked versions of B's headers so we can more fully convert A. This is an umbrella issue for any documentation, 3C or Checked C enhancements, or add-on tools we may develop to support this scenario.
A few problems I see already:
- We'd have to lift 3C's usual prohibition on changing declarations of functions that have no definition (done in liberal itypes for prototypes (with no def) #402 / Changes to add itypes on undefined functions #691.) Of course, 3C would then be at risk of changing a declaration in a way that is unsound with respect to the actual definition, so we'd have to keep an eye on that (now tracked by Develop workflow to support safe use of
-infer-types-for-undefs
by enforcing review of inferred declarations #698), but we're probably still better off using 3C than writing the checked B headers completely manually. - Currently, 3C only solves for changes to files under the base dir. One simple but crude way we could get 3C to solve for the checked B headers is to copy them into the base dir and adjust the include paths so A sees that copy of the headers. Is there a fundamentally better solution, or might it be worth providing scripts to automate this basic solution?