Closed spaetz closed 1 year ago
Could you check that adding __builtin_unreachable();
after the switch
makes the warning go away?
Will do and report back...
-------- Ursprüngliche Nachricht -------- Von: Jesse Rosenstock @.> Gesendet: 17. November 2022 09:40:51 MEZ An: google/s2geometry @.> CC: Sebastian Spaeth @.>, Author @.> Betreff: Re: [google/s2geometry] Build warning: s2winding_operation.cc:413:1: warning: control reaches end of non-void function (Issue #280)
Could you check that adding __builtin_unreachable();
after the switch
makes the warning go away?
-- Reply to this email directly or view it on GitHub: https://github.com/google/s2geometry/issues/280#issuecomment-1318279649 You are receiving this because you authored the thread.
Message ID: @.***> -- Sent from mobile device.
and it silences the build warning just fine and compiles. I have not tested running the code.
Thanks for the quick patch. This will be fixed by adding an S2_INTERNAL_UNREACHABLE
macro when we do the next code push, so that will break your patch. I'll update this bug when we do that.
Fixed by #297.
Compiler warns about
And indeed, if winding were a different value than POS, NEG, ODD or NON_ZERO, we would return void, so a catchall return is needed to make the compiler happy. Perhaps return False if we fall through?