java switch unreachable,MISRA C 2004 (C语言规则)

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 account.

翻译:

3.4 All uses of the #pragma directive shall be documented and explained.

翻译:

3.5 If it is being relied upon, the implementation defined behaviour and packing of bitfields shall be documented.

翻译:

3.6 All libraries used in production code shall be written to comply with the provisions of this document, and shall have been subject to appropriate validation.

翻译:

四、字符集(Character Sets)

4.1 Only those escape sequences that are defined in the ISO C standard shall be used.

翻译:

4.2 Trigraphs shall not be used.

翻译:

五、标识符(Identifiers)

5.1 Identifiers (internal and external) shall not rely on the significance of more than 31 characters.

翻译:

5.2 Identifiers in an inner scope shall not use the same name as an identifier in an outer scope, and therefore hide that identifier.

翻译:

5.3 A typedef name shall be a unique identifier.

翻译:

5.4 A tag name shall be a unique identifier.

翻译:

5.5 No object or function identifier with static storage duration should be reused.

翻译:

5.6 No identifier in one name space should have the same spelling as an identifier in another name space, with the exception of structure and union member names.

翻译:

5.7 No identifier name should be reused.

翻译:

六、类型(Types)

6.1 The plain char type shall be used only for the storage and use of chara

你可能感兴趣的:(java,switch,unreachable)