bug-grep
[Top][All Lists]
Advanced

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

avoid gcc 4.6.2 'may be used before set' warnings in dfa.c


From: Aharon Robbins
Subject: avoid gcc 4.6.2 'may be used before set' warnings in dfa.c
Date: Wed, 15 Feb 2012 20:54:05 +0200
User-agent: Heirloom mailx 12.4 7/29/08

Hi.  I just applied the below to gawk's dfa.c.

Thanks,

Arnold
---------------------------
diff --git a/dfa.c b/dfa.c
index 64ce8f7..2bce294 100644
--- a/dfa.c
+++ b/dfa.c
@@ -876,7 +876,7 @@ static token
 parse_bracket_exp (void)
 {
   int invert;
-  int c, c1, c2;
+  int c = 0, c1 = 0, c2 = 0;
   charclass ccl;
 
   /* Used to warn about [:space:].
@@ -886,8 +886,8 @@ parse_bracket_exp (void)
      Bit 3 = includes ranges, char/equiv classes or collation elements.  */
   int colon_warning_state;
 
-  wint_t wc;
-  wint_t wc2;
+  wint_t wc = 0;
+  wint_t wc2 = 0;
   wint_t wc1 = 0;
 
   /* Work area to build a mb_char_classes.  */



reply via email to

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