Get the latest tech news

Contracts for C


C++ seems to finally converge with their contracts proposal, I decided to give it a try and come up with ideas how such a thing would look for C. This is in early stages, not a full proposal yet, a…

I decided to give it a try and come up with ideas how such a thing would look for C. This is in early stages, not a full proposal yet, and still would need implementation by some of the major compilers. An implementation with current tools of that function that takes these conditions into account, but doesn’t reflect them in the declaration part could look as follows defer together with defer_return_value to ease the expression of postconditions typeof to ease the forward declaration of functions with the same prototype abort to have a defined strategy for termination unreachable to express assumptions through control flow inline to place conditions into the vision of every user of a function

Get the Android app

Or read this on Hacker News

Read more on:

Photo of contracts

contracts

Photo of early stages

early stages

Related news:

News photo

OpenAI, Google and Anthropic Win US Approval for Civilian AI Contracts

News photo

Pentagon Awards Up to $200 Million in Contracts to xAI, OpenAI

News photo

Scoop: Trump admin cuts contracts with scientific publishing giant