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]

Re: [RFA] fix for utils.c bool problem


On Thu, Feb 07, 2002 at 01:32:53PM -0800, Martin M. Hunt wrote:
> Am I the only one seeing this?  On three different build systems I am getting errors like
> 
> gcc -c -g -O2  -I/usr/include/v9  -I. -I../../src/gdb -I../../src/gdb/config -DHAVE_CONFIG_H -I../../src/gdb/../include/opcode -I../../src/gdb/../readline/.. -I../bfd -I../../src/gdb/../bfd  -I../../src/gdb/../include -I../intl -I../../src/gdb/../intl  -DMI_OUT=1 -DGDBTK -DUI_OUT=1 -Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized  ../../src/gdb/utils.c
> In file included from /usr/progressive/lib/gcc-lib/sparc-sun-solaris2.5/2.96-gnupro-00r1/include/curses.h:5,
>                  from ../../src/gdb/utils.c:30:
> /usr/include/curses.h:69: conflicting types for `_Bool'
> /usr/progressive/lib/gcc-lib/sparc-sun-solaris2.5/2.96-gnupro-00r1/include/stdbool.h:41: previous declaration of `_Bool'
> 
> Some newer versions of gcc apparently have stdbool.h improvements that 
> fix the problem.  Another fix is to simply reorder the patch, which fixes builds 
> on all of my systems (Windows, Linux, Solaris)

This is the patch I alluded to earlier today on binutils@.  It's not
quite complete, since TUI is also affected; I've attached mine.  I'm
quite surprised that this fixes the problem for you without the
corresponding bfd patch that I haven't committed yet!


-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

2002-02-07  Daniel Jacobowitz  <drow@mvista.com>

	* utils.c: Include <curses.h> before "bfd.h".
	* tui/tui-hooks.c: Likewise.
	* tui/tui.c: Likewise.
	* tui/tuiCommand.c: Likewise.
	* tui/tuiData.c: Likewise.
	* tui/tuiDataWin.c: Likewise.
	* tui/tuiDisassem.c: Likewise.
	* tui/tuiGeneralWin.c: Likewise.
	* tui/tuiIO.c: Likewise.
	* tui/tuiLayout.c: Likewise.
	* tui/tuiRegs.c: Likewise.
	* tui/tuiSource.c: Likewise.
	* tui/tuiSourceWin.c: Likewise.
	* tui/tuiStack.c: Likewise.
	* tui/tuiWin.c: Likewise.

Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.60
diff -u -p -r1.60 utils.c
--- utils.c	2002/02/02 15:39:33	1.60
+++ utils.c	2002/02/07 21:35:59
@@ -20,18 +20,22 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#include "defs.h"
-#include "gdb_assert.h"
-#include <ctype.h>
-#include "gdb_string.h"
-#include "event-top.h"
+#include "config.h"
 
+/* Include before "bfd.h" so that we get stdbool.h in time, if <curses.h>
+   brings it in.  */
 #ifdef HAVE_CURSES_H
 #include <curses.h>
 #endif
 #ifdef HAVE_TERM_H
 #include <term.h>
 #endif
+
+#include "defs.h"
+#include "gdb_assert.h"
+#include <ctype.h>
+#include "gdb_string.h"
+#include "event-top.h"
 
 #ifdef __GO32__
 #include <pc.h>
Index: tui/tui-hooks.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-hooks.c,v
retrieving revision 1.1
diff -u -p -r1.1 tui-hooks.c
--- tui-hooks.c	2001/07/24 20:40:39	1.1
+++ tui-hooks.c	2002/02/07 21:35:59
@@ -18,6 +18,16 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+/* If we need <curses.h>, we must include it before we get "bfd.h".  */
+#include "config.h"
+#ifdef HAVE_NCURSES_H
+#include <ncurses.h>
+#else
+#ifdef HAVE_CURSES_H
+#include <curses.h>
+#endif
+#endif
+
 #include "defs.h"
 #include "symtab.h"
 #include "inferior.h"
