在好例子网,分享、交流、成长!
您当前所在位置:首页Others 开发实例Clojure → Misrac 2004/2008/2012详解实例文档

Misrac 2004/2008/2012详解实例文档

Clojure

下载此实例
  • 开发语言:Others
  • 实例大小:0.62M
  • 下载次数:5
  • 浏览次数:163
  • 发布时间:2022-04-07
  • 实例类别:Clojure
  • 发 布 人:jette
  • 文件格式:.7z
  • 所需积分:2
 相关标签: 2012 2008 2004 200 008

实例介绍

【实例简介】分别针对2004, 2008C , 2012三个标准逐条分类给出了实例演示和说明,

【实例截图】

from clipboard


【核心代码】


[MISRA2004-2_1] 汇编代码应该是封装且独立的 [MISRA2004-2_1]
[MISRA2004-2_2] 源代码只能使用 /* ... */ 来注释 [MISRA2004-2_2]
[MISRA2004-2_3] 禁止在 C 语言风格的注释中使用 /* 字符序列 [MISRA2004-2_3]
[MISRA2004-2_4] 代码段不应该被“注释掉” [MISRA2004-2_4]
[MISRA2004-3_4] 使用 #pragma 语句必须进行说明 [MISRA2004-3_4]
[MISRA2004-3_5] 不要把位域和其他数据混合在同一个结构体里 [MISRA2004-3_5]
[MISRA2004-4_1] 应只使用 ISO C 标准中定义的转义字符 [MISRA2004-4_1]
[MISRA2004-4_2] 禁止使用三字母词 [MISRA2004-4_2]
[MISRA2004-5_1] 标识符的长度不能超过 31 个字符 [MISRA2004-5_1]
[MISRA2004-5_2_a] 在局部或者函数原型体范围内声明的标识符不应该隐藏一个在全局或者命名空间范围内声明的标识符 [MISRA2004-5_2_a]
[MISRA2004-5_2_b] 在内层的局部范围内声明的标识符不应该隐藏在外层的局部范围内声明的标识符 [MISRA2004-5_2_b]
[MISRA2004-5_3_a] 不能重用 typedef 名称 [MISRA2004-5_3_a]
[MISRA2004-5_3_b] 不能将 typedef 的名称重用在另一个 typedef 名称 [MISRA2004-5_3_b]
[MISRA2004-5_4_a] 在程序中标记(tag)的名称不得重用于其它目的 [MISRA2004-5_4_a]
[MISRA2004-5_4_b] 标记(tag)的名称不得被重用于定义一个不同的标号 [MISRA2004-5_4_b]
[MISRA2004-5_4_c] typedef 的名称不应该与 typdef 指定的类型名称相同 [MISRA2004-5_4_c]
[MISRA2004-5_5_a] 禁止重用静态存储周期的对象或函数的标识符 [MISRA2004-5_5_a]
[MISRA2004-5_5_b] 禁止重用静态存储周期的对象或函数的标识符 [MISRA2004-5_5_b]
[MISRA2004-5_6] 除结构和联合成员名字外,一个命名空间内的标识符不能与另一个命名空间里面的标识符重名 [MISRA2004-5_6]
[MISRA2004-5_7] 禁止重用标识符名称 [MISRA2004-5_7]
[MISRA2004-6_1] 普通字符(plain char)类型只能用于存储和使用字符值 [MISRA2004-6_1]
[MISRA2004-6_2] 带符号的 char 和 不带符号的 char 类型只能用于存储和数值类型 [MISRA2004-6_2]
[MISRA2004-6_3] 用 typedef 定义基本类型应该在名称中包含数字 [MISRA2004-6_3]
[MISRA2004-6_3_b] typedefs 应该被用于替代基本类型 [MISRA2004-6_3_b]
[MISRA2004-6_4] 只能将位域定义为有符号的整型或无符号的整型 [MISRA2004-6_4]
[MISRA2004-6_5] 具有带符号的整数类型且已命名的位域应该有超过一位的长度 [MISRA2004-6_5]
[MISRA2004-6_5_a] signed整数型的未命名位域的长度应大于1bit [MISRA2004-6_5_a]
[MISRA2004-7_1_a] 不应该使用八进制常数(除零外) [MISRA2004-7_1_a]
[MISRA2004-7_1_b] 八进制转义序列不应该被使用 [MISRA2004-7_1_b]
[MISRA2004-8_10] 具有外部链接的对象或函数应该在头文件中声明 [MISRA2004-8_10]
[MISRA2004-8_11] 静态存储类说明符应该用于具有内部链接的对象和函数的定义和声明 [MISRA2004-8_11]
[MISRA2004-8_12] 当数组声明具有外部链接,其大小应该显式地说明或者在初始化时隐性地定义 [MISRA2004-8_12]
[MISRA2004-8_1_a] 函数应该有函数原型并且该原型应该对函数定义和调用可见 [MISRA2004-8_1_a]
[MISRA2004-8_1_b] 在函数调用时,函数总是有可见的原型 [MISRA2004-8_1_b]
[MISRA2004-8_2_a] 声明或定义某个函数时,必须显式地规定其类型 [MISRA2004-8_2_a]
[MISRA2004-8_2_b] 声明或定义某个对象时,必须显式地规定其类型 [MISRA2004-8_2_b]
[MISRA2004-8_3_a] 在声明和定义中使用相同的类型 [MISRA2004-8_3_a]
[MISRA2004-8_3_b] 函数的声明与原型的类型必须一致 [MISRA2004-8_3_b]
[MISRA2004-8_4] 如果对象或者函数被声明了一次以上,那么他们的类型应该是兼容的 [MISRA2004-8_4]
[MISRA2004-8_5] 在头文件中不应定义函数和对象 [MISRA2004-8_5]
[MISRA2004-8_6] 在文件的范围内声明函数 [MISRA2004-8_6]
[MISRA2004-8_7] 如果对象只在一个单独的函数中访问那么应定义其在代码块范围 [MISRA2004-8_7]
[MISRA2004-9_1] 所有自动变量在使用之前都必须被赋值 [MISRA2004-9_1]
[MISRA2004-9_2] 聚合体和共同体的初始化对象应该用大括号括起来 [MISRA2004-9_2]
[MISRA2004-9_2_b] 数组不应该部分初始化 [MISRA2004-9_2_b]
[MISRA2004-9_2_c] 结构的非零初始化要求每个元素都有显示初始化器 [MISRA2004-9_2_c]
[MISRA2004-9_3] 在枚举类型中,要么仅对第一个元素进行显式地初始化,要么所有元素都进行显式的初始化 [MISRA2004-9_3]
[MISRA2004-10_1_a] 避免无符号整型和有符号整型之间隐式地转换 [MISRA2004-10_1_a]
[MISRA2004-10_1_b] 不存在从整型到浮点型的隐式转换 [MISRA2004-10_1_b]
[MISRA2004-10_1_c] 避免隐式的复合表达式的数据类型转换 [MISRA2004-10_1_c]
[MISRA2004-10_1_d] 避免从更宽到更窄的类型的隐式转换 [MISRA2004-10_1_d]
[MISRA2004-10_1_e] 避免隐式的函数返回表达式类型转换 [MISRA2004-10_1_e]
[MISRA2004-10_1_f] 避免隐式的复合表达式的类型转换 [MISRA2004-10_1_f]
[MISRA2004-10_1_g] 避免函数参数进行隐式地类型转换 [MISRA2004-10_1_g]
[MISRA2004-10_1_h] 避免隐式的无符号整型和有符号整型的转换 [MISRA2004-10_1_h]
[MISRA2004-10_1_i] 避免隐式的复合表达式的数据类型转换 [MISRA2004-10_1_i]
[MISRA2004-10_2_a] 避免从浮点类型到整型的隐式转换 [MISRA2004-10_2_a]
[MISRA2004-10_2_b] 避免宽字段到窄字段浮点型数据的隐式转换 [MISRA2004-10_2_b]
[MISRA2004-10_2_c] 避免隐式的窄字段到宽字段浮点型数据转换 [MISRA2004-10_2_c]
[MISRA2004-10_2_d] 避免将浮点数从较宽的浮点类型隐式转换为较窄的浮点类型 [MISRA2004-10_2_d]
[MISRA2004-10_3] 整型复合表达式的值只能被强制转换到较短的类型,或者与该表达式类型相同的有符号类型 [MISRA2004-10_3]
[MISRA2004-10_4] 浮点类型的复杂表达式的值只能转换为精度较低的浮点类型 [MISRA2004-10_4]
[MISRA2004-10_5] 如果对无符号字符型或无符号短整型进行 ~ 和 << 位运算后,其结果应立即强制转换成操作数的基本类型 [MISRA2004-10_5]
[MISRA2004-10_6] 无符号类型的所有常量应该使用 'U' 后缀 [MISRA2004-10_6]
[MISRA2004-11_1] 除了整数类型外不允许其他类型和函数指针进行类型转换 [MISRA2004-11_1]
[MISRA2004-11_2] 对象指针只能被转换成整数类型,与对象同类型的指针和 void 指针 [MISRA2004-11_2]
[MISRA2004-11_2_b] 对象指针只能被转换成整数类型,与对象同类型的指针和 void 指针 [MISRA2004-11_2_b]
[MISRA2004-11_2_c] 对象指针只能被转换成整数类型,与对象同类型的指针和 void 指针 [MISRA2004-11_2_c]
[MISRA2004-11_3_a] 不允许指针类型和整数类型之间进行类型转换 [MISRA2004-11_3_a]
[MISRA2004-11_3_b] 禁止将其它类型变量强制转换成指针变量 [MISRA2004-11_3_b]
[MISRA2004-11_4] 不应在指向对象类型的指针和指向对象类型的其他指针之间执行强制转换 [MISRA2004-11_4]
[MISRA2004-11_5] 强制转换不得从指针或引用类型中删除任何“const”或“volatile”限定条件 [MISRA2004-11_5]
[MISRA2004-12_10] 不应该使用逗号运算符 [MISRA2004-12_10]
[MISRA2004-12_12] 禁止对浮点数值进行位操作 [MISRA2004-12_12]
[MISRA2004-12_13] 禁止在同一个表达式中混合使用递加符 ( ) 和递减符 (--) 与其他运算符 [MISRA2004-12_13]
[MISRA2004-12_1_a] 谨慎使用 C 语言中表达式的优先运算规则 [MISRA2004-12_1_a]
[MISRA2004-12_1_b] 谨慎使用 C 语言中表达式的优先运算规则 [MISRA2004-12_1_b]
[MISRA2004-12_1_c] 一元运算符的操作数不需要括号 [MISRA2004-12_1_c]
[MISRA2004-12_1_d] 谨慎使用 C 语言中表达式的优先运算规则 [MISRA2004-12_1_d]
[MISRA2004-12_1_e] 除非表达式中的所有运算符都相同,否则使用圆括号 [MISRA2004-12_1_e]
[MISRA2004-12_1_f] 谨慎使用 C 语言中表达式的优先运算规则 [MISRA2004-12_1_f]
[MISRA2004-12_2_a] 表达式的值应该在任何标准允许的赋值顺序下是一样的 [MISRA2004-12_2_a]
[MISRA2004-12_2_b] 不要编写依赖于函数参数求值顺序的代码 [MISRA2004-12_2_b]
[MISRA2004-12_2_c] 不要编写依赖于函数标志符和函数参数的求值顺序的代码 [MISRA2004-12_2_c]
[MISRA2004-12_2_d] 涉及一个函数调用时,不要编写依赖表达式求值顺序的代码 [MISRA2004-12_2_d]
[MISRA2004-12_2_e] 在序列点之间,对象的存储值最多只能通过表达式的计算来修改一次 [MISRA2004-12_2_e]
[MISRA2004-12_2_f] 不要在两个相邻的序列点之间使用多个 volatile [MISRA2004-12_2_f]
[MISRA2004-12_2_g] 不要编写依赖于函数调用求值顺序的代码 [MISRA2004-12_2_g]
[MISRA2004-12_3] sizeof运算符的操作数不应包含任何有副作用的表达式 [MISRA2004-12_3]
[MISRA2004-12_3_b] 不应在sizeof运算符的操作数中访问由volatile左值指定的对象 [MISRA2004-12_3_b]
[MISRA2004-12_3_c] 会导致副作用的函数调用不应该用作 sizeof 运算符的操作数 [MISRA2004-12_3_c]
[MISRA2004-12_4_a] 逻辑&&或||运算符的右操作数不得含有副作用 [MISRA2004-12_4_a]
[MISRA2004-12_5] 逻辑运算符 && 或者 || 的操作数应该是基本表达式 [MISRA2004-12_5]
[MISRA2004-12_6_a] 逻辑运算符 (&&"," || 和 !) 的操作数应该是有效的布尔值 [MISRA2004-12_6_a]
[MISRA2004-12_6_b] 有效布尔值的表达式不应该用作除 (&&", ||, !, =, ==, !=," ?:) 之外的运算符的操作数。 [MISRA2004-12_6_b]
[MISRA2004-12_7] 禁止对有符号类型使用位操作 [MISRA2004-12_7]
[MISRA2004-12_8] 一个移位操作符的右操作数应该位于 0 到 1 之间,小于左操作数底层类型的位宽 [MISRA2004-12_8]
[MISRA2004-12_9] 一元减法运算符不得适用于其原始类型是无符号型的表达式 [MISRA2004-12_9]
[MISRA2004-13_1] 禁止在产生布尔值的表达式中使用赋值运算符 [MISRA2004-13_1]
[MISRA2004-13_2] 测试一个值是否为零应该是显式的,除非操作数实际上是布尔值 [MISRA2004-13_2]
[MISRA2004-13_3] 禁止对浮点数类型的表达式做相等或不相等的比较 [MISRA2004-13_3]
[MISRA2004-13_4] for 循环语句中的控制表达式不能包含浮点类型对象 [MISRA2004-13_4]
[MISRA2004-13_5] for 循环语句的三个表达式应该仅与循环控制相关 [MISRA2004-13_5]
[MISRA2004-13_6] 禁止在循环体中修改循环计数器 [MISRA2004-13_6]
[MISRA2004-13_7_a] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_a]
[MISRA2004-13_7_aa] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_aa]
[MISRA2004-13_7_ab] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_ab]
[MISRA2004-13_7_ac] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_ac]
[MISRA2004-13_7_ad] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_ad]
[MISRA2004-13_7_ae] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_ae]
[MISRA2004-13_7_af] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_af]
[MISRA2004-13_7_ag] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_ag]
[MISRA2004-13_7_ah] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_ah]
[MISRA2004-13_7_ai] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_ai]
[MISRA2004-13_7_aj] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_aj]
[MISRA2004-13_7_ak] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_ak]
[MISRA2004-13_7_b] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_b]
[MISRA2004-13_7_c] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_c]
[MISRA2004-13_7_d] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_d]
[MISRA2004-13_7_j] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_j]
[MISRA2004-13_7_k] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_k]
[MISRA2004-13_7_l] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_l]
[MISRA2004-13_7_m] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_m]
[MISRA2004-13_7_n] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_n]
[MISRA2004-13_7_s] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_s]
[MISRA2004-13_7_t] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_t]
[MISRA2004-13_7_u] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_u]
[MISRA2004-13_7_v] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_v]
[MISRA2004-13_7_w] 包含枚举的条件始终为 'true' 或 'false' [MISRA2004-13_7_w]
[MISRA2004-13_7_x] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_x]
[MISRA2004-13_7_y] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_y]
[MISRA2004-13_7_z] 不允许其结果是不变的布尔运算 [MISRA2004-13_7_z]
[MISRA2004-14_10] 所有 'if...else-if' 结构应使用一个 'else' 子句终止 [MISRA2004-14_10]
[MISRA2004-14_1_a] 在 ""else"" 语句块中不应存在执行不到的代码 [MISRA2004-14_1_a]
[MISRA2004-14_1_b] 在 'return'", 'break', 'continue'," 和 'goto' 语句之后不应存在执行不到的代码 [MISRA2004-14_1_b]
[MISRA2004-14_1_c] 在 ""if/else/while/for"" 语句块中不应存在执行不到的代码 [MISRA2004-14_1_c]
[MISRA2004-14_1_d] 在 switch 语句中不应存在执行不到的代码 [MISRA2004-14_1_d]
[MISRA2004-14_1_e] 在 'for' 循环中不应存在执行不到的代码 [MISRA2004-14_1_e]
[MISRA2004-14_1_f] 在 'if' 或 'switch' 语句后不应存在不可访问的代码 [MISRA2004-14_1_f]
[MISRA2004-14_1_g] 在 while/for/do...while 循环内的 ""if"" 或 ""switch"" 语句后不应存在执行不到的代码 [MISRA2004-14_1_g]
[MISRA2004-14_2] 所有非 null 语句应该至少有一个执行或者导致控制流变化的附加作用 [MISRA2004-14_2]
[MISRA2004-14_3] 空语句只允许单独存在一行或者可以在其后面跟着注释 [MISRA2004-14_3]
[MISRA2004-14_4] 不应该使用 goto 语句 [MISRA2004-14_4]
[MISRA2004-14_5] 不要使用 continue 语句 [MISRA2004-14_5]
[MISRA2004-14_6] 对任何循环语句,最多不应超过一个 break 语句用于循环终止 [MISRA2004-14_6]
[MISRA2004-14_7] 函数末端应只提供一个出口点 [MISRA2004-14_7]
[MISRA2004-14_8] 'switch'", 'while'," 'do...while' 或 'for' 语句的主体应该是复合语句 [MISRA2004-14_8]
[MISRA2004-14_9] 'if' 和 'else' 语句后应跟一个复合句 [MISRA2004-14_9]
[MISRA2004-15_0_a] break 语句应只出现在 switch 子句末端 [MISRA2004-15_0_a]
[MISRA2004-15_0_b] switch 语句应该只包含 switch 标签和 switch 子句,不能包含其他代码 [MISRA2004-15_0_b]
[MISRA2004-15_1] 只有当最紧密封闭的复合语句是 switch 语句主体的时才能使用 switch 标签 [MISRA2004-15_1]
[MISRA2004-15_2] 无条件的 break 语句应该作为每一个非空 case 子句的结束 [MISRA2004-15_2]
[MISRA2004-15_2_b] 无条件的 break 语句应作为所有非空 default 条件的结束 [MISRA2004-15_2_b]
[MISRA2004-15_3] switch 语句中最后必须为 default 子句 [MISRA2004-15_3]
[MISRA2004-15_4] switch 表达式不应该出现一个实际为布尔的值 [MISRA2004-15_4]
[MISRA2004-15_4_b] switch 表达式不应该出现一个实际为布尔的值 [MISRA2004-15_4_b]
[MISRA2004-15_5] 每一个 switch 语句至少有一个 case 子句 [MISRA2004-15_5]
[MISRA2004-16_1] 函数不应使用可变数量的参数定义 [MISRA2004-16_1]
[MISRA2004-16_10] 如果函数返回错误信息,则该错误信息必须经过测试 [MISRA2004-16_10]
[MISRA2004-16_2] 函数不应该直接或者间接地调用自己 [MISRA2004-16_2]
[MISRA2004-16_3] 在函数原型声明中应该为所有参数提供标识符 [MISRA2004-16_3]
[MISRA2004-16_4] 禁止函数声明中使用的标识符与实际定义中的标识符不一致 [MISRA2004-16_4]
[MISRA2004-16_5] 没有参数的函数必须声明参数类型为 void [MISRA2004-16_5]
[MISRA2004-16_6] 传递给函数的参数个数必须与函数定义的参数一致 [MISRA2004-16_6]
[MISRA2004-16_7] 如果函数参数中指针参数在函数中不用来修改地址对象,则应声明为 const 类型 [MISRA2004-16_7]
[MISRA2004-16_7_b] 如果指针不用于修改指向地址的对象则声明参数的类型为 typedef 的 const 指针 [MISRA2004-16_7_b]
[MISRA2004-16_8] 具有非空返回类型的函数的所有退出路径都应该有一个带有表达式的显式返回语句 [MISRA2004-16_8]
[MISRA2004-16_9] 函数标识符只能与前面的 '&' 一起使用,或者与括号中的参数列表一起使用,参数列表可以是空的 [MISRA2004-16_9]
[MISRA2004-17_1] 不要对那些没有指向数组或数组元素地址的指针进行指针运算 [MISRA2004-17_1]
[MISRA2004-17_2] 只有指向数组或数组元素地址的指针才能进行指针运算 [MISRA2004-17_2]
[MISRA2004-17_3] >", >=, <," <= 不应用于指针类型,除非它们指向相同的数组 [MISRA2004-17_3]
[MISRA2004-17_4] 只有数组索引才能进行算术指针操作 [MISRA2004-17_4]
[MISRA2004-17_5] 对象的声明应该包含不超过 2 层的指针嵌套 [MISRA2004-17_5]
[MISRA2004-17_6_a] 不得从函数中返回具有自动存储的对象的地址 [MISRA2004-17_6_a]
[MISRA2004-17_6_b] 自动存储对象的地址不应分配给在第一个对象不再存在后可能持久存在的另一个对象 [MISRA2004-17_6_b]
[MISRA2004-18_1] 在转换单元结束之前,所有的结构体和联合体必须有完整的声明 [MISRA2004-18_1]
[MISRA2004-18_2] 不应该将结构体自身的一个成员变量赋给另一个成员变量 [MISRA2004-18_2]
[MISRA2004-18_2_b] 结构体的每个成员不应该赋值给自己的其他成员变量 [MISRA2004-18_2_b]
[MISRA2004-18_4] 禁止使用联合体 [MISRA2004-18_4]
[MISRA2004-19_1] #include 之前只允许有预处理命令和注释 [MISRA2004-19_1]
[MISRA2004-19_10] 在类函数宏指令的定义中,参数的每个实例都应该用圆括号括起来,除非它用作 # 或者 ## 的运算对象 [MISRA2004-19_10]
[MISRA2004-19_11_b] 不要使用在编译单元中未定义的预编译器指令 #if 和 #elif 宏 [MISRA2004-19_11_b]
[MISRA2004-19_12] 禁止宏定义中使用多个 # 和 ## [MISRA2004-19_12]
[MISRA2004-19_13] 禁止使用预处理操作符 # 和 ## [MISRA2004-19_13]
[MISRA2004-19_14] 预处理操作符只能用在两种标准格式之一 [MISRA2004-19_14]
[MISRA2004-19_15] 必须采取预防措施以防止头文件的内容被引用两次 [MISRA2004-19_15]
[MISRA2004-19_16] 预处理指令即使被预处理程序排除","在语法上也是有意义的 [MISRA2004-19_16]
[MISRA2004-19_17] 在同一个文件中 #else"," #elif 和 #endif 必须对应有 #if 或 #ifdef 预处理指令 [MISRA2004-19_17]
[MISRA2004-19_2] 非标准字符不应该用于 #include 指令的头文件名称中 [MISRA2004-19_2]
[MISRA2004-19_3] #include 指令后面应当添加 <filename> 或是 ""filename"" [MISRA2004-19_3]
[MISRA2004-19_4] 避免宏定义中存在关键字和基本类型 [MISRA2004-19_4]
[MISRA2004-19_5] 禁止在块中使用 #define 或 #undef [MISRA2004-19_5]
[MISRA2004-19_6] 禁止使用 #undef [MISRA2004-19_6]
[MISRA2004-19_7] 函数应该优先于宏函数的使用 [MISRA2004-19_7]
[MISRA2004-19_8] 类似函数的宏在调用时参数个数必须一致 [MISRA2004-19_8]
[MISRA2004-19_9] 类似函数的宏的参数不应该包含类似预处理命令的标识 [MISRA2004-19_9]
[MISRA2004-20_10] 不得使用库stdlib.h中的库函数atof,atoi和atol [MISRA2004-20_10]
[MISRA2004-20_11] 'stdlib.h' 或者 'cstdlib' 库中的 'abort()' 函数不应该被使用 [MISRA2004-20_11]
[MISRA2004-20_11_b] 'stdlib.h' 或者 'cstdlib' 库中的 'exit()' 函数不应该被使用 [MISRA2004-20_11_b]
[MISRA2004-20_11_c] 不得使用 'stdlib.h' 或 'cstdlib' 库中的 'getenv()' 函数 [MISRA2004-20_11_c]
[MISRA2004-20_11_d] 不得使用 'stdlib.h' 或 'cstdlib' 库中的 'system()' 函数 [MISRA2004-20_11_d]
[MISRA2004-20_12] 禁止使用库文件 time.h 中的时间处理库函数 [MISRA2004-20_12]
[MISRA2004-20_1_a] 不要使用以下划线开头的带有#define 或 #undef 名称的标识符 [MISRA2004-20_1_a]
[MISRA2004-20_1_b] 不要重新定义保留字 [MISRA2004-20_1_b]
[MISRA2004-20_1_c] 在标准程序库中的保留标识符,宏以及函数不应该被定义,重定义或取消定义(C90代码 [MISRA2004-20_1_c]
[MISRA2004-20_1_e] 不要#define也不要#undef '已定义'的标识 [MISRA2004-20_1_e]
[MISRA2004-20_2] 标准库宏、对象和函数的名称不应该被重用 [MISRA2004-20_2]
[MISRA2004-20_2_a] 不应该重复使用标准库中的宏,对象和函数(C90) [MISRA2004-20_2_a]
[MISRA2004-20_2_b] 标准库宏,对象和函数的名称不得重复使用(C99) [MISRA2004-20_2_b]
[MISRA2004-20_3] 应检查传递给库函数的值的有效性 [MISRA2004-20_3]
[MISRA2004-20_4] 不应使用动态堆内存分配 [MISRA2004-20_4]
[MISRA2004-20_5] 不得使用错误指示 'errno' [MISRA2004-20_5]
[MISRA2004-20_6] 不应该使用库文件 stddef.h 中的 offsetof 宏 [MISRA2004-20_6]
[MISRA2004-20_7] 不使用 setjmp 宏和 longjmp 函数 [MISRA2004-20_7]
[MISRA2004-20_7_b] 不要使用标准头文件 <setjmp.h> [MISRA2004-20_7_b]
[MISRA2004-20_8] 禁止使用标准库文件 <signal.h> 中的处理函数 [MISRA2004-20_8]
[MISRA2004-20_8_b] 禁止使用信号处理文件 <signal.h> 中的处理函数 [MISRA2004-20_8_b]
[MISRA2004-20_9] 禁止使用库文件 stdio.h 中的输入/输出函数 [MISRA2004-20_9]


Every defined function with internal linkage shall be used [MISRA2008-0_1_10]
Every defined function with external linkage shall be used [MISRA2008-0_1_10_b]
There shall be no unused parameters (named or unnamed) in nonvirtual functions [MISRA2008-0_1_11]
There shall be no unused parameters (named or unnamed) in the set of parameters for a virtual function and all the functions that override it [MISRA2008-0_1_12]
A project shall not contain unreachable code in 'else' block [MISRA2008-0_1_1_a]
A project shall not contain unreachable code after 'return', 'break', 'continue', and 'goto' statements [MISRA2008-0_1_1_b]
A project shall not contain unreachable code in 'if/else/while/for' block [MISRA2008-0_1_1_c]
A project shall not contain unreachable code in switch statement [MISRA2008-0_1_1_d]
A project shall not contain unreachable code in 'for' loop [MISRA2008-0_1_1_e]
A project shall not contain unreachable code after 'if' or 'switch' statement outside 'for/while/catch' block [MISRA2008-0_1_1_f]
A project shall not contain unreachable code after 'if' or 'switch' statement inside 'while/for/catch' block [MISRA2008-0_1_1_g]
A project shall not contain infeasible paths [MISRA2008-0_1_2_a]
A project shall not contain infeasible paths [MISRA2008-0_1_2_aa]
A project shall not contain infeasible paths [MISRA2008-0_1_2_b]
A project shall not contain infeasible paths [MISRA2008-0_1_2_c]
A project shall not contain infeasible paths [MISRA2008-0_1_2_d]
A project shall not contain infeasible paths [MISRA2008-0_1_2_e]
A project shall not contain infeasible paths [MISRA2008-0_1_2_f]
A project shall not contain infeasible paths [MISRA2008-0_1_2_g]
A project shall not contain infeasible paths [MISRA2008-0_1_2_h]
A project shall not contain infeasible paths [MISRA2008-0_1_2_i]
A project shall not contain infeasible paths [MISRA2008-0_1_2_j]
A project shall not contain infeasible paths [MISRA2008-0_1_2_k]
A project shall not contain infeasible paths [MISRA2008-0_1_2_l]
A project shall not contain infeasible paths [MISRA2008-0_1_2_m]
A project shall not contain infeasible paths [MISRA2008-0_1_2_n]
A project shall not contain infeasible paths [MISRA2008-0_1_2_o]
A project shall not contain infeasible paths [MISRA2008-0_1_2_p]
A project shall not contain infeasible paths [MISRA2008-0_1_2_q]
A project shall not contain infeasible paths [MISRA2008-0_1_2_r]
A project shall not contain infeasible paths [MISRA2008-0_1_2_rz]
A project shall not contain infeasible paths [MISRA2008-0_1_2_s]
A project shall not contain infeasible paths [MISRA2008-0_1_2_sz]
A project shall not contain infeasible paths [MISRA2008-0_1_2_t]
A project shall not contain infeasible paths [MISRA2008-0_1_2_u]
A project shall not contain infeasible paths [MISRA2008-0_1_2_v]
A project shall not contain infeasible paths [MISRA2008-0_1_2_w]
A project shall not contain infeasible paths [MISRA2008-0_1_2_x]
A project shall not contain infeasible paths [MISRA2008-0_1_2_y]
A project shall not contain infeasible paths [MISRA2008-0_1_2_z]
A project shall not contain unused variables [MISRA2008-0_1_3_a]
A project shall not contain unused variables [MISRA2008-0_1_3_b]
A project shall not contain non-volatile POD variables having only one use [MISRA2008-0_1_4]
A project shall not contain unused type declarations [MISRA2008-0_1_5]
Avoid unused values [MISRA2008-0_1_6]
The value returned by a function having a non-void return type that is not an overloaded operator shall always be used [MISRA2008-0_1_7]
All functions with void return type shall have external side effect(s) [MISRA2008-0_1_8]
All functions with void return type shall have external side effect(s) [MISRA2008-0_1_8_b]
All non-null statements shall either have at least one side-effect however executed or cause control flow to change [MISRA2008-0_1_9]
An object shall not be assigned to an overlapping object [MISRA2008-0_2_1_a]
An object shall not be assigned to an overlapping object [MISRA2008-0_2_1_b]
Avoid accessing arrays out of bounds [MISRA2008-0_3_1_a]
Avoid null pointer dereferencing [MISRA2008-0_3_1_b]
Avoid division by zero [MISRA2008-0_3_1_c]
Avoid buffer overflow due to defining incorrect format limits [MISRA2008-0_3_1_d]
Avoid overflow due to reading a not zero terminated string [MISRA2008-0_3_1_e]
Do not check for null after dereferencing [MISRA2008-0_3_1_f]
Avoid overflow when reading from a buffer [MISRA2008-0_3_1_g]
Avoid overflow when writing to a buffer [MISRA2008-0_3_1_h]
Pointer arithmetic shall only be applied to pointers that address an array or array element [MISRA2008-0_3_1_i]
>, >=, <, <= shall not be applied to objects of pointer type, except where they point to the same array [MISRA2008-0_3_1_j]
If a function generates error information, then that error information shall be tested [MISRA2008-0_3_2]
Use of floating-point arithmetic shall be documented [MISRA2008-0_4_2]
Classes should not be derived from virtual bases [MISRA2008-10_1_1]
A base class shall only be declared virtual if it is used in a diamond hierarchy [MISRA2008-10_1_2]
An accessible base class shall not be both virtual and non-virtual in the same hierarchy [MISRA2008-10_1_3]
All accessible entity names within a multiple inheritance hierarchy should be unique [MISRA2008-10_2_1]
There shall be no more than one definition of each virtual function on each path through the inheritance hierarchy [MISRA2008-10_3_1]
Each overriding virtual function shall be declared with the virtual keyword [MISRA2008-10_3_2]
A virtual function shall only be overridden by a pure virtual function if it is itself declared as pure virtual [MISRA2008-10_3_3]
Member data in non-POD class types shall be private [MISRA2008-11_0_1]
An object's dynamic type shall not be used from the body of its constructor or destructor [MISRA2008-12_1_1]
All constructors of a class should explicitly call a constructor for all of its immediate base classes and all virtual base classes [MISRA2008-12_1_2]
All constructors that are callable with a single argument of fundamental type shall be declared explicit [MISRA2008-12_1_3]
A copy constructor shall only initialize its base classes and the nonstatic members of the class of which it is a member [MISRA2008-12_8_1]
The copy assignment operator shall be declared protected or private in an abstract class [MISRA2008-12_8_2]
Do not declare non-member generic functions in associated namespaces [MISRA2008-14_5_1]
A copy constructor shall be declared when there is a template constructor with a single parameter that is a generic parameter [MISRA2008-14_5_2]
A copy assignment operator shall be declared when there is a template assignment operator with a parameter that is a generic parameter [MISRA2008-14_5_3]
In a class template with a dependent base, any name that may be found in that dependent base shall be referred to using a qualified-id or this-> [MISRA2008-14_6_1]
The function shall resolve to a function declared previously in the translation unit [MISRA2008-14_6_2]
All class templates, function templates, class template member functions and class template static members shall be instantiated at least one. [MISRA2008-14_7_1]
All partial and explicit specializations for a template shall be declared in the same file as the declaration of their primary template [MISRA2008-14_7_3]
Overloaded function templates shall not be explicitly specialized [MISRA2008-14_8_1]
The viable function set for a function call should either contain no function specializations, or only contain function specializations [MISRA2008-14_8_2]
An exception object should not have pointer type [MISRA2008-15_0_2]
Control shall not be transferred into a try or catch block using a goto or a switch statement [MISRA2008-15_0_3]
The assignment-expression of a throw statement shall not itself cause an exception to be thrown [MISRA2008-15_1_1]
NULL shall not be thrown explicitly [MISRA2008-15_1_2]
An empty throw (throw;) shall only be used in the compound statement of a catch handler [MISRA2008-15_1_3]
Exceptions shall be raised only after start-up and before termination of the program [MISRA2008-15_3_1]
There should be at least one exception handler to catch all otherwise unhandled exceptions [MISRA2008-15_3_2]
Handlers of a function-try-block implementation of a class constructor or destructor shall not reference non-static members from this class or its bases [MISRA2008-15_3_3]
Each exception explicitly thrown in the code shall have a handler of a compatible type in all call paths that could lead to that point [MISRA2008-15_3_4_a]
Each exception explicitly thrown in the code shall have a handler of a compatible type in all call paths that could lead to that point [MISRA2008-15_3_4_b]
A class type exception shall always be caught by reference [MISRA2008-15_3_5]
Where multiple handlers are provided in a single try-catch statement or function-try-block for a derived class and some or all of its bases, the handlers shall be ordered most-derived to base class [MISRA2008-15_3_6]
Where multiple handlers are provided in a single try-catch statement or function-try-block, any ellipsis (catch-all) handler shall occur last [MISRA2008-15_3_7]
If a function is declared with an exception-specification, then all declarations of the same function (in other translation units) shall be declared with the same set of type-ids [MISRA2008-15_4_1]
A class destructor shall not exit with an exception [MISRA2008-15_5_1]
Where a function's declaration includes an exception-specification, the function shall only be capable of throwing exceptions of the indicated type(s) [MISRA2008-15_5_2]
Avoid throwing exceptions from functions that are declared not to throw [MISRA2008-15_5_2_b]
The execution of a function registered with 'std::atexit()' or 'std::at_quick_exit()' should not exit via an exception [MISRA2008-15_5_3]
Never allow an exception to be thrown from a destructor, deallocation, and swap [MISRA2008-15_5_3_b]
Do not throw from within destructor [MISRA2008-15_5_3_c]
There should be at least one exception handler to catch all otherwise unhandled exceptions [MISRA2008-15_5_3_d]
An empty throw (throw;) shall only be used in the compound-statement of a catch handler [MISRA2008-15_5_3_e]
Exceptions shall be raised only after start-up and before termination of the program [MISRA2008-15_5_3_f]
Each exception explicitly thrown in the code shall have a handler of a compatible type in all call paths that could lead to that point [MISRA2008-15_5_3_g]
Where a function's declaration includes an exception-specification, the function shall only be capable of throwing exceptions of the indicated type(s) [MISRA2008-15_5_3_h]
Function called in global or namespace scope shall not throw unhandled exceptions [MISRA2008-15_5_3_i]
Always catch exceptions [MISRA2008-15_5_3_j]
Properly define exit handlers [MISRA2008-15_5_3_k]
Avoid throwing exceptions from functions that are declared not to throw [MISRA2008-15_5_3_l]
#include directives in a file shall only be preceded by other preprocessor directives or comments [MISRA2008-16_0_1]
Macros shall only be #define'd or #undef'd in the global namespace [MISRA2008-16_0_2]
#undef shall not be used [MISRA2008-16_0_3]
Function-like macros shall not be defined [MISRA2008-16_0_4]
Arguments to a function-like macro shall not contain tokens that look like preprocessing directives [MISRA2008-16_0_5]
In the definition of a function-like macro, each instance of a parameter shall be enclosed in parentheses, unless it is used as the operand of # or ## [MISRA2008-16_0_6]
Do not use in preprocessor directives #if and #elif macros not defined in translation unit [MISRA2008-16_0_7_b]
If the # token appears as the first token on a line, then it shall be immediately followed by a preprocessing token [MISRA2008-16_0_8]
The defined preprocessor operator shall only be used in one of the two standard forms [MISRA2008-16_1_1]
All #else, #elif and #endif preprocessor directives shall reside in the same file as the #if or #ifdef directive to which they are related [MISRA2008-16_1_2]
Macros shall not be used [MISRA2008-16_2_1_a]
The #ifndef and #endif pre-processor directives will only be used to prevent multiple inclusions of the same header file [MISRA2008-16_2_1_b]
The following pre-processor directives shall not be used: #if, #elif, #else, #ifdef, #undef, #pragma [MISRA2008-16_2_1_c]
C macros shall only be used for: include guards, type qualifiers, or storage class specifiers [MISRA2008-16_2_2]
Include guards shall be provided [MISRA2008-16_2_3]
The ', ", /* or // characters shall not occur in a header file name [MISRA2008-16_2_4]
The \ character should not occur in a header file name [MISRA2008-16_2_5]
The #include directive shall be followed by either a <filename> or "filename" sequence [MISRA2008-16_2_6]
There shall be at most one occurrence of the # or ## operators in a single macro definition [MISRA2008-16_3_1]
The # and ## operators should not be used [MISRA2008-16_3_2]
All uses of the #pragma directive shall be documented [MISRA2008-16_6_1]
Reserved identifiers, macros and functions in the standard library shall not be defined, redefined or undefined [MISRA2008-17_0_1_a]
Reserved identifiers, macros and functions in the standard library shall not be defined, redefined or undefined [MISRA2008-17_0_1_b]
Reserved identifiers, macros and functions in the standard library shall not be defined, redefined or undefined [MISRA2008-17_0_1_c]
Reserved identifiers, macros and functions in the standard library shall not be defined, redefined or undefined [MISRA2008-17_0_1_d]
Reserved identifiers, macros and functions in the standard library shall not be defined, redefined or undefined [MISRA2008-17_0_1_e]
The names of standard library macros and objects shall not be reused [MISRA2008-17_0_2]
The names of standard library functions shall not be overridden [MISRA2008-17_0_3]
The setjmp macro and the longjmp function shall not be used [MISRA2008-17_0_5]
The standard header file <setjmp.h> shall not be used [MISRA2008-17_0_5_b]
The C library shall not be used [MISRA2008-18_0_1]
The library functions atof, atoi and atol from library <cstdlib> shall not be used [MISRA2008-18_0_2]
The library function 'abort' of <stdlib.h> shall not be used [MISRA2008-18_0_3]
The library function 'exit' of <stdlib.h> shall not be used [MISRA2008-18_0_3_b]
The library function 'getenv' of <stdlib.h> shall not be used [MISRA2008-18_0_3_c]
The library function 'system' of <stdlib.h> shall not be used [MISRA2008-18_0_3_d]
The time handling functions of library <ctime> shall not be used [MISRA2008-18_0_4]
The unbounded functions of library <cstring> shall not be used [MISRA2008-18_0_5]
The macro offsetof shall not be used [MISRA2008-18_2_1]
Dynamic heap memory allocation shall not be used [MISRA2008-18_4_1]
The standard header file <csignal> shall not be used [MISRA2008-18_7_1]
The signal handling facilities of <csignal> shall not be used [MISRA2008-18_7_1_b]
The error indicator errno shall not be used [MISRA2008-19_3_1]
The stream input/output library <cstdio> shall not be used [MISRA2008-27_0_1]
Different identifiers shall be typographically unambiguous [MISRA2008-2_10_1]
Identifiers declared in an inner scope shall not hide an identifier declared in an outer scope [MISRA2008-2_10_2_a]
Identifiers declared in an inner scope shall not hide an identifier declared in an outer scope [MISRA2008-2_10_2_b]
A typedef name (including qualification, if any) shall be a unique identifier [MISRA2008-2_10_3]
A class, union or enum name (including qualification, if any) shall be a unique identifier [MISRA2008-2_10_4]
The identifier name of a non-member object or function with static storage duration should not be reused [MISRA2008-2_10_5_a]
The identifier name of a non-member object or function with static storage duration should not be reused [MISRA2008-2_10_5_b]
If an identifier refers to a type, it shall not also refer to an object or a function in the same scope [MISRA2008-2_10_6_a]
If an identifier refers to a type, it shall not also refer to an object or a function in the same scope [MISRA2008-2_10_6_b]
If an identifier refers to a type, it shall not also refer to an object or a function in the same scope [MISRA2008-2_10_6_c]
The name of typedef should not be the same as the name of its basic type [MISRA2008-2_10_6_d]
Only those escape sequences that are defined in ISO/IEC 14882:2003 shall be used [MISRA2008-2_13_1]
Octal constants (other than zero) shall not be used [MISRA2008-2_13_2_a]
Octal escape sequences (other than "\0") shall not be used [MISRA2008-2_13_2_b]
A "U" suffix shall be applied to all octal or hexadecimal integer literals of unsigned type [MISRA2008-2_13_3]
Literal suffixes shall be upper case [MISRA2008-2_13_4]
Narrow and wide string literals shall not be concatenated [MISRA2008-2_13_5]
Trigraphs shall not be used [MISRA2008-2_3_1]
Digraphs should not be used [MISRA2008-2_5_1]
The character sequence /* shall not be used within a C-style comment [MISRA2008-2_7_1]
Sections of code shall not be "commented out" using C-style comments [MISRA2008-2_7_2]
Sections of code should not be "commented out" using C comments [MISRA2008-2_7_3]
It shall be possible to include any header file in multiple translation units without violating the One Definition Rule [MISRA2008-3_1_1]
Functions shall not be declared at block scope [MISRA2008-3_1_2]
When an array is declared, its size shall either be stated explicitly or defined implicitly by initialization [MISRA2008-3_1_3]
All declarations of an object or function shall have compatible types [MISRA2008-3_2_1]
The One Definition Rule shall not be violated [MISRA2008-3_2_2]
A type, object or function that is used in multiple translation units shall be declared in one and only one file [MISRA2008-3_2_3]
An identifier with external linkage shall have exactly one external definition [MISRA2008-3_2_4]
Objects or functions with external linkage shall be declared in a header file [MISRA2008-3_3_1]
If a function has internal linkage then all re-declarations shall include the static storage class specifier [MISRA2008-3_3_2]
An identifier declared to be an object or type shall be defined in a block that minimizes its visibility [MISRA2008-3_4_1_a]
An identifier declared to be an object or type shall be defined in a block that minimizes its visibility [MISRA2008-3_4_1_b]
The types used for an object, a function return type, or a function parameter shall be token-for-token identical in all declarations and re-declarations [MISRA2008-3_9_1]
typedefs that indicate size and signedness should be used in place of the basic numerical types [MISRA2008-3_9_2]
The underlying bit representations of floating-point values shall not be used [MISRA2008-3_9_3]
NULL shall not be used as an integer value [MISRA2008-4_10_1]
Literal zero (0) shall not be used as the null-pointer-constant [MISRA2008-4_10_2]
Expressions with type bool shall not be used as operands to built-in operators other than the assignment operator =, the logical operators &&, ||, !, the equality operators == and !=, the unary & operator, and the conditional operator [MISRA2008-4_5_1]
Expressions with type enum shall not be used as operands to built-in operators other than [ ], =, ==, !=, <, <=, >, >=, and the unary & operator [MISRA2008-4_5_2]
Expressions with type (plain) char and wchar_t shall not be used as operands to built-in operators other than the assignment operator =, the equality operators == and !=, and the unary & operator [MISRA2008-4_5_3]
If the bitwise operators ~ and << are applied to an operand with an underlying type of unsigned char or unsigned short, the result shall be immediately cast to the underlying type of the operand [MISRA2008-5_0_10]
The plain char type shall only be used for the storage and use of character values [MISRA2008-5_0_11]
signed char and unsigned char type shall only be used for the storage and use of numeric values [MISRA2008-5_0_12]
The condition of an if-statement and the condition of an iteration-statement shall have type bool [MISRA2008-5_0_13]
The first operand of a conditional-operator shall have type bool [MISRA2008-5_0_14]
Array indexing shall be the only form of pointer arithmetic [MISRA2008-5_0_15]
Avoid accessing arrays out of bounds [MISRA2008-5_0_16_a]
A pointer operand and any pointer resulting from pointer arithmetic using that operand shall both address elements of the same array [MISRA2008-5_0_16_b]
Subtraction between pointers shall only be applied to pointers that address elements of the same array [MISRA2008-5_0_17]
>, >=, <, <= shall not be applied to objects of pointer type, except where they point to the same array [MISRA2008-5_0_18]
The declaration of objects shall contain no more than two levels of pointer indirection [MISRA2008-5_0_19]
The value of an expression shall be the same under any order of evaluation that the standard permits [MISRA2008-5_0_1_a]
The value of an expression shall be the same under any order of evaluation that the standard permits [MISRA2008-5_0_1_b]
The value of an expression shall be the same under any order of evaluation that the standard permits [MISRA2008-5_0_1_c]
The value of an expression shall be the same under any order of evaluation that the standard permits [MISRA2008-5_0_1_d]
The value of an expression shall be the same under any order of evaluation that the standard permits [MISRA2008-5_0_1_e]
The value of an expression shall be the same under any order of evaluation that the standard permits [MISRA2008-5_0_1_f]
The value of an expression shall be the same under any order of evaluation that the standard permits [MISRA2008-5_0_1_g]
Non-constant operands to a binary bitwise operator shall have the same underlying type [MISRA2008-5_0_20]
Bitwise operators shall only be applied to operands of unsigned underlying type [MISRA2008-5_0_21]
Limited dependence should be placed on C operator precedence rules in expressions [MISRA2008-5_0_2_a]
Limited dependence should be placed on C operator precedence rules in expressions [MISRA2008-5_0_2_b]
Limited dependence should be placed on C operator precedence rules in expressions [MISRA2008-5_0_2_c]
Limited dependence should be placed on C operator precedence rules in expressions [MISRA2008-5_0_2_d]
Limited dependence should be placed on C operator precedence rules in expressions [MISRA2008-5_0_2_e]
Limited dependence should be placed on C operator precedence rules in expressions [MISRA2008-5_0_2_f]
A cvalue expression shall not be implicitly converted to a different underlying type [MISRA2008-5_0_3_a]
A cvalue expression shall not be implicitly converted to a different underlying type [MISRA2008-5_0_3_b]
A cvalue expression shall not be implicitly converted to a different underlying type [MISRA2008-5_0_3_c]
An implicit integral conversion shall not change the signedness of the underlying type [MISRA2008-5_0_4_a]
An implicit integral conversion shall not change the signedness of the underlying type [MISRA2008-5_0_4_b]
There shall be no implicit floating-integral conversions [MISRA2008-5_0_5_a]
There shall be no implicit floating-integral conversions [MISRA2008-5_0_5_b]
An implicit integral or floating-point conversion shall not reduce the size of the underlying type [MISRA2008-5_0_6_a]
An implicit integral or floating-point conversion shall not reduce the size of the underlying type [MISRA2008-5_0_6_b]
An implicit integral or floating-point conversion shall not reduce the size of the underlying type [MISRA2008-5_0_6_c]
There shall be no explicit floating-integral conversions of a cvalue expression [MISRA2008-5_0_7_a]
There shall be no explicit floating-integral conversions of a cvalue expression [MISRA2008-5_0_7_b]
An explicit integral or floating-point conversion shall not increase the size of the underlying type of a cvalue expression [MISRA2008-5_0_8]
An explicit integral conversion shall not change the signedness of the underlying type of a cvalue expression [MISRA2008-5_0_9]
The right hand operand of a logical && or || operator shall not contain side effects [MISRA2008-5_14_1]
The overloaded binary operator should be implemented in terms of its corresponding compound assignment operator [MISRA2008-5_17_1]
The comma operator shall not be used [MISRA2008-5_18_1]
Integer overflow or underflow in constant expression in ' ', '-', '*' operator [MISRA2008-5_19_1_a]
Integer overflow or underflow in constant expression in '<<' operator [MISRA2008-5_19_1_b]
Each operand of a logical && or || shall be a postfix-expression [MISRA2008-5_2_1]
The increment ( ) and decrement (--) operators should not be mixed with other operators in an expression [MISRA2008-5_2_10]
The && operator and the || operator shall not be overloaded [MISRA2008-5_2_11]
The comma "," operator shall not be overloaded [MISRA2008-5_2_11_b]
An identifier with array type passed as a function argument shall not decay to a pointer [MISRA2008-5_2_12]
A pointer to a virtual base class shall only be cast to a pointer to a derived class by means of dynamic_cast [MISRA2008-5_2_2]
Casts from a base class to a derived class should not be performed on polymorphic types [MISRA2008-5_2_3]
C-style casts (other than void casts) and functional notation casts (other than explicit constructor calls) shall not be used [MISRA2008-5_2_4]
A cast shall not remove any const or volatile qualification from the type of a pointer or reference [MISRA2008-5_2_5]
A cast shall not convert a pointer to a function to any other pointer type, including a pointer to function type [MISRA2008-5_2_6]
An object with pointer type shall not be converted to an unrelated pointer type, either directly or indirectly [MISRA2008-5_2_7]
An object with integer type or pointer to void type shall not be converted to an object with pointer type [MISRA2008-5_2_8]
A cast should not convert a pointer type to an integral type [MISRA2008-5_2_9]
Each operand of the ! operator, the logical && or the logical || operators shall have type bool [MISRA2008-5_3_1]
The unary minus operator shall not be applied to an expression whose underlying type is unsigned [MISRA2008-5_3_2]
The unary & operator shall not be overloaded [MISRA2008-5_3_3]
Evaluation of the operand to the sizeof operator shall not contain side effects [MISRA2008-5_3_4]
Evaluation of the operand to the sizeof operator shall not contain side effects [MISRA2008-5_3_4_b]
Evaluation of the operand to the sizeof operator shall not contain side effects [MISRA2008-5_3_4_c]
The right hand operand of a shift operator shall lie between zero and one less than the width in bits of the underlying type of the left hand operand [MISRA2008-5_8_1]
Assignment operators shall not be used in sub-expressions [MISRA2008-6_2_1]
Floating-point expressions shall not be directly or indirectly tested for equality or inequality [MISRA2008-6_2_2]
Before preprocessing, a null statement shall only occur on a line by itself; it may be followed by a comment, provided that the first character following the null statement is a white-space character [MISRA2008-6_2_3]
The statement forming the body of a switch, while, do while or for statement shall be a compound statement [MISRA2008-6_3_1]
An if ( condition ) construct shall be followed by a compound statement. The else keyword shall be followed by either a compound statement, or another if statement [MISRA2008-6_4_1]
All if ... else if constructs shall be terminated with an else clause [MISRA2008-6_4_2]
A switch statement shall be a well-formed switch statement [MISRA2008-6_4_3_a]
A switch statement shall be a well-formed switch statement [MISRA2008-6_4_3_b]
A switch statement shall be a well-formed switch statement [MISRA2008-6_4_3_c]
A switch statement shall be a well-formed switch statement [MISRA2008-6_4_3_d]
A switch statement shall be a well-formed switch statement [MISRA2008-6_4_3_e]
A switch-label shall only be used when the most closely-enclosing compound statement is the body of a switch statement [MISRA2008-6_4_4]
An unconditional throw or break statement shall terminate every non-empty switch-clause [MISRA2008-6_4_5]
The final clause of a switch statement shall be the default-clause [MISRA2008-6_4_6]
The condition of a switch statement shall not have bool type [MISRA2008-6_4_7]
Every switch statement shall have at least one case-clause [MISRA2008-6_4_8]
A for loop shall contain a single loop-counter which shall not have floating type [MISRA2008-6_5_1]
If loop-counter is not modified by -- or , then, within condition, the loop-counter shall only be used as an operand to <=, <, > or >= [MISRA2008-6_5_2]
The loop-counter shall not be modified within condition or statement [MISRA2008-6_5_3]
The loop-counter shall be modified by one of: --, , -=n, or =n; where n remains constant for the duration of the loop [MISRA2008-6_5_4]
A loop-control-variable other than the loop-counter shall not be modified within condition or expression [MISRA2008-6_5_5]
A loop-control-variable other than the loop-counter which is modified in statement within a body of the loop shall have type bool [MISRA2008-6_5_6]
Any label referenced by a goto statement shall be declared in the same block, or in a block enclosing the goto statement [MISRA2008-6_6_1]
The goto statement shall jump to a label declared later in the same function body [MISRA2008-6_6_2]
The continue statement shall only be used within a well-formed for loop [MISRA2008-6_6_3]
For any iteration statement there shall be no more than one break or goto statement used for loop termination [MISRA2008-6_6_4]
A function shall have a single point of exit at the end of the function [MISRA2008-6_6_5]
A variable which is not modified shall be const qualified [MISRA2008-7_1_1]
A pointer parameter in a function shall be declared as pointer to const if the corresponding object is not modified [MISRA2008-7_1_2_a]
A reference parameter in a function shall be declared as reference to const if the corresponding object is not modified [MISRA2008-7_1_2_b]
Declare a type of parameter as typedef to pointer to const if the pointer is not used to modify the addressed object [MISRA2008-7_1_2_c]
An expression with enum underlying type shall only have values corresponding to the enumerators of the enumeration [MISRA2008-7_2_1]
The global namespace shall only contain main, namespace declarations and extern "C" declarations [MISRA2008-7_3_1]
The identifier main shall not be used for a function other than the global function main [MISRA2008-7_3_2]
There shall be no unnamed namespaces in header files [MISRA2008-7_3_3]
using-directives shall not be used [MISRA2008-7_3_4]
Multiple declarations for an identifier in the same namespace shall not straddle a using-declaration for that identifier [MISRA2008-7_3_5]
using-directives and using-declarations (excluding class scope or function scope using-declarations) shall not be used in header files [MISRA2008-7_3_6]
All usage of assembler shall be documented [MISRA2008-7_4_1]
Assembler instructions shall only be introduced using the asm declaration [MISRA2008-7_4_2]
Assembly language shall be encapsulated and isolated [MISRA2008-7_4_3]
A function shall not return a reference or a pointer to an automatic variable (including parameters), defined within the function [MISRA2008-7_5_1]
The address of an object with automatic storage shall not be assigned to another object that may persist after the first object has ceased to exist [MISRA2008-7_5_2_a]
The address of an object with automatic storage shall not be assigned to another object that may persist after the first object has ceased to exist [MISRA2008-7_5_2_b]
A function shall not return a reference or a pointer to a parameter that is passed by reference or const reference [MISRA2008-7_5_3]
Functions should not call themselves, either directly or indirectly [MISRA2008-7_5_4]
An init-declarator-list or a member-declarator-list shall consist of a single init-declarator or member-declarator respectively [MISRA2008-8_0_1]
Parameters in an overriding virtual function shall either use the same default arguments as the function they override, or else shall not specify any default arguments [MISRA2008-8_3_1]
Functions shall not be defined using the ellipsis notation [MISRA2008-8_4_1]
The identifiers used for the parameters in a re-declaration of a function shall be identical to those in the declaration [MISRA2008-8_4_2]
All exit paths from a function with non-void return type shall have an explicit return statement with an expression [MISRA2008-8_4_3]
A function identifier shall either be used to call the function or it shall be preceded by '&' [MISRA2008-8_4_4]
All variables shall have a defined value before they are used [MISRA2008-8_5_1]
Braces shall be used to indicate and match the structure in the non-zero initialization of arrays and structures [MISRA2008-8_5_2]
Arrays shall not be partially initialized [MISRA2008-8_5_2_b]
Structures shall not be partially initialized [MISRA2008-8_5_2_c]
In an enumerator list, the = construct shall not be used to explicitly initialize members other than the first, unless all items are explicitly initialized [MISRA2008-8_5_3]
const member functions shall not return non-const pointers or references to class-data [MISRA2008-9_3_1]
Protected member functions shall not return non-const handles to class-data [MISRA2008-9_3_2_a]
Public member functions shall not return non-const handles to class-data [MISRA2008-9_3_2_b]
If a member function can be made static then it shall be made static, otherwise if it can be made const then it shall be made const [MISRA2008-9_3_3]
Unions shall not be used [MISRA2008-9_5_1]
Bit-fields shall be either bool type or an explicitly unsigned or signed integral type [MISRA2008-9_6_2]
Bit-fields shall not have enum type [MISRA2008-9_6_3]
Named bit-fields with signed integer type shall have a length of more than one bit [MISRA2008-9_6_4]



MISRA C 2012 Directives [MISRA2012-DIR]
MISRA C 2012 Rules [MISRA2012-RULE]

.
├── MisraC-2004Manual.chm
├── MisraC2008Manual.chm
├── MisraC2012Manual.chm
└── 好例子网_MisraC示例集.7z

0 directories, 4 files



标签: 2012 2008 2004 200 008

实例下载地址

Misrac 2004/2008/2012详解实例文档

不能下载?内容有错? 点击这里报错 + 投诉 + 提问

好例子网口号:伸出你的我的手 — 分享

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。

关于好例子网

本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明

;
报警