-
Notifications
You must be signed in to change notification settings - Fork 11
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
foamAudit #29
Comments
In my builds, -Waudit is always on, and I agree. Also, I think |
OK, this is 80% done, but there's a bit of a type shaped hole at the moment. To explain, the FOAM generated by the compiler does not conform to the type rules in foam.c (they can be enabled optionally, but you'll get errors). Most of the time, we're fine, as almost all real types are represented as FOAM_Word, it's only when FOAM_Rec or FOAM_Clos comes into the picture we get into trouble. Consider a domain List(Record(x:T)); at the moment, Record(x: T) is represented as type FOAM_Rec, while all the exports of List will assume that the type is FOAM_Word. So any function on the List(Record()) type will fail the type rules. I suspect that the fix is to treat maps and records specially when deciding what interface type they have; Unfortunately adding this will confuse the inliner, as the additional casts might not be removed, and it will need fixing. Similarly of_retype will also need some attention (it is mostly about casting) |
Perhaps making the audit a post-condition for FOAM construction and setter functions would be a good idea. That way, bugs in genfoam or optimiser can be caught right where they happen. Also, it would mean that every FOAM value constructed by these functions is always valid. |
In principle, yes. There's a few places where we create variables with The other problem is that local/lex checking would need to be disabled, or Peter |
The compiler -Waudit option does a small amount of checking on foam being emitted by the compiler. It should be on by default in all builds, assuming compile time isn't an issue.
There's a couple of steps to get it working:
The text was updated successfully, but these errors were encountered: