|
C has become one of the most mainstream of the development of language, more and more use of C language development tools, especially in some important areas, such as: vehicle control, aerospace fields. With the development of computer technology, the C language development tools in the field of aerospace has been widely used, not just ground, radar systems, such as aerospace, missile systems become more and more important. Since the efficiency and other characteristics of the C C must be more widely and more important applications. However, due to the complexity of the C language system, a software program developed using the C language, the inevitable with defects. So we need self-developed set of test tools to ensure that the software program safe and reliable operation. C static analyzer is part of the project, the development of C static analyzer, testers, developers can examine the code and found flaws in the code, to ensure the safety and reliability of the code. First of all, according to the \To the MISRA C: 2008, focus on describing the common C errors, according to an important extent, is divided into rules and recommendations. When authoring tool error to be distinguished. The C static checking rule 1.0 is a manual prepared by our own, as technology evolves, you can update the manual at any time, C static analyzer developed more in line with the field of aerospace. Secondly, C static analyzer as the basis for the development of open source compiler GCC. GCC is one of the most successful open source tools, Codes, strict. Use the GCC to ensure that the tools have a good cross-platform, and can be a large degree of assurance of the quality of software development. According to Rule 1.0 of the C static checking process, check the rules for classification, mainly divided into lexical analysis, syntax analysis, and semantic analysis process. This paper focuses on the the GCC C compiler process, the process of program logic and GCC symbol table. GCC proper use of the symbol table is the basis of the rule checking, symbol table lookup, the analysis is also key and difficult. Finally, the article focuses on the application of the rule checking GCC steps, methods, and specific implementation process as well as a simple test case. Test cases run, C static analyzer is correct and feasible, the application of this tool can detect defects in the source code.
|