Ternary expression?
Ternary expression?
Posted Oct 1, 2024 6:38 UTC (Tue) by milian.wolff (guest, #153128)In reply to: Ternary expression? by Paf
Parent article: Coccinelle for Rust
Posted Oct 1, 2024 13:34 UTC (Tue)
by Paf (subscriber, #91811)
[Link] (3 responses)
So the particular example is perhaps poorly chosen as it has an extremely close equivalent in C.
Posted Oct 1, 2024 13:44 UTC (Tue)
by daroc (editor, #160859)
[Link] (2 responses)
Posted Oct 2, 2024 11:29 UTC (Wed)
by khim (subscriber, #9252)
[Link]
We are not talking arbitrary C code, though, we are talking about kernel. In Linux kernel, of course, it's not just possible, it's routine, there are many macros that exploit that ability.
Posted Oct 3, 2024 14:16 UTC (Thu)
by Paf (subscriber, #91811)
[Link]
Ternary expression?
Ternary expression?
> Maybe it would help to point out that in Rust you can have things like while loops inside if expressions, which isn't really possible with C ternary expressions.
Ternary expression?
Ternary expression?