BARR-C:2018和MISRA C:2012:两个最广泛使用的C编码标准之间的协同作用
BARR-C:2018 and MISRA C:2012: Synergy Between the Two Most Widely Used C Coding Standards
摘要:
Barr Group的嵌入式C编码标准(BARR-C:2018,源于2009年Netrino的嵌入式C编码标准)是嵌入式系统行业使用的编码标准,仅次于MISRA C。然而,在MISRA C:2012和BARR-C:2018之间做出选择并不困难,因为它们在两种完全不同的方式上是互补的。一方面,BARR-C:2018删除了上一版本(BARR-C:2013)中存在的与MISRA C:2012相关的所有不兼容性。因此,无论编程风格如何,BARR-C:2018定义了一个C子集,在防止大量编程错误的同时,它比MISRA C:2012定义的子集更大。另一方面,关于编程风格,MISRA C将此留给各个组织,而BARR-C:2018定义了一种编程风格,主要旨在最大限度地减少编程错误。因此,BARR-C:2018可以被视为适用于所有类型项目的C语言子集的第一个非常有用的步骤;关键项目可以在保持BARR-C编程风格的同时顺利地向MISRA C:2012兼容性发展。本文介绍了BARR-C:2018,描述了它与MISRA C:2012的关系,并讨论了两种编码标准的并行和串行采用。
英文摘要:
The Barr Group's Embedded C Coding Standard (BARR-C:2018, which originates from the 2009 Netrino's Embedded C Coding Standard) is, for coding standards used by the embedded system industry, second only in popularity to MISRA C. However, the choice between MISRA C:2012 and BARR-C:2018 needs not be a hard decision since they are complementary in two quite different ways. On the one hand, BARR-C:2018 has removed all the incompatibilities with respect to MISRA C:2012 that were present in the previous edition (BARR-C:2013). As a result, disregarding programming style, BARR-C:2018 defines a subset of C that, while preventing a significant number of programming errors, is larger than the one defined by MISRA C:2012. On the other hand, concerning programming style, whereas MISRA C leaves this to individual organizations, BARR-C:2018 defines a programming style aimed primarily at minimizing programming errors. As a result, BARR-C:2018 can be seen as a first, dramatically useful step to C language subsetting that is suitable for all kinds of projects; critical projects can then evolve toward MISRA C:2012 compliance smoothly while maintaining the BARR-C programming style. In this paper, we introduce BARR-C:2018, we describe its relationship with MISRA C:2012, and we discuss the parallel and serial adoption of the two coding standards.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。