Analyzing Compliance with Safety Standards in C Code via Large Language Models

Ensuring code compliance with safety standards such as MISRA C:2012 is essential for the development of reliable and secure embedded systems in domains like automotive software. Traditional compliance checks rely on rule-based static analyzers, but recent advances in large language models (LLMs) suggest potential for automating such tasks. This paper investigates the zero-shot capabilities of four general-purpose LLMs, such as GPT-4o, LLaMA 3.1, O3-mini, and Mixtral, in identifying violations of 20 undecidable MISRA C:2012 rules. We build a private dataset annotated for MISRA compliance, used to evaluate LLMs under zero-shot prompting. While the data cannot be released, the methodology is generalizable and applicable to public codebases. Our findings show that while LLMs can correctly classify simple rule violations, they struggle with context-dependent rules. No single model excels across all categories, highlighting the need for rule-specific prompting strategies, multi-agent architectures or fine-tuning. These insights pave the way for more effective LLM-driven compliance tools tailored to high-assurance software development.

Authors

Institutions

Publication Details

Published
2025-09-15
DOI
https://doi.org/10.1109/elmar66948.2025.11194021
Primary Topic
Safety Systems Engineering in Autonomy
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Analyzing Compliance with Safety Standards in C Code via Large Language Models

Alexandru Guzu, Georgian Nicolae, Dorin Nuţeanu
Safety Systems Engineering in Autonomy
article

Analyzing Compliance with Safety Standards in C Code via Large Language Models

Alexandru Guzu, Georgian Nicolae, Dorin Nuţeanu
article en

Abstract

Ensuring code compliance with safety standards such as MISRA C:2012 is essential for the development of reliable and secure embedded systems in domains like automotive software. Traditional compliance checks rely on rule-based static analyzers, but recent advances in large language models (LLMs) suggest potential for automating such tasks. This paper investigates the zero-shot capabilities of four general-purpose LLMs, such as GPT-4o, LLaMA 3.1, O3-mini, and Mixtral, in identifying violations of 20 undecidable MISRA C:2012 rules. We build a private dataset annotated for MISRA compliance, used to evaluate LLMs under zero-shot prompting. While the data cannot be released, the methodology is generalizable and applicable to public codebases. Our findings show that while LLMs can correctly classify simple rule violations, they struggle with context-dependent rules. No single model excels across all categories, highlighting the need for rule-specific prompting strategies, multi-agent architectures or fine-tuning. These insights pave the way for more effective LLM-driven compliance tools tailored to high-assurance software development.

Universitatea Națională de Știință și Tehnologie Politehnica București (RO)
Openalex Percentile: Top 64%
Safety Systems Engineering in Autonomy
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Analyzing Compliance with Safety Standards in C Code via Large Language Models — Alexandru Guzu, Georgian Nicolae, et al. · (2025) | TGRS Research Map | TGRS