Index: tui/tui.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui.c,v
retrieving revision 1.14
diff -u -p -r1.14 tui.c
--- tui.c	2001/07/31 19:00:50	1.14
+++ tui.c	2002/02/07 21:35:59
@@ -19,6 +19,16 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+/* If we need <curses.h>, we must include it before we get "bfd.h".  */
+#include "config.h"
+#ifdef HAVE_NCURSES_H       
+#include <ncurses.h>
+#else
+#ifdef HAVE_CURSES_H
+#include <curses.h>
+#endif
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <ctype.h>
Index: tui/tuiCommand.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiCommand.c,v
retrieving revision 1.4
diff -u -p -r1.4 tuiCommand.c
--- tuiCommand.c	2001/07/20 22:17:49	1.4
+++ tuiCommand.c	2002/02/07 21:35:59
@@ -19,6 +19,16 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+/* If we need <curses.h>, we must include it before we get "bfd.h".  */
+#include "config.h"
+#ifdef HAVE_NCURSES_H       
+#include <ncurses.h>
+#else
+#ifdef HAVE_CURSES_H
+#include <curses.h>
+#endif
+#endif
+
 #include "defs.h"
 #include <ctype.h>
 #include "tui.h"
Index: tui/tuiData.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiData.c,v
retrieving revision 1.6
diff -u -p -r1.6 tuiData.c
--- tuiData.c	2001/07/20 23:06:48	1.6
+++ tuiData.c	2002/02/07 21:35:59
@@ -19,6 +19,16 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+/* If we need <curses.h>, we must include it before we get "bfd.h".  */
+#include "config.h"
+#ifdef HAVE_NCURSES_H       
+#include <ncurses.h>
+#else
+#ifdef HAVE_CURSES_H
+#include <curses.h>
+#endif
+#endif
+
 #include "defs.h"
 #include "tui.h"
 #include "tuiData.h"
Index: tui/tuiDataWin.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiDataWin.c,v
retrieving revision 1.4
diff -u -p -r1.4 tuiDataWin.c
--- tuiDataWin.c	2001/07/20 22:26:54	1.4
+++ tuiDataWin.c	2002/02/07 21:35:59
@@ -19,6 +19,16 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+/* If we need <curses.h>, we must include it before we get "bfd.h".  */
+#include "config.h"
+#ifdef HAVE_NCURSES_H       
+#include <ncurses.h>
+#else
+#ifdef HAVE_CURSES_H
+#include <curses.h>
+#endif
+#endif
+
 #include "defs.h"
 #include "tui.h"
 #include "tuiData.h"
Index: tui/tuiDisassem.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiDisassem.c,v
retrieving revision 1.10
diff -u -p -r1.10 tuiDisassem.c
--- tuiDisassem.c	2001/10/21 17:19:38	1.10
+++ tuiDisassem.c	2002/02/07 21:35:59
@@ -19,6 +19,16 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+/* If we need <curses.h>, we must include it before we get "bfd.h".  */
+#include "config.h"
+#ifdef HAVE_NCURSES_H       
+#include <ncurses.h>
+#else
+#ifdef HAVE_CURSES_H
+#include <curses.h>
+#endif
+#endif
+
 #include "defs.h"
 #include "symtab.h"
 #include "breakpoint.h"
Index: tui/tuiGeneralWin.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiGeneralWin.c,v
retrieving revision 1.7
diff -u -p -r1.7 tuiGeneralWin.c
--- tuiGeneralWin.c	2001/07/21 19:44:38	1.7
+++ tuiGeneralWin.c	2002/02/07 21:35:59
@@ -19,6 +19,16 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+/* If we need <curses.h>, we must include it before we get "bfd.h".  */
+#include "config.h"
+#ifdef HAVE_NCURSES_H       
+#include <ncurses.h>
+#else
+#ifdef HAVE_CURSES_H
+#include <curses.h>
+#endif
+#endif
+
 #include "defs.h"
 #include "tui.h"
 #include "tuiData.h"
Index: tui/tuiIO.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiIO.c,v
retrieving revision 1.10
diff -u -p -r1.10 tuiIO.c
--- tuiIO.c	2001/07/23 21:16:20	1.10
+++ tuiIO.c	2002/02/07 21:36:00
@@ -19,6 +19,16 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+/* If we need <curses.h>, we must include it before we get "bfd.h".  */
+#include "config.h"
+#ifdef HAVE_NCURSES_H       
+#include <ncurses.h>
+#else
+#ifdef HAVE_CURSES_H
+#include <curses.h>
+#endif
+#endif
+
 #include <stdio.h>
 #include "defs.h"
 #include "terminal.h"
