Open mwhicks1 opened 4 years ago
FTR: As of the October 2020 milestone, we generally recommend -alltypes
but haven't yet made it the default because it breaks some things (TBD who has the details on this) and will say so in the readme.
To add information: the output of 3c
without -alltypes
should always compile in checkedc clang, while the output with it has no such guarantee. Array bounds, for example on _Array_ptr
's , are not always inferred, but clang requires them for dereferences.
I'm adding label "won't fix" but leaving this open for when we change our minds.
In terms of choosing the default, are we sure that a guarantee of successful compilation is still more important than inserting more annotations? Remember, users can always override the flag.
If we switch the default: Should we keep -alltypes
as a no-op for compatibility with existing scripts? (Or even fancier, make -alltypes
later on the command line override -noalltypes
earlier, a common behavior in other command-line programs? Some option parsing libraries make this easy; LLVM's may not.) If we don't keep it, how much work will it be to coordinate the flip across all our repositories, and are we assuming no outsiders are depending on this yet?
Even if -alltypes
doesn't produce compilable code, I would suggest that it's the right default for a serious project, i.e., one for which you have the goal of eventually porting most/all of it to Checked C. That's why I suggested this change (to -noalltypes
rather than -alltypes
). I don't care too much, but I still feel like making this change is the right thing to do.
I believe @jackastner was the hold-out in our meeting. Do you still have a strong opinion, John?
Support for array pointer and bounds inference has improved to the point that it should be the rule, rather than the exception. As such, it makes sense to swap the
-alltypes
flag for-noalltypes
.This should be easy to do in the code: The
CConv.cpp
flagAlltypes
can stay as it is, we just need to change the code inCConvStandalone.cpp
so that the default for this boolean istrue
, notfalse
, i.e., something likeand then later