Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixable compiler warnings: math_helper.c #53

Open
dspdon opened this issue Aug 7, 2021 · 0 comments
Open

Fixable compiler warnings: math_helper.c #53

dspdon opened this issue Aug 7, 2021 · 0 comments

Comments

@dspdon
Copy link

dspdon commented Aug 7, 2021

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)
^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant