This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB 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]

[5.2.1] quiet warnings for gdbreplay.c


OK to apply?

2002-06-27  David O'Brien  <obrien@FreeBSD.org>

	* gdbserver/gdbreplay.c:  Include stdlib.h, unistd.h, and string.h
	if they exist.  Static'ize internal functions to quiet warnings.

Index: gdbserver/gdbreplay.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/gdbreplay.c,v
retrieving revision 1.4.10.1
diff -u -r1.4.10.1 gdbreplay.c
--- gdbserver/gdbreplay.c	29 Mar 2002 19:03:34 -0000	1.4.10.1
+++ gdbserver/gdbreplay.c	28 Jun 2002 03:46:28 -0000
@@ -30,6 +30,15 @@
 #include <ctype.h>
 #include <fcntl.h>
 #include <errno.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 
 /* Sort of a hack... */
 #define EOL (EOF - 1)
@@ -40,7 +49,7 @@
    as the file name for which the error was encountered.
    Then return to command level.  */
 
-void
+static void
 perror_with_name (char *string)
 {
 #ifndef STDC_HEADERS
@@ -71,7 +80,7 @@
   exit (1);
 }
 
-void
+static void
 remote_close (void)
 {
   close (remote_desc);
@@ -80,10 +89,12 @@
 /* Open a connection to a remote debugger.
    NAME is the filename used for communication.  */
 
-void
+static void
 remote_open (char *name)
 {
+#ifndef HAVE_STRING_H
   extern char *strchr ();
+#endif
 
   if (!strchr (name, ':'))
     {
@@ -230,7 +241,7 @@
 /* Accept input from gdb and match with chars from fp (after skipping one
    blank) up until a \n is read from fp (which is not matched) */
 
-void
+static void
 expect (FILE *fp)
 {
   int fromlog;
@@ -261,7 +272,7 @@
 /* Play data back to gdb from fp (after skipping leading blank) up until a
    \n is read from fp (which is discarded and not sent to gdb). */
 
-void
+static void
 play (FILE *fp)
 {
   int fromlog;


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