检查器 Playground
精选了十条经典规则,为其生成了代码检查器,选择规则可快速浏览生成结果。
选择精选规则,使用预先运行好的结果动态回放从规则到检查器的完整生成流程。
选择一个预置案例来预览其规则定义和测试集。
Prohibits anonymous structs and unions nested directly inside struct definitions.
Prohibits calling multiple data-dependent functions in the same expression.
Requires parentheses when arithmetic or bitwise operations are mixed with comparisons.
Prohibits assignment expressions inside conditional logic.
Requires a final `else` branch in `if` / `else if` chains.
Prohibits local variables or parameters that reuse the name of a global variable.
Prohibits assigning floating-point values to integer variables without an explicit cast.
Requires `for` loop control variables to be local variables.
Requires pointers to be reset to null immediately after `free`, `delete`, or `delete[]`.
Requires dynamically allocated pointers to be null-checked before first use.
清晰描述规则,并提供具有代表性的合规与不合规测试用例。
使用简洁明确的名称标记规则。
说明应检测的问题。
安全代码,不应触发检查器。
危险代码,应被检查器识别出来。