Re: -Wall

Liviu Ionescu <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>

> On 19 Jan 2024, at 14:55, Corinna Vinschen <[email protected]> wrote:
> 
> ... I'd like to suggest to add -Wall by default to the
> build flags for newlib, just as it is already for ages in the Cygwin
> tree.
> 
> Anybody having a strong opinion, pro or contra?

For my own code I run all tests with `-Werror -Wall` and as many extra `-fxxx` options I can (trying to emulate the LLVM/clang `-feverything`). This usually requires a combination of code edits and pragmas to silence some warnings, which may be tedious, but it gives me some peace of mind when my code is integrated in various build environments.

However, when I make binary distributions using someone else code (*), I find compiler warnings less useful (read annoying), since there is not much I can do to fix them.

For the newlib configure, if not already available, I suggest you implement `--enable-warnings`/`--disable-warnings` and `--enable-werror`/`--disable-werror`.

The default are usually disabled, but are not that relevant; for my builds I generally use explicit `--disable-warnings --disable-werror` when available.

But for your CI tests, sure, enable `-Wall` and try to fix the code to clear all warnings, using the latest toolchains.


Regards,

Liviu


(*) I maintain the xPack binary cross-platform distributions of arm-none-eabi-gcc and riscv-none-elf-gcc, which also include newlib.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.