pavelmc/Si5351mcu

Fixing compiler warnings when using library?

nyanpasu64 opened this issue · 0 comments

When I upgraded https://github.com/ramapcsx2/gbs-control to the latest library 0.7.1 (cbbd806) and built it in Arduino v1's "Compiler warnings: All" mode, I got many new warnings originating from this library.

I found that the library's header file includes useless const qualifiers on return types, as well as non-pointer scalars (useless in forward-declarations but not definitions), which trigger compiler warnings. Additionally, the source file reg_bank_26 etc. includes bit-shifted integers in a uint8_t array.

I've tried fixing the warnings in my vendored copy, at ramapcsx2/gbs-control#440. I decided to remove unnecessary consts in the header, and suppress -Wnarrowing in the source file rather than fixing the warnings, because adding uint8_t casts was visually harder to read and edit (making the code worse than before).

I also removed trailing whitespace in that PR. Is this something you want to fix upstream to cleanup the code formatting, or leave it in to avoid creating large diffs?