[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: branch-1_4 pacify gcc -Wall
From: |
Eric Blake |
Subject: |
FYI: branch-1_4 pacify gcc -Wall |
Date: |
Sun, 28 May 2006 04:23:05 +0000 |
Compiler warnings are annoying when they can be easily fixed.
The fixes in lib may be overwritten if we upgrade those files
from newer versions available in gnulib, but for now this
was easier than converting the project to use automake (since
gnulib wants automake).
2006-05-27 Eric Blake <address@hidden>
* lib/regex.c (regex_compile): Kill compiler warnings.
* lib/getopt.c: Likewise.
* lib/obstack.c: Likewise.
* src/builtin.c (builtin_init): Likewise.
* src/path.c (path_search): Likewise.
Index: lib/getopt.c
===================================================================
RCS file: /sources/m4/m4/lib/Attic/getopt.c,v
retrieving revision 1.1.1.1.2.1
diff -u -p -r1.1.1.1.2.1 getopt.c
--- lib/getopt.c 1 May 2005 11:54:12 -0000 1.1.1.1.2.1
+++ lib/getopt.c 28 May 2006 04:22:02 -0000
@@ -41,6 +41,7 @@
#endif
#include <stdio.h>
+#include <string.h>
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself. This code is part of the GNU C
Index: lib/obstack.c
===================================================================
RCS file: /sources/m4/m4/lib/Attic/obstack.c,v
retrieving revision 1.1.1.1.2.1
diff -u -p -r1.1.1.1.2.1 obstack.c
--- lib/obstack.c 1 May 2005 11:54:12 -0000 1.1.1.1.2.1
+++ lib/obstack.c 28 May 2006 04:22:02 -0000
@@ -23,6 +23,7 @@
/* This is just to get __GNU_LIBRARY__ defined. */
#include <stdio.h>
+#include <stdlib.h>
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself. This code is part of the GNU C
Index: lib/regex.c
===================================================================
RCS file: /sources/m4/m4/lib/Attic/regex.c,v
retrieving revision 1.1.1.1.2.3
diff -u -p -r1.1.1.1.2.3 regex.c
--- lib/regex.c 1 May 2005 11:54:12 -0000 1.1.1.1.2.3
+++ lib/regex.c 28 May 2006 04:22:04 -0000
@@ -3,7 +3,7 @@
(Implements POSIX draft P10003.2/D11.2, except for
internationalization features.)
- Copyright (C) 1993, 1994 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -2057,10 +2057,12 @@ regex_compile (pattern, size, syntax, bu
if (syntax & RE_NO_BK_PARENS) goto normal_backslash;
if (COMPILE_STACK_EMPTY)
- if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
- goto normal_backslash;
- else
- FREE_STACK_RETURN (REG_ERPAREN);
+ {
+ if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
+ goto normal_backslash;
+ else
+ FREE_STACK_RETURN (REG_ERPAREN);
+ }
handle_close:
if (fixup_alt_jump)
@@ -2077,10 +2079,12 @@ regex_compile (pattern, size, syntax, bu
/* See similar code for backslashed left paren above. */
if (COMPILE_STACK_EMPTY)
- if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
- goto normal_char;
- else
- FREE_STACK_RETURN (REG_ERPAREN);
+ {
+ if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
+ goto normal_char;
+ else
+ FREE_STACK_RETURN (REG_ERPAREN);
+ }
/* Since we just checked for an empty stack above, this
``can't happen''. */
Index: src/builtin.c
===================================================================
RCS file: /sources/m4/m4/src/Attic/builtin.c,v
retrieving revision 1.1.1.1.2.3
diff -u -p -r1.1.1.1.2.3 builtin.c
--- src/builtin.c 1 May 2005 11:54:12 -0000 1.1.1.1.2.3
+++ src/builtin.c 28 May 2006 04:22:04 -0000
@@ -231,16 +231,18 @@ builtin_init (void)
for (bp = &builtin_tab[0]; bp->name != NULL; bp++)
if (!no_gnu_extensions || !bp->gnu_extension)
- if (prefix_all_builtins)
- {
- string = (char *) xmalloc (strlen (bp->name) + 4);
- strcpy (string, "m4_");
- strcat (string, bp->name);
- define_builtin (string, bp, SYMBOL_INSERT, FALSE);
- free (string);
- }
- else
- define_builtin (bp->name, bp, SYMBOL_INSERT, FALSE);
+ {
+ if (prefix_all_builtins)
+ {
+ string = (char *) xmalloc (strlen (bp->name) + 4);
+ strcpy (string, "m4_");
+ strcat (string, bp->name);
+ define_builtin (string, bp, SYMBOL_INSERT, FALSE);
+ free (string);
+ }
+ else
+ define_builtin (bp->name, bp, SYMBOL_INSERT, FALSE);
+ }
for (pp = &predefined_tab[0]; pp->func != NULL; pp++)
if (no_gnu_extensions)
Index: src/path.c
===================================================================
RCS file: /sources/m4/m4/src/Attic/path.c,v
retrieving revision 1.1.1.1.2.2
diff -u -p -r1.1.1.1.2.2 path.c
--- src/path.c 1 May 2005 11:54:12 -0000 1.1.1.1.2.2
+++ src/path.c 28 May 2006 04:22:04 -0000
@@ -1,6 +1,6 @@
/* GNU m4 -- A simple macro processor
- Copyright (C) 1989, 1990, 1991, 1992, 1993, 2004 Free Software
+ Copyright (C) 1989, 1990, 1991, 1992, 1993, 2004, 2006 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -134,7 +134,7 @@ path_search (const char *dir)
if (fp != NULL)
{
if (debug_level & DEBUG_TRACE_PATH)
- DEBUG_MESSAGE (("path search for `%s' found `%s'", dir, name));
+ DEBUG_MESSAGE2 ("path search for `%s' found `%s'", dir, name);
break;
}
}
- FYI: branch-1_4 pacify gcc -Wall,
Eric Blake <=