Skip to content

Fixable compiler warnings: math_helper.c #53

@dspdon

Description

@dspdon

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

Metadata

Metadata

Assignees

Labels

ArduinoCore-samdLabel for ArduinoCore-samdUAYUnassigned yet

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions