TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Fixing C source code from the internet using cake static analyzer

12 pointsby thradamsabout 1 year ago

2 comments

thradamsabout 1 year ago
Cake is a open source compiler and static analyzer in development. (Not production quality yet.)<p>This video shows how cake can help programmers to create safe code just fixing warnings.<p><a href="https:&#x2F;&#x2F;youtu.be&#x2F;X5tmkF16UMQ" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;X5tmkF16UMQ</a><p>We copy paste code then we add pragma safety enable<p>This enables two features ownership and nullable checks. Ownership will check if the fclose is called for instance, also checks double free etc, while nullable checks will check for de-referencing null pointers.<p>New qualifiers _Opt and _Owner are used but they can be empty macros, allowing the same code to be compiled without cake.
AlbertoGPabout 1 year ago
That’s a very good example: realistic, very concise, and shows clearly how the annotations and checks work.