[PATCH] gcc/doc: Clarify warning for variable unused

Nathan Myers ncm@cantrip.org
Fri May 1 13:40:49 GMT 2026


[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(-)

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



More information about the Libstdc++ mailing list