Use Agentic AI to generate smarter API tests. In minutes. Learn how >>
Jump to Section
How MISRA C 2025 Is Tackling AI & Rust Challenges
Explore the key updates in MISRA C 2025, the role of AI in code generation, the growing popularity of Rust, and how these changes impact developers and organizations.
Jump to Section
Jump to Section
MISRA C guidelines have set the benchmark for safety, security, and reliability in embedded systems for decades. This is especially true for industries like automotive, aerospace, medical devices, and industrial automation. With the release of MISRA C 2025, the coding guidelines continue to evolve, addressing modern challenges such as AI-generated code and the growing interest in Rust as an alternative to C/C++.
MISRA C 2025 Incremental Updates With Practical Improvements
MISRA C 2025 is an incremental refinement of MISRA C 2023. The key changes aim to improve safety and developer experience.
New Rules & Modifications
The guidelines include four new rules that address emerging coding risks.
- Disallowing implicit comparison of pointers to null.
- Restricting the use of inactive union members except for character arrays, which are allowed for aliasing reads.
- Ensuring unique include guard macro identifiers across a project.
- Strengthening requirements for pointer-to-integer conversions, for example, Rule 11.4 is now required instead of advisory.
Modified Rules
Two rules were incorporated into other rules. As a result, they were deleted as a part of the rule organization refactoring. Additionally, the controversial advisory rule requiring a single exit point in functions, which seemingly disappeared, became optional.
Three rules were renumbered for better organization and thirteen rules were modified to reflect current best practices and clarify ambiguities.
More About the Single-Exit Rule Disappearance
The single-exit rule has been a MISRA staple for decades. Historically tied to older modular programming practices, the change to make it optional acknowledges modern structured programming practices and reflects MISRA’s shift toward practicality without compromising safety.
This rule originated from assembly programming, where jumps could happen anywhere. But in modern structured languages like C, every return safely exits to the caller. Some organizations still enforce it, so the MISRA working group kept it—but now it’s optional.
Loosened Restrictions for Developer Flexibility
MISRA C 2025 also introduced more flexibility for developers in the following areas.
- Switch statements. Clauses can now be terminated with statements other than `break` (for example, `return`, `abort,` or `continue`), reducing the need for unreachable code.
- Pointer conversions. Exceptions were added for conversions involving `intptr_t` and `uintptr_t`, aligning with standard allowances.
- Dynamic memory. Immediate conversion of newly allocated memory to a specific pointer type is now permitted. However, dynamic memory use is still discouraged.
AI-Generated Code & MISRA Compliance
How do MISRA guidelines apply to AI-generated code? It’s a pressing question in software development.
AI-Generated Code Is Not the Same as Qualifiable Auto-Generated Code
MISRA traditionally provides leniency for auto-generated code, for example, code generated by Simulink or Stateflow. MISRA has a long history of accommodating it with certain advisory rules—reclassifying it as “disapplied” to ease compliance.
On the other hand, MISRA holds AI-generated code from LLMs, like GitHub Copilot, to the same standards as human-written code. The MISRA committee emphasizes that AI code lacks the deterministic guarantees of model-based generators, meaning that it may introduce unpredictable risks and needs extra scrutiny. With that, it requires static analysis, peer reviews, and unit testing. In fact, these testing methods are mandatory.
AI-Assisted Remediation
AI can aid in fixing MISRA violations. Solutions like Parasoft C/C++test integrate with GitHub Copilot and add contextual guidance, embedding rule documentation and using chain-of-thought reasoning to generate compliant fixes.
In short, Parasoft’s static analysis solution integrate AI, bridging it with compliance to do the following:
- Explain violations in context.
- Suggest compliant fixes for issues like pointer misuse, for one example.
- Auto-suppress legacy rule violations when migrating to MISRA C 2025.
Developers still need to review AI suggestions, but the process accelerates remediation while maintaining compliance.
Expanding MISRA’s Reach
MISRA published two new addenda beyond the core guidelines.
- Addendum 5 maps MISRA C guidelines to CWE weaknesses tagged as being relevant to memory safety—helping developers address vulnerabilities systematically.
- Addendum 6 assesses the applicability of MISRA C guidelines to Rust, identifying potential safety concerns. This is a foundational step toward future Rust-specific guidelines.
The Rust Question: Is MISRA Expanding Beyond C/C++?
With the Rust programming language gaining traction in safety-critical systems, many wonder if MISRA will develop guidelines for it.
While addendum 6 explores how existing C/C++ rules could map to Rust, its ownership model and memory safety features require new language-specific rules. The Rust community is actively working on safety standards, potentially leading to a future MISRA Rust guideline.
Key Takeaways for Developers
MISRA C 2025 refines the standard with updates that prioritize practicality without compromising safety. Here are some important points.
- AI-generated code requires scrutiny. Treat it like human-written code and enforce full compliance.
- Tooling is critical. Solutions like Parasoft C/C++test streamline compliance with AI-assisted fixes and seamless integration into workflows.
- Stay up to date. MISRA’s new mappings for CWE and Rust show the standard’s evolving role in modern software safety.
Conclusion: Safety in the Age of AI & New Languages
MISRA C 2025 demonstrates how safety standards must evolve alongside technology. By addressing AI-generated code, reconsidering outdated rules, and exploring Rust compatibility, MISRA ensures it remains a trusted framework for mission-critical software.
For developers, it’s clear: automation and AI can aid coding, but human oversight and robust testing remain indispensable. As the industry moves forward, staying informed and adaptable will be crucial in maintaining both innovation and safety.
Find & Fix C/C++ Code Violations Faster With AI-Powered Static Analysis