All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] avoid gcc warning: variable 'oldstackp' set but not used
@ 2011-05-23  8:20 Jim Meyering
  2011-07-08  8:12 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Jim Meyering @ 2011-05-23  8:20 UTC (permalink / raw)
  To: dash

Compiling with gcc-4.6.0, I noticed a new warning.
This fixes it:


From 6c4c5e33e9143946335e2adc952ea250e474926b Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Mon, 23 May 2011 10:18:27 +0200
Subject: [PATCH] avoid gcc warning: variable 'oldstackp' set but not used

* src/memalloc.c (growstackblock): Remove declaration and set of
set-but-not-used variable.  Also remove a stray space-before-TAB.

Signed-off-by: Jim Meyering <meyering@redhat.com>
---
 ChangeLog      |    6 ++++++
 src/memalloc.c |    4 +---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 50a8044..56c5c3f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-05-23  Jim Meyering  <meyering@redhat.com>
+
+	avoid gcc warning: variable 'oldstackp' set but not used
+	* src/memalloc.c (growstackblock): Remove declaration and set of
+	set-but-not-used variable.  Also remove a stray space-before-TAB.
+
 2011-03-15  Herbert Xu <herbert@gondor.apana.org.au>

 	* Fix clobbering of checkkwd.
diff --git a/src/memalloc.c b/src/memalloc.c
index e75e609..9fea067 100644
--- a/src/memalloc.c
+++ b/src/memalloc.c
@@ -206,20 +206,18 @@ growstackblock(void)
 {
 	size_t newlen;

- 	newlen = stacknleft * 2;
+	newlen = stacknleft * 2;
 	if (newlen < stacknleft)
 		sh_error("Out of space");
 	if (newlen < 128)
 		newlen += 128;

 	if (stacknxt == stackp->space && stackp != &stackbase) {
-		struct stack_block *oldstackp;
 		struct stack_block *sp;
 		struct stack_block *prevstackp;
 		size_t grosslen;

 		INTOFF;
-		oldstackp = stackp;
 		sp = stackp;
 		prevstackp = sp->prev;
 		grosslen = newlen + sizeof(struct stack_block) - MINSIZE;
--
1.7.5.2.1.g56b30

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] avoid gcc warning: variable 'oldstackp' set but not used
  2011-05-23  8:20 [PATCH] avoid gcc warning: variable 'oldstackp' set but not used Jim Meyering
@ 2011-07-08  8:12 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2011-07-08  8:12 UTC (permalink / raw)
  To: Jim Meyering; +Cc: dash

On Mon, May 23, 2011 at 08:20:12AM +0000, Jim Meyering wrote:
> Compiling with gcc-4.6.0, I noticed a new warning.
> This fixes it:

Patch applied.  Thanks Jim!
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-08  8:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-23  8:20 [PATCH] avoid gcc warning: variable 'oldstackp' set but not used Jim Meyering
2011-07-08  8:12 ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.