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

Fixing compiler warnings when using library? #15

Open
nyanpasu64 opened this issue Mar 14, 2023 · 0 comments
Open

Fixing compiler warnings when using library? #15

nyanpasu64 opened this issue Mar 14, 2023 · 0 comments

Comments

@nyanpasu64
Copy link

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?

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