mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 17:33:08 +08:00
b859f2750b
Probably this is a bug of a GCC, but on AMRv7 the code "if (relax_factor > 1)" generates "bne.n" instruction if "relax_factor" is "int". Few lines above "relax_factor *= LOG_RELAX_MULTIPLIER;" is done without overflow check hence at some moment overflow occurs and "relax_factor" becomes a zero and condition "if (relax_factor > 1)" becomes always evaluated to "true" hence "epsilon" becomes zero always. Probably this is not the best way to fix the bug (The best way is to report it to GCC), but this change allows to get correct behavior of "log" and "logf" for ARMv7 based MCUs Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>