Explore chapters and articles related to this topic
The Value Stream–Choosing Programming Languages and Tools
Published in Peter Middleton, James Sutton, Lean Software Strategies, 2020
For instance, the C language has been subsetted by MISRA (Motor Industry Software Reliability Association).12 MISRA C reduces or constrains the use of the most problematic or contradictory parts of C, including pointers, structures, and conversions, though it is does not enforce such restrictions the way Ada does. It is about as good as C gets: “We all need reliable software and not just in cars. . . . Given the cost and clarity of the standard there is little excuse for not using it as a guide on all embedded C. Come to that any C, embedded or not.”13
Code Coverage Metrics
Published in Chris Hobbs, Embedded Software Development for Safety-Critical Systems, 2019
A default clause has been included in the switch statement, even though the case clauses are exhaustive. This is good defensive coding, protecting against a programmer adding an extra color to the enum later and forgetting to update this switch statement. It is, indeed, required by the 2012 MISRA-CMISRA standard. However, the default clause can never be reached during testing.
Code Coverage Metrics
Published in Chris Hobbs, Embedded Software Development for Safety-Critical Systems, 2017
A default clause has been included in the switch statement, even though the case clauses are exhaustive. This is good defensive coding, protecting against a programmer adding an extra color to the enumlater and forgetting to update this switch statement. It is, indeed, required by the 2012 MISRA-C standard. However, the default clause can never be reached during testing.
A GCC-based checker for compliance with MISRA-C's single-translation-unit rules
Published in Connection Science, 2023
Chih-Yuan Chen, Yung-An Fang, Guan-Ren Wang, Peng-Sheng Chen
The key contributions of this paper are summarised as follows. A static checker for MISRA-C single-translation-unit rules. It modifies the GCC preprocessor and front end to allow checking of MIS-RA-C' single-translation-unit rules. The source code is available on GitHub: https://github.com/CCU-HPCLAB/GCC-MISRAC-Checker.GCC implementation and experience. Detailed description of the implementation and experience demonstrates tracing the GCC preprocessor and front end to find program points that require modification.Experiment. The modified compiler is evaluated using the selected benchmark programs. The results show that the proposed GCC can correctly detect compliance using MISRA-C's single-translation-unit rules. We also compare the results from the proposed GCC and Cppcheck, demonstrating its ability to detect more rules and display the analyzed information more accurately than Cppcheck.