ridiculousfish / libdivide

Official git repository for libdivide: optimized integer division
http://libdivide.com
Other
1.1k stars 79 forks source link

Division by 0 causes non-AVR mcus hang #112

Closed gdiciocco closed 10 months ago

gdiciocco commented 10 months ago

Division by 0 on non-AVR mcus causes libdivide call abort() which ends up in a noreturn

https://github.com/noisymime/speeduino/issues/1162

kimwalisch commented 10 months ago

This is correct behavior.

If you don't like this behavior you can add an if check to your code to handle 0 dividers differently (before using libdivide).

adbancroft commented 10 months ago

We discussed this on the Speeduino Discourse and pretty much agreed this is a bug in client code, with no reasonable fix on the libdivide end.

I think this can be closed @gdiciocco ?

gdiciocco commented 10 months ago

Sure, I raised the issue because AVR is the only microcontroller family receiving a custom treatment. If this matches the plans (and at the same time makes sense as we saw on discord) no reason to keep the issue open anymore. Ty!