1,930
Views
0
CrossRef citations to date
0
Altmetric
Research Article

A GCC-based checker for compliance with MISRA-C's single-translation-unit rules

, , &
Article: 2222934 | Received 02 Jan 2023, Accepted 03 Jun 2023, Published online: 16 Jun 2023
 

Abstract

MISRA-C is a writing specification for the C programming language defined by the Motor Industry Software Reliability Association (MISRA). It establishes a set of rules to enhance the development of software that is safe, reliable, and portable. MISRA-C is widely adopted by industries such as aerospace, defense and security, telecommunications, and medical device manufacturers. We developed a static detector of code's compliance with MISRA-C's single-translation-unit rules. The code checker is based on the GNU Compiler Collection (GCC). This paper describes the strategies underlying the detector's design and implementation. For the tested benchmarks, the proposed checker is demonstrated to correctly assess compliance with or violation of all single-translation-unit rules. It can also obtain more accurate and more complete results than Cppcheck, a popular open-source checker. The source code can be downloaded from https://github.com/CCU-HPCLAB/GCC-MISRAC-Checker.

Disclosure statement

No potential conflict of interest was reported by the author(s).

Additional information

Funding

This work was supported by Ministry of Science and Technology, Taiwan[MOST 110-2221-E-194-019-MY3].