coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[coreutils] [PATCH] maint: suppress a bogus used-uninitialized warning i


From: Jim Meyering
Subject: [coreutils] [PATCH] maint: suppress a bogus used-uninitialized warning in tr.c
Date: Fri, 01 Oct 2010 11:24:25 +0200

Without this, I'd get

  cc1: warnings being treated as errors
  tr.c: In function 'main':
  tr.c:1400: warning: 'char_to_repeat' may be used uninitialized in this 
function


>From eee0f260f489140e054eea54a01424e0d56a16f7 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Fri, 1 Oct 2010 11:07:23 +0200
Subject: [PATCH] maint: suppress a bogus used-uninitialized warning in tr.c

* src/tr.c (string2_extend): Insert an abort call to tell
gcc that char_to_repeat is not used uninitialized.
---
 src/tr.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/tr.c b/src/tr.c
index 479d3d3..eae9687 100644
--- a/src/tr.c
+++ b/src/tr.c
@@ -1420,6 +1420,7 @@ string2_extend (const struct Spec_list *s1, struct 
Spec_list *s2)
       error (EXIT_FAILURE, 0,
              _("when translating with string1 longer than string2,\n\
 the latter string must not end with a character class"));
+      abort (); /* inform gcc that the above use of error never returns. */
       break;

     case RE_REPEATED_CHAR:
--
1.7.3.1.45.g9855b



reply via email to

[Prev in Thread] Current Thread [Next in Thread]