安全第一的C语言编程规范(国外英文资料)
安全第一的C语言编程规范(国外英文资料)
"Safety first" C language programming specification
Authors: Chen Mengmeng, Shao Beibei, Tsinghua University
Source: microcontroller and embedded systems applications, 2006-4-6, 17:44:18
Editor's note: C language is the main tool for embedded application development, but the C language is not specifically for the design of embedded system, embedded system is much more general computer systems have more stringent requirements on software security. In 1998, MISRA pointed out that there were 127 places where C seemed acceptable, but there were security risks. In 2004, MISRA's limit on C increased to 141.
The application of embedded system engineers use computer experts created by the C language, the application of embedded system has been developing rapidly, and MISRAC is the application of embedded system engineers make C language for embedded applications with. Nowadays, MISRA C has been accepted by more and more enterprises, and becomes the C language standard for embedded systems, especially for embedded systems with high security requirements. The software should conform to the MISRA standard.
From this period begin, this print will be divided into 6 period, learn with reader jointly MISRAC.
First, the C programming specification for "safety first", a brief overview of MISRAC is given.
Second, "the pitfalls of data typing" introduces the specification of data definitions and methods of operation, focusing on the problem of implicit data type conversions.
Lecture 3: "safety norms for pointers, structures and unions" to analyze how to apply pointers, structures and unions safely and efficiently.
Fourth, "prevent the uncontrolled expression". Analyze the bad usage habits of expressions, functions, declarations and definitions in MISRAC, so as to minimize all kinds of potential errors.
Fifth, "accurate program flow control" describes the standard practices for controlling expressions and program flow control in the C language.
Sixth, "build a secu