Index: tui/tuiLayout.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiLayout.c,v
retrieving revision 1.13
diff -u -p -r1.13 tuiLayout.c
--- tuiLayout.c	2001/07/20 22:26:54	1.13
+++ tuiLayout.c	2002/02/07 21:36:00
@@ -19,6 +19,16 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+/* If we need <curses.h>, we must include it before we get "bfd.h".  */
+#include "config.h"
+#ifdef HAVE_NCURSES_H       
+#include <ncurses.h>
+#else
+#ifdef HAVE_CURSES_H
+#include <curses.h>
+#endif
+#endif
+
 #include "defs.h"
 #include "command.h"
 #include "symtab.h"
Index: tui/tuiRegs.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiRegs.c,v
retrieving revision 1.10
diff -u -p -r1.10 tuiRegs.c
--- tuiRegs.c	2001/07/21 19:46:59	1.10
+++ tuiRegs.c	2002/02/07 21:36:00
@@ -19,6 +19,16 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+/* If we need <curses.h>, we must include it before we get "bfd.h".  */
+#include "config.h"
+#ifdef HAVE_NCURSES_H       
+#include <ncurses.h>
+#else
+#ifdef HAVE_CURSES_H
+#include <curses.h>
+#endif
+#endif
+
 #include "defs.h"
 #include "tui.h"
 #include "tuiData.h"
Index: tui/tuiSource.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiSource.c,v
retrieving revision 1.7
diff -u -p -r1.7 tuiSource.c
--- tuiSource.c	2001/08/02 11:58:29	1.7
+++ tuiSource.c	2002/02/07 21:36:00
@@ -19,6 +19,16 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+/* If we need <curses.h>, we must include it before we get "bfd.h".  */
+#include "config.h"
+#ifdef HAVE_NCURSES_H       
+#include <ncurses.h>
+#else
+#ifdef HAVE_CURSES_H
+#include <curses.h>
+#endif
+#endif
+
 #include "defs.h"
 #include <ctype.h>
 #include "symtab.h"
Index: tui/tuiSourceWin.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiSourceWin.c,v
retrieving revision 1.9
diff -u -p -r1.9 tuiSourceWin.c
--- tuiSourceWin.c	2001/10/21 17:19:38	1.9
+++ tuiSourceWin.c	2002/02/07 21:36:00
@@ -19,6 +19,16 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+/* If we need <curses.h>, we must include it before we get "bfd.h".  */
+#include "config.h"
+#ifdef HAVE_NCURSES_H       
+#include <ncurses.h>
+#else
+#ifdef HAVE_CURSES_H
+#include <curses.h>
+#endif
+#endif
+
 #include "defs.h"
 #include <ctype.h>
 #include "symtab.h"
Index: tui/tuiStack.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiStack.c,v
retrieving revision 1.11
diff -u -p -r1.11 tuiStack.c
--- tuiStack.c	2001/07/23 21:13:57	1.11
+++ tuiStack.c	2002/02/07 21:36:00
@@ -19,6 +19,16 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+/* If we need <curses.h>, we must include it before we get "bfd.h".  */
+#include "config.h"
+#ifdef HAVE_NCURSES_H       
+#include <ncurses.h>
+#else
+#ifdef HAVE_CURSES_H
+#include <curses.h>
+#endif
+#endif
+
 #include "defs.h"
 #include "symtab.h"
 #include "breakpoint.h"
Index: tui/tuiWin.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiWin.c,v
retrieving revision 1.17
diff -u -p -r1.17 tuiWin.c
--- tuiWin.c	2002/02/02 00:56:37	1.17
+++ tuiWin.c	2002/02/07 21:36:00
@@ -24,6 +24,16 @@
 
    Author: Susan B. Macchia  */
 
+/* If we need <curses.h>, we must include it before we get "bfd.h".  */
+#include "config.h"
+#ifdef HAVE_NCURSES_H       
+#include <ncurses.h>
+#else
+#ifdef HAVE_CURSES_H
+#include <curses.h>
+#endif
+#endif
+
 #include <string.h>
 #include <ctype.h>
 #include "defs.h"


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