This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[obv] Fix -Wmissing-prototypes build
- From: Yao Qi <yao at codesourcery dot com>
- To: <gdb-patches at sourceware dot org>
- Date: Fri, 2 Mar 2012 19:41:18 +0800
- Subject: [obv] Fix -Wmissing-prototypes build
I still see build failures in gdb native build on i386-linux, and
cross build for i386-mingw32. This patch is to fix these build failures.
Will commit it.
--
Yao (éå)
gdb/
Fix -Wmissing-prototypes build.
* charset.c (phony_iconv_open): Make static.
(phony_iconv_close, phony_iconv): Likewise.
* i386-linux-nat.c (_initialize_i386_linux_nat): New prototype.
* i386-windows-nat.c (_initialize_i386_windows_nat): New
prototype.
* mingw-hdep.c (_initialize_mingw_hdep): New prototype.
* ser-mingw.c (create_select_thread): Make static.
* windows-termcap.c (tgetent): New prototype.
(tgetnum, tgetflag, tgetstr, tputs, tgoto): Likewise.
Index: charset.c
===================================================================
RCS file: /cvs/src/src/gdb/charset.c,v
retrieving revision 1.48
diff -u -r1.48 charset.c
--- charset.c 7 Feb 2012 15:42:39 -0000 1.48
+++ charset.c 2 Mar 2012 11:28:56 -0000
@@ -108,7 +108,7 @@
#define EILSEQ ENOENT
#endif
-iconv_t
+static iconv_t
phony_iconv_open (const char *to, const char *from)
{
/* We allow conversions from UTF-32BE, wchar_t, and the host charset.
@@ -124,13 +124,13 @@
return !strcmp (from, "UTF-32BE");
}
-int
+static int
phony_iconv_close (iconv_t arg)
{
return 0;
}
-size_t
+static size_t
phony_iconv (iconv_t utf_flag, const char **inbuf, size_t *inbytesleft,
char **outbuf, size_t *outbytesleft)
{
Index: i386-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-linux-nat.c,v
retrieving revision 1.111
diff -u -r1.111 i386-linux-nat.c
--- i386-linux-nat.c 24 Jan 2012 13:46:54 -0000 1.111
+++ i386-linux-nat.c 2 Mar 2012 11:28:57 -0000
@@ -1008,6 +1008,9 @@
return tdesc_i386_linux;
}
+/* -Wmissing-prototypes */
+extern initialize_file_ftype _initialize_i386_linux_nat;
+
void
_initialize_i386_linux_nat (void)
{
Index: i386-windows-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-windows-nat.c,v
retrieving revision 1.7
diff -u -r1.7 i386-windows-nat.c
--- i386-windows-nat.c 4 Jan 2012 08:17:04 -0000 1.7
+++ i386-windows-nat.c 2 Mar 2012 11:28:57 -0000
@@ -70,6 +70,9 @@
};
#undef context_offset
+/* -Wmissing-prototypes */
+extern initialize_file_ftype _initialize_i386_windows_nat;
+
void
_initialize_i386_windows_nat (void)
{
Index: mingw-hdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mingw-hdep.c,v
retrieving revision 1.13
diff -u -r1.13 mingw-hdep.c
--- mingw-hdep.c 4 Jan 2012 08:17:06 -0000 1.13
+++ mingw-hdep.c 2 Mar 2012 11:28:58 -0000
@@ -251,6 +251,9 @@
SetEvent (sigint_event);
}
+/* -Wmissing-prototypes */
+extern initialize_file_ftype _initialize_mingw_hdep;
+
void
_initialize_mingw_hdep (void)
{
Index: ser-mingw.c
===================================================================
RCS file: /cvs/src/src/gdb/ser-mingw.c,v
retrieving revision 1.31
diff -u -r1.31 ser-mingw.c
--- ser-mingw.c 4 Jan 2012 08:17:10 -0000 1.31
+++ ser-mingw.c 2 Mar 2012 11:28:59 -0000
@@ -428,7 +428,7 @@
/* Create a new select thread for SCB executing THREAD_FN. The STATE
will be filled in by this function before return. */
-void
+static void
create_select_thread (thread_fn_type thread_fn,
struct serial *scb,
struct ser_console_state *state)
Index: windows-termcap.c
===================================================================
RCS file: /cvs/src/src/gdb/windows-termcap.c,v
retrieving revision 1.10
diff -u -r1.10 windows-termcap.c
--- windows-termcap.c 4 Jan 2012 08:27:58 -0000 1.10
+++ windows-termcap.c 2 Mar 2012 11:28:59 -0000
@@ -21,6 +21,14 @@
#include <stdlib.h>
+/* -Wmissing-prototypes */
+extern int tgetent (char *buffer, char *termtype);
+extern int tgetnum (char *name);
+extern int tgetflag (char *name);
+extern char* tgetstr (char *name, char **area);
+extern int tputs (char *string, int nlines, int (*outfun) ());
+extern char *tgoto (const char *cap, int col, int row);
+
/* Each of the files below is a minimal implementation of the standard
termcap function with the same name, suitable for use in a Windows
console window. */