git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: git@vger.kernel.org
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Junio C Hamano" <gitster@pobox.com>
Subject: [PATCH] sh-18n: quell "unused variable" warning
Date: Wed, 25 May 2011 11:55:43 +0200	[thread overview]
Message-ID: <62c2e1619edcb37c0411f29a34b6bc10e3899a97.1306317312.git.git@drmicha.warpmail.net> (raw)

    CC sh-i18n--envsubst.o
sh-i18n--envsubst.c: In Funktion »main«:
sh-i18n--envsubst.c:71:22: Warnung: Variable »show_variables« gesetzt,
aber nicht verwendet [-Wunused-but-set-variable]

show_variables is indeed unused. Comment it out rather than remove it so
that the relation with upstream remains clear.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
Why is it that even with LANG=C exported, gcc gives localized warnings?

And yes, I'm on gcc 4.6 now (F15)...
---
 sh-i18n--envsubst.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sh-i18n--envsubst.c b/sh-i18n--envsubst.c
index 7125093..2eb0ee4 100644
--- a/sh-i18n--envsubst.c
+++ b/sh-i18n--envsubst.c
@@ -68,7 +68,7 @@ int
 main (int argc, char *argv[])
 {
   /* Default values for command line options.  */
-  unsigned short int show_variables = 0;
+  /* unsigned short int show_variables = 0; */
 
   switch (argc)
 	{
@@ -88,7 +88,7 @@ main (int argc, char *argv[])
 	  /* git sh-i18n--envsubst --variables '$foo and $bar' */
 	  if (strcmp(argv[1], "--variables"))
 		error ("first argument must be --variables when two are given");
-	  show_variables = 1;
+	  /* show_variables = 1; */
       print_variables (argv[2]);
 	  break;
 	default:
-- 
1.7.5.2.639.gce8e1

             reply	other threads:[~2011-05-25  9:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-25  9:55 Michael J Gruber [this message]
2011-05-25 16:35 ` [PATCH] sh-18n: quell "unused variable" warning Junio C Hamano
2011-05-25 23:33 ` Ævar Arnfjörð Bjarmason
2011-05-26 13:03   ` Michael J Gruber
2011-05-26 13:46     ` Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=62c2e1619edcb37c0411f29a34b6bc10e3899a97.1306317312.git.git@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).