Project MetroWave General
Section SW Engineering
File Name 嵌入式软件编程规范
Document Number:
SW-00-00-0004
Revision: 0.9
Date: 2005-1-3
Process Owner: QA Team
Rev. Date ECO# Originated by History
0.9 2005-1-3 Yan An
根据 12-28 QA Team Review 整
理,从“编程参考”中分离出一篇较
为简短的“编程规范”。
将内部讨论得到的一篇短文《代码
质量定义》加入成为第 10 章。
1.0 2005-1-13 Zhao zhengfu
根据 2005-1-12 的 QA 扩大会议的
建议进行整理,增加了附录 B。
1 文档概述................................................................................................................................................................................3
1.1 关于本文档.....................................................................................................................................................................3
1.2 参考文献.........................................................................................................................................................................3
2 排版........................................................................................................................................................................................4
3 注释........................................................................................................................................................................................9
4 标识符命名..........................................................................................................................................................................18
5 可读性..................................................................................................................................................................................24
6 变量、结构..........................................................................................................................................................................25
7 宏..........................................................................................................................................................................................30
8 函数、过程..........................................................................................................................................................................32
9 可测性..................................................................................................................................................................................39
10 代码版本管理....................................................................................................................................................................42
10.1 代码质量定义.............................................................................................................................................................42
10.2 CVS 分支定义.............................................................................................................................................................42
10.3 CVS 代码引入规定.....................................................................................................................................................42
10.4 CVS 代码 COMMIT 顺序.............................................................................................................................................43
10.5 COMMIT 文件过程中的其他注意事项.......................................................................................................................43
11 附录 A – 推荐编辑器的默认配置修改.............................................................................................................................44
11.1 UNTRAEDIT 默认配置修改.........................................................................................................................................44
11.2 SOURCE-INSIGHT 默认配置修改.................................................................................................................................45
12 附录 B– PC-LINT 的使用简介.........................................................................................................................................46
12.1 PC-LINT 的软件包说明............................................................................................................................................46
12.2 PC-LINT 的使用步骤.................................................................................................................................................46
12.3 PC-LINT 的使用规则(BY FUJILI)..............................................................................................................................47
Copyright @2005 Photonic Bridges Inc. (Company Confidential) Page 2 of 47