MISRA C 2004 (C语言规则)_中文
MISRA C 2004 (C语言规则)_中文
MISRA C 2004 (C语言规则)
程序匠人 发表于 2008-5-23 14:46:00 阅读全文(90) | 回复(2) | 引用通告(0) | 编辑
MISRA C 2004
一、开发环境(Environment)
二、语言外延(Language Extensions)
三、注释(Documentation)
四、字符集(Character Sets)
五、标识符(Identifiers)
六、类型(Types)
七、常量(Constants)
八、声明和定义(Declarations and Definitions)
九、初始化(Initialisation)
十、算术类型转换(Arithmetic Type Conversion)
十一、指针类型转换(Point Type Conversion)
十二、表达式(Expressions)
十三、控制表达式(Control Statement Expressions)
十四、控制流(Control Flow)
十五、Switch语句(Switch Statements)
十六、函数(Functions)
十七、指针和数组(Pointers and Arrays)
十八、结构体和联合体(Structures and Unions)
十九、预处理命令(Preprocessing Directives)
二十、标准库(Standard Libraries)
二十一、运行失败(Run-Time Failures)
一、开发环境(Environment)
1.1 All code shall conform to ISO 9899:1990“Programming languages – C”, amended and corrected by ISO/IEC 9899/COR1:1995, ISO/IEC 9899/AMD1:1995, and ISO/IEC 9899/COR2:1996.
翻译:
1.2 No reliance shall be placed on undefined or unspecified behaviour.
翻译:
1.3 Multiple compilers and/or languages shall only be used if there is a common defined interface standard for object code to which the languages/compilers/assemblers conform.
翻译:
1.4 The compiler/linker shall be checked to ensure that 31 character significance and case sensitivity are supported for external identifiers.
翻译:
1.5 Floating-point implementations should comply with a defined floating-point standard.
翻译:
二、语言外延(Language Extensions)
2.1 Assembly language shall be encapsulated and isolated.
翻译:
2.2 Source code shall only use /* … */ style comments.
翻译:
2.3 The character sequence /* shall not be used within a comment.
翻译:
2.4 Sections of code should not be “commented out”.
翻译:
三、注释(Documentation)
3.1 All usage of implementation-defined behaviour shall be documented.
翻译:
3.2 The character set and the corresponding encoding shall be documented.
翻译:
3.3 The implementation of integer division in the chosen compiler should be determined, documented and taken into accoun