Commit 775021b
committed
Add Clang nullability annotations (RBS_NULLABLE/RBS_NONNULL) to C AST
Add RBS_NULLABLE and RBS_NONNULL macros that expand to _Nullable/_Nonnull
on Clang and to nothing on other compilers. Annotate all pointer fields
in generated AST structs and constructor functions based on their
optionality defined in config.yml, and hand-written list/hash data
structures in ast.h/ast.c.
Also enable -Wnullable-to-nonnull-conversion in extconf.rb so that
Clang warns when a nullable pointer is implicitly passed to a nonnull
parameter.
https://claude.ai/code/session_013XvhPzhCAZGQ9qniMY1YQY1 parent 504cae1 commit 775021b
7 files changed
Lines changed: 423 additions & 393 deletions
File tree
- ext/rbs_extension
- include/rbs
- src
- templates
- include/rbs
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
0 commit comments