translate_c: fix ternary operator output in C macros#24664
Conversation
|
This version of translate-c is going to be deleted in favor of ziglang/translate-c: #24497. You should contribute this there instead. |
Per this comment: #24546 (comment), maybe let's see if this can land in 0.15? |
|
Will this work if the |
This doesn't support other scalar types yet. It's also necessary to improve the ternary operator translation in normal (non-macro) code, which currently also uses the |
|
Any possibilities for this to be merged by the next minor version? |
|
@Vexu if this is indeed intended for 0.15.2, can you review it? |
|
The fix looks good and should be non-breaking but since my priority is ziglang/translate-c I don't care too much about it making it to 0.15.2. The issue should remain open/be transferred if this is merged since this is also broken in the new implementation. |
|
@cmpute can you please retarget the PR against the |
|
@alexrp Could you please provide some guidance on how to add translate-c test in the latest master? I can't find where are those translate-c test cases |
|
master uses https://github.com/ziglang/translate-c |
|
Thanks, I'll close this then. But feel free to submit a PR to https://github.com/ziglang/translate-c if the bug still exists on master though. |
this is a fix for ziglang/translate-c#44 . Basically it tries to wrap all the conditions in ternary operation with a zero check.