Skip to content

SAMD -Wtype-limits warnings in set_clock_disable (si5351.cpp:972, 984) #109

Open

Description

@NT7S

CI on the SAMD board (arduino:samd:mkrzero) reports two -Wtype-limits warnings in set_clock_disable():

src/si5351.cpp:972:10: warning: comparison is always true due to limited range of data type [-Wtype-limits]
src/si5351.cpp:984:10: warning: comparison is always true due to limited range of data type [-Wtype-limits]

Both lines test clk >= SI5351_CLK0. SI5351_CLK0 is 0, and on that toolchain the enum is unsigned, so the lower-bound check can never fail. These warnings existed before #108 and don't change behavior.

Suggested fix: drop the redundant clk >= SI5351_CLK0 comparisons, or compare as a signed or explicitly cast value. Then confirm the SAMD build is warning-free.

Found during the independent review of #108.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions