Repository navigation
C++: Add support for C23 _BitInts - #22816
Conversation
dbffbf5 to
9ee4d74
Compare
2961468 to
3aebb27
Compare
3aebb27 to
41fe11e
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Numeric consumers still confuse storage size with declared precision, and the downgrade emits an undefined type kind.
2 open findings
What changed in this PR
Adds C23 _BitInt(N) representation to CodeQL’s C/C++ schema and type library.
Changes:
- Adds bit-precise integer kinds and declared bit widths.
- Extends integral-type classification and width-preserving mappings.
- Adds schema migration files and a feature note.
| File | Description |
|---|---|
| cpp/ql/lib/upgrades/0853f43dc8c08deecb473c54a2b70da8597f1ab5/upgrade.properties | Declares upgrade compatibility. |
| cpp/ql/lib/upgrades/0853f43dc8c08deecb473c54a2b70da8597f1ab5/old.dbscheme | Records the pre-upgrade schema. |
| cpp/ql/lib/semmlecode.cpp.dbscheme | Adds integer kinds and bit-width metadata. |
| cpp/ql/lib/semmle/code/cpp/Type.qll | Exposes bit-precise types and mappings. |
| cpp/ql/lib/change-notes/2026-10-14-bitint.md | Announces the feature. |
| cpp/downgrades/6aec212e408fad907b19368a3376a4d9837783d2/upgrade.properties | Configures downgrade transformations. |
| cpp/downgrades/6aec212e408fad907b19368a3376a4d9837783d2/semmlecode.cpp.dbscheme | Records the downgrade target schema. |
| cpp/downgrades/6aec212e408fad907b19368a3376a4d9837783d2/old.dbscheme | Records the downgrade source schema. |
| cpp/downgrades/6aec212e408fad907b19368a3376a4d9837783d2/builtintypes.ql | Maps new kinds for older schemas. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| or | ||
| kind = 51 | ||
| or | ||
| 67 <= kind and kind <= 69 |
There was a problem hiding this comment.
This is correct, and might produce some FP/FN, but this does not seem worth fixing at this point given that we have not seen any real world use of _BitInt.
I'll do a follow-up to address this.
e9cbd1c to
75d1cb9
Compare
geoffw0
left a comment
There was a problem hiding this comment.
LGTM. Copilot reckons Padding.qll could do with some attention after this change, which looks plausible but I'm not sure what that file is used for.
It looks like it's only used in |

No description provided.