一键导入
pow10-rule-10-warnings-as-errors
NASA Power of 10 Rule 10 — All warnings on; treat warnings as errors; second analyzer in CI. Severity: blocker.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
NASA Power of 10 Rule 10 — All warnings on; treat warnings as errors; second analyzer in CI. Severity: blocker.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
NASA Power of 10 Rule 1 — Restrict control flow to simple constructs (no goto, setjmp/longjmp, recursion). Severity: blocker.
NASA Power of 10 Rule 2 — Every loop must have a statically determinable upper bound. Severity: blocker.
NASA Power of 10 Rule 3 — No dynamic memory allocation after initialization. Severity: blocker.
NASA Power of 10 Rule 4 — Functions ≤60 lines (one printed page). Severity: high.
NASA Power of 10 Rule 5 — Average ≥2 runtime assertions per function. Severity: high.
NASA Power of 10 Rule 6 — Declare data at smallest possible scope. Severity: medium.
| name | pow10-rule-10-warnings-as-errors |
| description | NASA Power of 10 Rule 10 — All warnings on; treat warnings as errors; second analyzer in CI. Severity: blocker. |
Severity: blocker
Compile with the strictest warning flags the toolchain offers. Treat any warning as a build failure. CI must run at least one additional static analyzer beyond the compiler, also configured for maximum strictness.
Compiler warnings are the cheapest static analysis available — zero-config, run on every build, catch real defects (uninitialized memory, format mismatches, sign comparisons, unreachable code). A safety-critical build that tolerates warnings leaves free defects on the table.
-Wall -Werror or equivalent)// nolint / @SuppressWarnings("...") / # noqa without an inline reasonConfigure the compiler / language toolchain with every available warning enabled and warnings-as-errors. Add a second analyzer (different vendor / different technology) and run it in the same CI job. Forbid any suppression that lacks an inline justification comment.
When a warning must be suppressed, scope as narrowly as possible (push/pop, single line, single block) and document inline:
// pow10: allow rule=10 until=YYYY-MM-DD owner=<handle> reason="..."