git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] sh-18n: quell "unused variable" warning

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
May 25, 2011, 09:55 UTC
Message-ID
<62c2e1619edcb37c0411f29a34b6bc10e3899a97.1306317312.git.git@drmicha.warpmail.net>
    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
Next: Junio C Hamano
Message 1 of 5 in “sh-18n: quell "unused variable" warning”
  1. sh-18n: quell "unused variable" warningMichael J Gruber, May 25, 2011
  2. Junio C HamanoMay 25, 2011
  3. Ævar Arnfjörð BjarmasonMay 25, 2011
  4. Michael J GruberMay 26, 2011
  5. Ævar Arnfjörð BjarmasonMay 26, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.