-
Notifications
You must be signed in to change notification settings - Fork 79
Bug fixes and modest extensions #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
that occur before other declarations.
of functions doesn't make sense.
* Initial version of the checked-c conversion tool. Current features: - Processes single C files or multiple C files (up to whole programs) - Infers "ptr-ness" for local variables used in those programs. - Re-write many source files - Supports many aspects of the C grammar - Contains unit tests Current weaknesses: - Macro support is limited - Casting support is limited, needs structural type equality checks - No inherent support for standard library functions. - Doesn't honor existing checked C types
that occur before other declarations.
of functions doesn't make sense.
sometimes they even do something.
ptr<int> then that would mean 'a' would too, since the assignment copies the constraints. However, 'a' is used with arithmetic, so there doesn't seem to be a logical way that 'd' could be used as a ptr without a cast.
- typedefs complicate re-writing. Adopting a conservative strategy for now. - macros that define functions complicate identification of constraint variables. Adopting a conservative strategy for now.
Conflicts: tools/checked-c-convert/CheckedCConvert.cpp tools/checked-c-convert/ConstraintBuilder.cpp tools/checked-c-convert/ProgramInfo.cpp tools/checked-c-convert/ProgramInfo.h
// so don't. | ||
SourceRange SR = UD->getReturnTypeSourceRange(); | ||
if(SR.isValid()) | ||
if(SR.isValid() && (R.getRangeSize(SR) != -1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: need a space after the 'if'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: missing space after 'if'
Generally looks good - I've pointed out some minor nits in the code. The PersistentSourceLoc file needs more comments describing what it is doing. Please clarify that the source location used for comparisons is the original textual location, not the expanded source location. You might want a helper function for validating that a range can be rewritten. Currently, you are checking that a range is valid and that getRangeSize(...) != -1. The test that getRangeSize(...) != -1 is idiomatic, so using a helper function would make the code clearer to read. |
I think I've addressed the code review feedback. |
LGTM. |
- Clarify that the checked property of an array declarator is only propagated to nested array declarators. It is not propagated to typedef bodies. - It is an error if there is a mismatch in checked properties between an array type and an element type that is an array type. - Improve the organization and wording of the text for checked multi-dimensional arrays.
Many changes to deal with running on "real" code: