Skip to content

Commit 775021b

Browse files
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_013XvhPzhCAZGQ9qniMY1YQY
1 parent 504cae1 commit 775021b

7 files changed

Lines changed: 423 additions & 393 deletions

File tree

ext/rbs_extension/extconf.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
'-Wimplicit-fallthrough',
1717
'-Wunused-result',
1818
'-Wc++-compat',
19+
'-Wnullable-to-nonnull-conversion',
1920
]
2021

2122
if ENV['DEBUG']

0 commit comments

Comments
 (0)