Commit 08a59b5
committed
DOC: Add compiler-cautions.md with pitfalls
Distilled from review of 1,296+ COMP: commits (2019-2026), GitHub PR
review comments, and CDash failure analysis. Covers:
- Smart pointer / forward-declared type hazards (GCC 7-9.1 brace-init
bug, destructor-in-header UB with unique_ptr<Incomplete>)
- Template deduction pitfalls (missing typename, non-type param type
mismatch, constexpr static ODR-use in lambdas)
- constexpr edge cases (MSVC x86 if constexpr, function pointer arrays)
- Undefined behavior patterns (bit shift overflow, implicit truncation,
empty-vector data(), uninitialized loop vars)
- Platform specifics (char signedness on ARM, missing <cstdint> on
GCC 13+, reserved identifiers on AppleClang)
- GCC warnings (-Wmaybe-uninitialized false positives on ARM64,
-Wdeprecated-copy Rule of Zero violations)
- MSVC C4805 bool/int mixing, constexpr arrays
- Clang suppression macros for third-party headers
- ITK deprecated API replacements (ITK_LEGACY_REMOVE=ON breaks)
- Shared library symbol visibility (ITK_TEMPLATE_EXPORT)
- Python binding removals (np.bool, PySequence_Fast_GET_ITEM)
- 13-item refactoring checklist
Add routing entry to AGENTS.md table.
Document that refactoring should not introduce new clang-tidy diagnostics,
and enumerate check families that conflict with ITK coding standards
(llvmlibc-*, readability-identifier-length, google-*, etc.).
AI agents must consult compiler-cautions.md, compile the changed
module, and run relevant tests before committing C++ code.
Update AGENTS.md routing row for commit tasks to surface these docs.1 parent 89df941 commit 08a59b5
File tree
3 files changed
+560
-1
lines changed- Documentation/AI
3 files changed
+560
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
0 commit comments