Skip to content

Suggestion: add additional compiler warnings #3134

@martinbudden

Description

@martinbudden

Any projects using the arduino-pico library are limited in setting their compiler warnings: they cannot set a compiler warning if arduino-pico generates that warning.

In my projects I like to turn warnings up to 11, but find that I am limited in what warnings I can set depending on what libraries I include.

arduino-pico is actually pretty good in that respect: it causes few addional warnings (-Wdouble-promotion was one exception).

I think the following compiler warnings could all be switched on:
arduino-pico does not fail with any of those warnings.
The reason for switching them on is so that the warnings were not inadvertently violated at some point in the future.

(Note that -Wall and -Wextra miss out quite a few warnings, hence the fairly long list).

-Werror
-Wall
-Wextra
-Wattributes
-Wdisabled-optimization
-Wdouble-promotion
-Wignored-qualifiers
-Wimplicit-fallthrough
-Wnarrowing
-Wsign-compare
-Wstrict-aliasing
-Wtrampolines
-Wunsafe-loop-optimizations
-Wunreachable-code
-Wunused-function

arduino-pico causes the following warnings in a few places, but it is a fairly small number of places and it would not take much work to be
able to switch on these warnings:

-Wmissing-declarations
-Wshadow
-Wunused-parameter 
-Wunused-value
-Wmissing-noreturn

The following warnings are violated by SD fat. I've made some PRs there to address -Wfloat-conversion, and it appears that -Wmissing-field-initializers is already being addressed.

-Wstrict-aliasing
-Wfloat-conversion
-Wmissing-field-initializers

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions