This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

more cygwin warnings


OK to apply?

2007-05-29  Eric Blake  <ebb9@byu.net>

	Avoid more compiler warnings.
	* libc/stdlib/btowc.c: Add missing header.
	* libc/stdlib/getopt.c (getopt_internal): Initialize variable.
	* libc/stdlib/system.c (do_system) [__CYGWIN__]: Add declaration.
	* libc/stdlib/wctob.c: Add missing header.
	* libc/string/strcpy.c (strcpy): Avoid warnings.
	* libc/string/strrchr.c (strrchr): Likewise.

Index: libc/stdlib/btowc.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdlib/btowc.c,v
retrieving revision 1.1
diff -u -p -r1.1 btowc.c
--- libc/stdlib/btowc.c	23 Aug 2002 01:56:04 -0000	1.1
+++ libc/stdlib/btowc.c	29 May 2007 21:18:11 -0000
@@ -2,6 +2,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <reent.h>
+#include <string.h>
 
 wint_t
 btowc (int c)
Index: libc/stdlib/getopt.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdlib/getopt.c,v
retrieving revision 1.2
diff -u -p -r1.2 getopt.c
--- libc/stdlib/getopt.c	4 Jan 2006 21:21:52 -0000	1.2
+++ libc/stdlib/getopt.c	29 May 2007 21:18:11 -0000
@@ -153,7 +153,7 @@ getopt_internal (int argc, char *const a
   char *possible_arg = NULL;
   int longopt_match = -1;
   int has_arg = -1;
-  char *cp;
+  char *cp = NULL;
   int arg_next = 0;
 
   /* first, deal with silly parameters and easy stuff */
Index: libc/stdlib/system.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdlib/system.c,v
retrieving revision 1.7
diff -u -p -r1.7 system.c
--- libc/stdlib/system.c	29 Apr 2002 21:49:56 -0000	1.7
+++ libc/stdlib/system.c	29 May 2007 21:18:11 -0000
@@ -179,6 +179,7 @@ do_system (ptr, s)
     return -1;
   else
     {
+      extern int _wait (int *);
       int rc = _wait (&status);
       if (rc == -1)
 	return -1;
Index: libc/stdlib/wctob.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdlib/wctob.c,v
retrieving revision 1.2
diff -u -p -r1.2 wctob.c
--- libc/stdlib/wctob.c	5 Dec 2003 06:13:43 -0000	1.2
+++ libc/stdlib/wctob.c	29 May 2007 21:18:11 -0000
@@ -2,6 +2,7 @@
 #include <wchar.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 
 int
 wctob (wint_t c)
Index: libc/string/strcpy.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/string/strcpy.c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 strcpy.c
--- libc/string/strcpy.c	17 Feb 2000 19:39:48 -0000	1.1.1.1
+++ libc/string/strcpy.c	29 May 2007 21:18:11 -0000
@@ -92,7 +92,7 @@ _DEFUN (strcpy, (dst0, src0),
       src = (char*)aligned_src;
     }
 
-  while (*dst++ = *src++)
+  while ((*dst++ = *src++))
     ;
   return dst0;
 #endif /* not PREFER_SIZE_OVER_SPEED */
Index: libc/string/strrchr.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/string/strrchr.c,v
retrieving revision 1.2
diff -u -p -r1.2 strrchr.c
--- libc/string/strrchr.c	4 May 2001 17:23:18 -0000	1.2
+++ libc/string/strrchr.c	29 May 2007 21:18:11 -0000
@@ -44,7 +44,7 @@ _DEFUN (strrchr, (s, i),
 
   if (i)
     {
-      while (s=strchr(s, i))
+      while ((s=strchr(s, i)))
 	{
 	  last = s;
 	  s++;



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]