Seeed-Studio / ArduinoCore-samd

49 stars 27 forks source link

Fixable compiler warnings: math_helper.c #53

Closed dspdon closed 4 weeks ago

dspdon commented 3 years ago

I build with full warnings, and found a few places where small changes can remove compile warnings.

There are 2 compiler warnings coming from math_helper.c: https://github.com/Seeed-Studio/ArduinoCore-samd/blob/master/cores/arduino/math_helper.c

These 2 warnings are copied below. I can submit a PR if that's the best approach, but wanted to first check if the primary dev team wishes to address these directly.

There are a few correctness issues in these and other conversion functions in math_helper.c that do not generate compile warnings, for values/ranges where perhaps the functions aren't being used today. Where are the functions in this file being used?

--Don

C:\Users\don\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.8.2\cores\arduino\math_helper.c: In function 'arm_compare_fixed_q15': C:\Users\don\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.8.2\cores\arduino\math_helper.c:175:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if(diffCrnt > maxDiff) ^ C:\Users\don\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.8.2\cores\arduino\math_helper.c: In function 'arm_compare_fixed_q31': C:\Users\don\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.8.2\cores\arduino\math_helper.c:203:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if(diffCrnt > maxDiff) ^

Lesords commented 1 month ago

Hello,

I'm very sorry to have kept you waiting so long.

Do you still have this problem now?

Lesords commented 4 weeks ago

Hello,

I\'m going to close this issue, feel free to re-open it if you have any other questions.

[Autocommentary]