[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI - branch-1_4 compiler warnings
From: |
Eric Blake |
Subject: |
FYI - branch-1_4 compiler warnings |
Date: |
Wed, 07 Jun 2006 03:53:03 +0000 |
I've been compiling with CFLAGS='-g -Wall', but apparently there
are some things that gcc can only warn about at -O2. Committed:
2006-06-06 Eric Blake <address@hidden>
* lib/regex.c (re_match_2_internal, bcmp_translate): Avoid
compiler warnings at -O2.
* lib/getopt.c (_getopt_internal): Likewise.
Index: lib/getopt.c
===================================================================
RCS file: /sources/m4/m4/lib/Attic/getopt.c,v
retrieving revision 1.1.1.1.2.3
diff -u -p -r1.1.1.1.2.3 getopt.c
--- lib/getopt.c 31 May 2006 22:54:13 -0000 1.1.1.1.2.3
+++ lib/getopt.c 7 Jun 2006 03:50:20 -0000
@@ -475,7 +475,7 @@ _getopt_internal (argc, argv, optstring,
const struct option *pfound = NULL;
int exact = 0;
int ambig = 0;
- int indfound;
+ int indfound = 0;
int option_index;
for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
Index: lib/regex.c
===================================================================
RCS file: /sources/m4/m4/lib/Attic/regex.c,v
retrieving revision 1.1.1.1.2.4
diff -u -p -r1.1.1.1.2.4 regex.c
--- lib/regex.c 28 May 2006 04:24:01 -0000 1.1.1.1.2.4
+++ lib/regex.c 7 Jun 2006 03:50:21 -0000
@@ -3421,7 +3421,7 @@ re_match_2_internal (bufp, string1, size
stopped matching the regnum-th subexpression. (The zeroth register
keeps track of what the whole pattern matches.) */
#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */
- const char **regstart, **regend;
+ const char **regstart = NULL, **regend = NULL;
#endif
/* If a group that's operated upon by a repetition operator fails to
@@ -3430,7 +3430,7 @@ re_match_2_internal (bufp, string1, size
are when we last see its open-group operator. Similarly for a
register's end. */
#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */
- const char **old_regstart, **old_regend;
+ const char **old_regstart = NULL, **old_regend = NULL;
#endif
/* The is_active field of reg_info helps us keep track of which (possibly
@@ -3440,7 +3440,7 @@ re_match_2_internal (bufp, string1, size
subexpression. These two fields get reset each time through any
loop their register is in. */
#ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global. */
- register_info_type *reg_info;
+ register_info_type *reg_info = NULL;
#endif
/* The following record the register info as found in the above
@@ -3449,7 +3449,7 @@ re_match_2_internal (bufp, string1, size
turn happens only if we have not yet matched the entire string. */
unsigned best_regs_set = false;
#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */
- const char **best_regstart, **best_regend;
+ const char **best_regstart = NULL, **best_regend = NULL;
#endif
/* Logically, this is `best_regend[0]'. But we don't want to have to
@@ -3464,8 +3464,8 @@ re_match_2_internal (bufp, string1, size
/* Used when we pop values we don't care about. */
#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */
- const char **reg_dummy;
- register_info_type *reg_info_dummy;
+ const char **reg_dummy = NULL;
+ register_info_type *reg_info_dummy = NULL;
#endif
#ifdef DEBUG
@@ -4890,11 +4890,11 @@ common_op_match_null_string_p (p, end, r
static int
bcmp_translate (s1, s2, len, translate)
- unsigned char *s1, *s2;
+ unsigned const char *s1, *s2;
register int len;
char *translate;
{
- register unsigned char *p1 = s1, *p2 = s2;
+ register const unsigned char *p1 = s1, *p2 = s2;
while (len)
{
if (translate[*p1++] != translate[*p2++]) return 1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI - branch-1_4 compiler warnings,
Eric Blake <=