国防科学技术大学研究生院工程硕士学位论文
摘要
航天嵌入式软件要求具有很高的可信性,这类软件中有大量用 C 语言编写的
程序,C 语言虽然灵活,但也存在很多容易导致安全问题的使用方式,进而影响到
航天嵌入式软件的可信性。因此,国内航天界制定了《航天器软件 C 语言编程规
范》,它是基于 C89 国际标准、MISRA-C 2004 和《GJB C 语言编程规则》制定的
航天 C 语言安全规则集,已经成为国内航天领域的 C 语言编程标准。虽然已经有
一些工具可以支持《航天器软件 C 语言编程规范》的检查,但还不够充分,还存
在漏洞,部分规则没有检查出来。因此,研究航天 C 程序的安全规则检查技术具
有重要的现实意义。
本文完成的工作主要有:
首先,对国内外 C 程序安全规则集及检查工具进行了分析比较;分析了 GCC
编译器的编译流程及其前端词法分析、语法语义分析的主要数据结构和工作过程。
其次,在上述工作的基础上,采用对 GCC 编译器前端进行扩展的思路,提出
了对《航天器软件 C 语言编程规范》中的部分编程规则进行检查的方法,通过对
GCC 的 C 语言前端的预处理程序、词法分析程序、语法语义分析程序进行修改和
扩充,实现了 C 语言编程规范检查工具 SC-RuleChecker。
最后,对 SC-RuleChecker 进行了系统测试和实际应用,结果表明,
SC-RuleChecker 实现了规则检查的功能,与现有的商业工具相比,本工具可以发
现其它工具不能检测出来的部分规则违反情况,有助于降低航天软件中的潜在风
险、提高软件可信性。
主题词:编程规则静态分析编译器航天器软件 C 语言编程规范
第 i 页
国防科学技术大学研究生院工程硕士学位论文
ABSTRACT
The embedded softwares of spaceflight need to be highly reliable. In these
softwares, there are a large number of programs written by C language. The using of C
language is very flexible, but many manners in using C language can lead to secure
problems which may impact on the reliability of the embedded softwares of spaceflight.
Therefore, anizations related to spaceflight have presented a C language
programming specification for spacecraft software, which is based on C89 standard,
MISRA-C 2004 and GJB C language programming rules. It has e the defacto C
language programming standard for developing spacecraft software in our country.
There are some tools to support the C language programming specification for
spacecraft software, but it is not enough. There are loopholes exist. And some rules
cannot be checked. So it’s very significant to study the technique of checking safety
rules of aero C programs. The main work of the paper can be concluded as follows:
Firstly, the C programs safety rules and corresponding checking tools are analyzed
and summarized. The structure of piler is described. The principal process
phrases, especially the syntax analysis phrase are illus
黄土地区大直径超长群桩室内模型试验研究 来自淘豆网m.daumloan.com转载请标明出处.