[PATCH] gcc/doc: Clarify warning for variable unused
Jakub Jelinek
jakub@redhat.com
Mon May 4 17:22:28 GMT 2026
On Fri, May 01, 2026 at 09:40:49AM -0400, Nathan Myers wrote:
> [Guessing this should be in the 16.x branch too.]
>
> In the www gcc-16/porting_to, two lines in comment text on
> the example code for -Wunused-variable was changed from
> "pre/postincrement used" to "pre/postincrement result used".
> Approval there directs that the change should be propagated
> back to the texi source the example came from. This is that
> propagation.
>
> gcc/Changelog:
> * doc/invoke.texi: insert "result" in comment text
> ---
> gcc/doc/invoke.texi | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
LGTM, both for trunk and 16.2.
Thanks.
> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
> index bebe20c5e0b..63e1a3bbc56 100644
> --- a/gcc/doc/invoke.texi
> +++ b/gcc/doc/invoke.texi
> @@ -8319,10 +8319,10 @@ void foo (void)
> int f = 0; // No warning, f used
> int g = f = 5;
> (void) g;
> - int h = 0; // No warning, preincrement used
> + int h = 0; // No warning, preincrement result used
> int i = ++h;
> (void) i;
> - int j = 0; // No warning, postdecrement used
> + int j = 0; // No warning, postdecrement result used
> int k = j--;
> (void) k;
> int l = 0; // No warning, l used
> --
> 2.53.0
Jakub
More information about the Libstdc++
mailing list