EmbeddedNim / picostdlib

Nim wrapper for the raspberry pi stdlib
MIT License
70 stars 11 forks source link

Suppress gcc warnings when compiling nim sources #56

Closed auxym closed 1 year ago

auxym commented 1 year ago

Resolves #55

  1. With Nim 1.6.8, the warnings appear no matter whether --cpu:arm is passed on the command line or not. I assume this is a fix to harmonize behavior between config and command line flags.

  2. I asked Araq on Discord, and the incompatible pointer type warnings are expected and not an issue.

  3. Nim itself, when it invokes gcc, always passes the -w flag which suppresses all warnings.

Therefore, I propose to imitate the Nim compiler behavior and pass -w to gcc for all Nim-generated C files. This is implemented via a set_source_file_properties in the CMake file and only affects the Nim-generated sources, not the other (pico SDK, external libs, etc) C source files.

Yes, I could have lived with warnings, but I like my terminal output clean and pretty looking 🙃.