Lexical code transformer?
Lexical code transformer?
Posted Sep 30, 2024 23:32 UTC (Mon) by rywang014 (guest, #167182)Parent article: Coccinelle for Rust
Posted Oct 1, 2024 9:17 UTC (Tue)
by matthias (subscriber, #94967)
[Link] (1 responses)
I do not see at all that the task for C is simpler than for rust. To the contrary. If the adding of '?' in rust code is syntactically correct, i.e., if the compiler is happy, then it is most likely also semantically correct. If a call site does not have the proper return type itself, the compiler will notice that the error is not handled. If the resulting code just compiles then there already is error handling for the specific error type.
Of course, there is still the possibility that the error is not handled correctly, as the error path might not have been tested at all. It might just have been dead code. But this is not different to C.
Posted Oct 1, 2024 15:28 UTC (Tue)
by roc (subscriber, #30627)
[Link]
Lexical code transformer?
Lexical code transformer?