On Mon, Jan 19, 2026 at 03:57:08PM +0100, Josef Melcr wrote:
> +<!-- introduced in 0eac9cfee8cb0b21de866a04d5d59685ab35208f -->
> +
> +<p>
> +Since GCC 16, <code>-Wunused-but-set-*</code> warning options no longer
> +consider preincrements and postincrements as uses, which may lead to
> +compilation failures when using <code>-Werror</code>.
> +</p>

That IMHO doesn't describe the change correctly (the change wasn't by
-Wall/-W default only about pre/post increments but also about var @= expr)
and more importantly, doesn't tell users what they should do.

The PR44677 change simply changed the -Wunused-but-set-* warnings to
have multiple levels and the old options as well as defaults implied
by -Wall or -W default to the =3 level, while the GCC 15 and earlier
provided level was equivalent to the =1 level.
Usually porting_to.html shows some code snippet, describes what changed
and suggests what to do.
I think this porting_to.html entry should refer to
https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-but-set-variable_003d
and maybe https://gcc.gnu.org/PR44677 , show the code example
mentioned in the documentation and suggest users that they can either
remove the unused but set variables/parameters to fix the warnings,
or make them used e.g. through (void) casts, or if some project generally
likes the previous behavior, lower the level to -Wunused-but-set-variable=1
or similar.

        Jakub

Reply via email to