Hacker News new | past | comments | ask | show | jobs | submit login

What you want is being researched as CheckedC.

https://www.microsoft.com/en-us/research/project/checked-c/

Microsoft's SAL introduced with their major security rewrite in XP, provides the annotations you mention.

https://docs.microsoft.com/en-us/previous-versions/visualstu...

https://msdn.microsoft.com/en-us/library/windows/desktop/cc3...

But it all boils down to C developers actually caring about using them.




If I understand it correctly CheckedC woods as an extension to the language, so you need CheckedC compiler to actually use it.

I agree that SAL fits my description. Is it available outside of Windows? I've seen that someone wanted to add SAL support to clang [0], but decided against, because of Microsoft's patent on the thing [1]. Or than that it looks cool. Thanks for the pointer.

[0] http://clang-developers.42468.n3.nabble.com/RFC-Starting-sup...

[1] https://patents.google.com/patent/US20050076331A1/en?q=Sourc...


Actually gcc does have something similar to SAL with FORTIFY_SOURCE, but it is not as feature rich.

https://access.redhat.com/blogs/766093/posts/1976213




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: