-
Notifications
You must be signed in to change notification settings - Fork 3
Issue to track comments and updates to the proposed Checked C extension changes. #467
Comments
Comment from @mwhicks1: Overall this looks good! Here are a few comments. Including an extra headerThe proposal states
This implies that a normal compiler will interpret the header, which serves to undo the Checked C syntax, but that the Checked C
It feels unfortunate that this is done via a header inclusion; it's a change to the source file itself. E.g., if you could just change environment variables or something like that, that would be preferred (to me). Type qualifiers on pointersI like the idea of treating Checked types as type qualifiers. Note that this idea was done in Cyclone in ~2005, so it predates the Condit paper you cite. (See the Cyclone manual, which presents notation that prefixes qualifiers with You might include examples with nested qualifiers -- I presume you want things like
to indicate an array of singleton pointers. What happens if pointers already have qualifiers on them? E.g., many standard library functions use
I don't know how the C parser handles multiple qualifiers, but I presume it does and you can do the same thing. Checked arrays (and blocks?)Just want to make sure: You are basically saying that the syntax for the Polymorphic typesThe requirement that programmers remember to typedef type variables seems like it's asking for trouble:
That is, I can imagine someone easily forgetting to do this. Moreover, type abstraction for generics is local, whereas the typedef will have to be global. There could be conflicts with other typedefs or variable names in the code, no? ItypesWhat about itypes? I don't see anything about these, and yet they are an important/pervasive part of the language. Are they basically similar to |
Comment from @mattmccutchen-cci: Can we please have a more specific title for this issue and the wiki page? Maybe "erasable" Checked C syntax? Re Mike's specific points:
One other problem I noticed:
Aside from that, the proposal looks good to me for all the Checked C language features that it covers (I may not be aware of some of the less common language features). It's possible I would find additional problems if I thought about it harder, but I think the chance that those problems would require significant rework is low enough that it's probably fine to proceed to implementation and address any further problems as we find them. The syntax looks very cluttered and hard to read in the more complex cases such as As the "Motivation" section of the wiki page says, one problem that seems to be out of scope of the current proposal is that users get no guarantee of spatial memory safety when compiling with a plain-C compiler since the runtime checks won't be inserted. It would be great if users could compile with the Checked C compiler, verify that there are no errors, and then turn around and compile with a specialized plain-C compiler required by their target system and have a guarantee of spatial memory safety. This probably could be achieved if the Checked C compiler reported an error instead of inserting an implicit runtime check when it cannot prove that an operation is safe, thus forcing the user to add the necessary explicit |
Comment from @sulekhark: A proposal for name change (to emphasize that these are type qualifiers for pointer types, and to have uniform names for type qualifiers introduced by Checked C):
|
This issue was copied from checkedc/checkedc#470
This page proposes a set of changes to the Checked C extension to improve backward compatibility. Creating this issue to track review/suggestions/updates to this proposal.
The text was updated successfully, but these errors were encountered: