arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2605.23490cs.SE
收藏

MISRust:将MISRA-C++编码指南映射到Rust编程语言

MISRust: Mapping MISRA-C++ Coding Guidelines to the Rust Programming Language

RWTH Aachen University(亚琛工业大学)

Marius Molz, Niels Schneider, Sven Lechner, Stefan Kowalewski, Alexandru Kampmann

AI总结:

本文系统地将179条MISRA C++ 2023编码指南映射到Rust,发现47.75%的适用规则由Rust语言设计自动执行,并区分安全与不安全Rust,提出69条仍需应用或调整的规则及Rust特定指南。

摘要:

Rust编程语言越来越多地被考虑用于安全关键系统的开发。然而,诸如ISO 26262等既定安全标准要求使用编码指南,而这些指南对于Rust尚不存在。本文系统地检查了179条MISRA C++ 2023编码指南中的每一条,并根据它们对Rust的适用性将其分为6类。我们的方法分析了每条MISRA规则背后的原理,以确定其在Rust编程上下文中是否仍然有效。我们发现,在111条按原样适用的MISRA规则中,47.75%由Rust的语言设计自动执行,从而无需显式的指南执行。此外,我们的分析明确区分了安全Rust和不安全Rust。我们发现69条指南仍然相关,并且仍然需要直接应用或为Rust进行调整。重要的是,其中36条规则在使用Rust语言的安全子集时自动满足。然而,如果引入不安全的Rust特性,这些规则将再次需要。我们还确定了需要新的Rust特定指南的具体领域。当指南无法直接转换时,我们提出了保留其意图的Rust特定调整。所有映射结果和支持工件均作为开源材料公开提供,网址为https://github.com/embedded-software-laboratory/MISRust。

英文摘要:

The Rust programming language is increasingly being considered for safety-critical system development. However, established safety standards such as ISO 26262 require the use of coding guidelines that do not yet exist for Rust. This paper systematically examines each of the 179 MISRA C++ 2023 coding guidelines and classifies them into 6 categories based on their applicability to Rust. Our approach analyzes the rationale behind each MISRA rule to determine whether it remains valid in the Rust programming context. We find that 47.75% of the 111 as-is applicable MISRA rules are automatically enforced by Rust's language design, eliminating the need for explicit guideline enforcement. Furthermore, our analysis explicitly distinguishes between safe and unsafe Rust. We find that 69 guidelines are still relevant and still require either direct application or adaptation for Rust. Importantly, 36 of these rules are automatically satisfied when only using the safe subset of the Rust language. However, they are required again if unsafe Rust features are introduced. We also identify specific areas where new Rust-specific guidelines are needed. Where a guideline does not directly translate, we propose Rust-specific adaptations that preserve its intent. All mapping results and supporting artifacts are publicly available as open-source materials at https://github.com/embedded-software-laboratory/MISRust.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