Hacker GitHub

← All repos

duneroadrunner/SaferCPlusPlus-AutoTranslation

View on GitHub ↗ ★ 9 C++

This project has been superseded by SaferCPlusPlus-AutoTranslation2 (https://github.com/duneroadrunner/SaferCPlusPlus-AutoTranslation2) and remains here for posterity.

19 mentions on Hacker News by 3 people: 0 stories, 19 comments · first 2017-07-01 · latest 2020-01-25

Mentions per year 19 mentions · busiest year 2018 (7)
20082026
  1. Unfortunately, documentation [1] is still kind of lacking. Like Rust (and arguably modern C++ conventions?), the safe subset doesn't support pointer arithmetic directly. You would have to convert the pointer to an iterator (and its target…
  2. Last time I looked at it, c2rust translated from C to unsafe Rust, right? I'll point out a (neglected) project[1] to (partially) auto convert from C to a safe subset of C++. For example, if you need a png encoder/decoder library written in…
    comment by duneroadrunner · 2019-10-24 · in How to not rewrite it in Rust
  3. Thanks for noticing :) It's been quite a while since I worked on the code, but I believe that the translator intentionally left types declared as "char {star}" unmodified assuming that they were being used as strings [1] rather "regular"…
    comment by duneroadrunner · 2019-03-19 · in Achieving Safety Incrementally with Checked C
  4. Saw this in the translated "SaferCPlusPlus" output examples. static void string_set(char** out, const char* in) What happened there? Where are the array types? Wrong place to look? If inference can't make a definitely good decision, maybe…
  5. > "Unknown" ranges from 49% to 76%. Yeah, this is interesting. They're saying they can't determine whether a pointer targets an array buffer or not? Perhaps they might want to take a look at the (long neglected) "C to SaferCPlusPlus"…
    comment by duneroadrunner · 2019-03-19 · in Achieving Safety Incrementally with Checked C
  6. Replacing existing unsafe C++ elements with compatible memory safe substitutes[1] might be more expedient. The conversion can even be automated[2] for parts of the code that aren't performance critical. [1] shameless plug:…
  7. equally shameless: https://github.com/duneroadrunner/SaferCPlusPlus-AutoTransla...
  8. > I want the standards committee to produce a bounds-checked dialect of C where I can choose to pay some perf cost to get real dynamic and bounds-checked arrays If you don't want to wait on the standards committee, the SaferCPlusPlus…
  9. Not sure if it's what you're thinking of, but there is the "C to SaferCPlusPlus" auto-translation helper tool[1]. The idea is that the output can be compiled as straight C, with the safety mechanisms disabled, or with the (compile-time and…
    comment by duneroadrunner · 2018-07-02 · in C2rust vs. Corrode
  10. Don't forget about SaferCPlusPlus[1]. Much safer than conventional modern C++. Also (optionally) uses scope lifetimes to prevent use-after-free. (Not yet fully compiler enforced like Rust, but hopefully that'll be coming at some point.)…
  11. SaferCPlusPlus[1], for example, is a safe subset of C++ that has compatible safe substitutes for C++'s (and therefore C's) unsafe elements. So migrating existing C/C++ code generally just requires replacing variable declarations, not…
    comment by duneroadrunner · 2018-03-23 · in C for All
  12. > "guaranteed to be safe" (which will most likely require tooling) rather than merely "safer" - and I will be the first one to promote it myself :-) Well I hope so, as SaferCPlusPlus could use a little promotion :) At this point, despite…
  13. > It's technically possible, but retrofitting old code rarely happens. Yeah. A more realistic solution might be auto-translation of existing code. Here[1] is an example that replaces declarations of arrays, and pointers used as array…
  14. > ( http://people.canonical.com/~ubuntu-security/cve/pkg/xmlrpc-... ) It looks like some of those CVEs are dated not that long ago. If code safety is still a concern with this project, you/someone might consider conversion to…
    comment by duneroadrunner · 2017-11-10 · in LibHTTP: Open Source HTTP Library in C
  15. > On the other hand, it probably is less effort to rewrite PolarSSL in Rust than doing that proof. It's probably even less effort to convert to SaferCPlusPlus[1] (essentially a memory-safe subset of C++). There's even an tool[2] (under…
    comment by duneroadrunner · 2017-10-06 · in Building on Rock, Not Sand
  16. One case the author left out was translation to "idiomatic" higher level language, which involves identifying abstractions that are intrinsically present, but where never explicitly expressed, in the original code. For example I've been…
    comment by duneroadrunner · 2017-09-03 · in What do people mean when they say “transpiler”?
  17. Have to mention SaferCPlusPlus[1] here - basically a memory-safe subset of C++ with (fairly) low migration cost. For example, here[2] is an open source png encoder/decoder that was ensured to be free from buffer overflow vulnerabilities…
  18. I can't say for certain why none of the "safer C"s have caught on, but I can say that they all have significant compromises and/or impracticalities. Often, performance cost is one of them. Today though, you can use the safe numerics[1]…
    comment by duneroadrunner · 2017-07-26 · in Defining the Undefinedness of C (2015) [pdf]
  19. It's still in early development, but there is a tool[1] that automatically converts potentially unsafe C/C++ code to be memory-safe. If the problem is C/C++ programmers that write unsafe code, rather than trying to change their practices…
    comment by duneroadrunner · 2017-07-01 · in Chris Lattner on the Realm WWDC 2017 Swift Panel