7 ms·
This seems to be a successor to CCured from 2005, a project partially funded by Microsoft. [1] The general idea is straightforward: "The unchecked C pointer ty
by Animats 10y ago
This seems to be a successor to CCured from 2005, a project partially funded by Microsoft. [1]
The general idea is straightforward: "The unchecked C pointer type * is kept and three new checked pointer types are added: one for pointers that are never used in pointer arithmetic and do not need bounds checking (ptr), one for array pointer types that are involved in pointer arithmetic and need bounds checking (array ptr), and one for pointer types that carry their bounds with them dynamically (span)." So this is really a new language derived from C, to which programs can be converted.
This is basically a good idea, but it's only useful if pushed hard by somebody like Microsoft. People won't convert without heavy pressure.
[1] https://www.cs.virginia.edu/~weimer/p/p477-necula.pdf https://www.cs.virginia.edu/~weimer/p/p477-necula.pdf
- vintermann 10y agoI thought so too, but looking at their paper, they have an impressive survey of prior approaches, and they explain their differences from CCured quite well. CCured used fat pointers, and apparently modified the data pointed to by WILD pointers (something I didn't know). This seems interesting to me. I liked the way CCured did inference to document how you used and abused your pointers, but what it did with that information was maybe not ideal.
- haberman 10y agoA link to the paper you are mentioning would be helpful.
- jsingleton 10y agoThe github repo is the paper: https://github.com/Microsoft/checkedc/releases https://github.com/Microsoft/checkedc/releases
- dragandj 10y agoBeing pushed by Microsoft could be exactly the reason not to convert, for many people. Especially when there is no shortage of alternatives that are backed by a bit more benevolent entities (Rust, and many other less known variants).
- coldtea 10y agoTo put things in perspective, consider than from web browsers and languages, to their respective ill-fated mobile OS efforts, nothing Mozilla created has ever gotten more adoption than something MS created.
- dragandj 10y agoOnly if we don't count Netscape and JavaScript. They put it in the browser, for better or for worse.
- coldtea 10y agoWhy would we count Netscape and Javascript? We're talking about Mozilla. Netscape was a different company -- and besides we're discussing under the context of MS vs benevolent/FOSS entities.
- freeduck 10y agoAccording to w3counter ff and ie are neck to neck. https://www.w3counter.com/globalstats.php https://www.w3counter.com/globalstats.php Last month ff was ahead
- majewsky 10y agoIt depends on the country. In Germany Firefox is actually the most popular browser according to usage statistics (even ahead of Chrome). Source: http://de.statista.com/statistik/daten/studie/13007/umfrage/marktanteile-der-browser-bei-der-internetnutzung-in-deutschland-seit-2009/ http://de.statista.com/statistik/daten/studie/13007/umfrage/... (German statistics office. Paywalled sadly, but you can see the first paragraph that describes Firefox market share at 52%.)
- nhaehnle 10y agoJust FYI, Statista is a private company. You may be thinking of http://destatis.de/ http://destatis.de/, which is the homepage of the German federal office for statistics.
- cleeus 10y agoIf that's all, it's nothing that cannot be done in-language with smart pointer/iterator types in C++.
- Jtsummers 10y agobut I don't want to move my embedded C projects to C++. If I can use a language extension to get some extra confidence in my programs without changing the language im using then that's a compelling proposition.
- adxlarbi 10y agobut here in the case of Microsoft Checked C , you still need to modify your actual source code to get safer one.
- fao_ 10y agoBut you're moving to a safer subset, not a safer superset, so it still shouldn't require significant alterations.
- mixedCase 10y agoUhhh moving from set to subset is what requires alterations, set to superset does not, by definition. The problem here is compiler support and performance.
- fao_ 10y agoC++ is an altered and extended form of C, thus I would say it is more accurate to call it a superset, rather than a subset. I'm not using precise definitions here. And of course, but those will come in time. The point of it is that C++ isn't any safer (And actually, I would say is more risky in some aspects, because of the differences between (For example) the UB in C and C++), while Checked C is guaranteed to be safer, to a certain degree.
- ptspts 10y agoIndeed, checkedc also introduces these 3 new pointer types (ptr, array-ptr and span). It also introduces invariants on variables, arguments and return values: Quoting from the paper (https://github.com/Microsoft/checkedc/releases/download/v0.5-final/checkedc-v0.5.pdf https://github.com/Microsoft/checkedc/releases/download/v0.5...): Reasoning about the correctness of programs with declared bounds sometimes requires reasoning about simple aspects of program behavior. To support this, lightweight invariants are added to Checked C. A lightweight invariant declares a relation between a variable and a simple expression using a relational operator. An example would be the statement x < y + 5. Lightweight invariants can be declared at variable declarations, at assignment statements, for parameters, and for return values. Checked C is extended with rules for checking these lightweight invariants. Just as type checking rules are defined by the programming language, so are rules for checking lightweight invariants. The checking of the correctness of programmer-declared bounds is integrated with the checking of invariants.