|
|
Log in / Subscribe / Register

MISRA C is not provably safe.

MISRA C is not provably safe.

Posted Nov 20, 2025 12:10 UTC (Thu) by khim (subscriber, #9252)
In reply to: MISRA C is not provably safe. by tialaramex
Parent article: Rust in Android: move fast and fix things (Google Security Blog)

> You can write this out in C but C compilers will ignore your intent.

C compiler would, but there are other programs that wouldn't. It's the same story as Ada and SPARK, Rust and mrustc, etc.

The big question is whether full-blown checker for MISRA C exists or may even theoretically exist. PVS-Studio claims 80% coverage.

> they're always exactly 4096 bytes long (no, I don't handle huge pages)

What about 16KiB pages? MacOS uses them and Android moves there, too.

> but to a considerable extent it's functioning as a Brown M&M check, it's not a proof of anything

You can as well only use Rust with mrustc and claim that all these lifetime markups are just a wishful thinking. The big question about MISRA C is how much enforcement can be done automatically with existing tools, not whether C decays pointers. Sure, it decays them but for the MISRA C it's not a problem if you have an external checker.


The LWN site is currently under high scraper load, so comment display has been suppressed for anonymous users. If you are a human, you may read the comments by clicking the button below:

Note: you can avoid this step in the future by logging into your LWN account.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds