Commit e52f6798

e52f6798e3d9Merged

Yukihiro "Matz" Matsumoto <[email protected]> · 5 months ago · 1 file · ~1 modified

Description

Keep ir_set_sa_ivar int-typed with a trailing return value

After ivar-write expressions began typing by the ivar slot rather than the int default, ir_set_sa_ivar's @compiler_state_classes = val branches type as str_array while its else (compiler_state_set_sa) returns int. The method's return slot then unified to sp_StrArray *, so the int return tripped -Wint-conversion in the self-host build (gcc warns, clang -Werror fails: build/codegen1.c). The return value is unused; a trailing 0 keeps the slot int and makes all paths agree.

Co-Authored-By: Claude Opus 4.8 [email protected]

Details

Commit
e52f6798e3d9
Parent
0693c84d88d4

spinel_codegen.rbmodifiedView file

@@ -54158,6 +54158,12 @@
5415854158 else
5415954159 compiler_state_set_sa(name, val)
5416054160 end
54161+ # Return a plain int: the value is unused, and without a consistent
54162+ # tail the method's return type unifies the str_array ivar-write
54163+ # branches with the int compiler_state_set_sa call -> the slot gets
54164+ # typed sp_StrArray * and the int return trips -Wint-conversion
54165+ # (gcc warns, clang -Werror fails on the self-host build).
54166+ 0
5416154167 end
5416254168
5416354169 def ir_set_ia_ivar(name, val)