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


> Current.  But for Debian that's a somewhat meaningless distinction;
> probably a quarter or more of the Debian users run current.  The
> package in question will be in the next release, hopefully in a few
> months.
> 
> 
> Assuming the changes are in :-(  Can you please at least create bug reports (one for utils and one for TUI I guess) to track the problems. Can you please also add a FIXME: drow/2002-02-03: explaining the rationale behind the hack (especially mention the GNU/Linux variant) and how it should be fixed properly.


FYI, I've checked in the attached.

Andrew


2002-03-01  Andrew Cagney  <ac131313@redhat.com>

	* utils.c: Add FIXME explaining true/false problem.

Index: tui/ChangeLog
2002-03-01  Andrew Cagney  <ac131313@redhat.com>

	* tui-hooks.c: Add FIXME to explain true/false problem.  Update
	copyright.
	* tui.c, tuiCommand.c, tuiData.c, tuiDataWin.c: Ditto.
	* tuiDisassem.c, tuiGeneralWin.c, tuiIO.c, tuiLayout.c: Ditto.
	* tuiRegs.c, tuiSource.c, tuiSourceWin.c, tuiStack.c: Ditto.
	* tuiWin.c: Ditto.

	2002-02-08  Daniel Jacobowitz  <drow@mvista.com>
	* tui-hooks.c: Include <curses.h> before "bfd.h".
	* tui.c: Likewise.
	* tuiCommand.c: Likewise.
	* tuiData.c: Likewise.
	* tuiDataWin.c: Likewise.
	* tuiDisassem.c: Likewise.
	* tuiGeneralWin.c: Likewise.
	* tuiIO.c: Likewise.
	* tuiLayout.c: Likewise.
	* tuiRegs.c: Likewise.
	* tuiSource.c: Likewise.
	* tuiSourceWin.c: Likewise.
	* tuiStack.c: Likewise.
	* tuiWin.c: Likewise.

Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.67
diff -u -r1.67 utils.c
--- utils.c	2002/02/27 12:29:43	1.67
+++ utils.c	2002/03/01 05:45:41
@@ -20,10 +20,16 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that
+   "defs.h" should be included first.  Unfortunatly some systems
+   (currently Debian GNU/Linux) include the <stdbool.h> via <curses.h>
+   and they clash with "bfd.h"'s definiton of true/false.  The correct
+   fix is to remove true/false from "bfd.h", however, until that
+   happens, hack around it by including "config.h" and <curses.h>
+   first.  */
+
 #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
Index: tui/tui-hooks.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-hooks.c,v
retrieving revision 1.2
diff -u -r1.2 tui-hooks.c
--- tui-hooks.c	2002/02/08 15:54:31	1.2
+++ tui-hooks.c	2002/03/01 05:45:48
@@ -1,6 +1,7 @@
 /* GDB hooks for TUI.
-   Copyright 2001 Free Software Foundation, Inc.
 
+   Copyright 2001, 2002 Free Software Foundation, Inc.
+
    This file is part of GDB.
 
    This program is free software; you can redistribute it and/or modify
@@ -17,8 +18,15 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
+
+/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that
+   "defs.h" should be included first.  Unfortunatly some systems
+   (currently Debian GNU/Linux) include the <stdbool.h> via <curses.h>
+   and they clash with "bfd.h"'s definiton of true/false.  The correct
+   fix is to remove true/false from "bfd.h", however, until that
+   happens, hack around it by including "config.h" and <curses.h>
+   first.  */
 
-/* If we need <curses.h>, we must include it before we get "bfd.h".  */
 #include "config.h"
 #ifdef HAVE_NCURSES_H
 #include <ncurses.h>
Index: tui/tui.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui.c,v
retrieving revision 1.15
diff -u -r1.15 tui.c
--- tui.c	2002/02/08 15:54:32	1.15
+++ tui.c	2002/03/01 05:45:48
@@ -1,5 +1,8 @@
 /* General functions for the WDB TUI.
-   Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation,
+   Inc.
+
    Contributed by Hewlett-Packard Company.
 
    This file is part of GDB.
@@ -18,8 +21,15 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
+
+/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that
+   "defs.h" should be included first.  Unfortunatly some systems
+   (currently Debian GNU/Linux) include the <stdbool.h> via <curses.h>
+   and they clash with "bfd.h"'s definiton of true/false.  The correct
+   fix is to remove true/false from "bfd.h", however, until that
+   happens, hack around it by including "config.h" and <curses.h>
+   first.  */
 
-/* If we need <curses.h>, we must include it before we get "bfd.h".  */
 #include "config.h"
 #ifdef HAVE_NCURSES_H       
 #include <ncurses.h>
Index: tui/tuiCommand.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiCommand.c,v
retrieving revision 1.5
diff -u -r1.5 tuiCommand.c
--- tuiCommand.c	2002/02/08 15:54:32	1.5
+++ tuiCommand.c	2002/03/01 05:45:48
@@ -1,5 +1,8 @@
 /* Specific command window processing.
-   Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation,
+   Inc.
+
    Contributed by Hewlett-Packard Company.
 
    This file is part of GDB.
@@ -18,8 +21,15 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
+
+/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that
+   "defs.h" should be included first.  Unfortunatly some systems
+   (currently Debian GNU/Linux) include the <stdbool.h> via <curses.h>
+   and they clash with "bfd.h"'s definiton of true/false.  The correct
+   fix is to remove true/false from "bfd.h", however, until that
+   happens, hack around it by including "config.h" and <curses.h>
+   first.  */
 
-/* If we need <curses.h>, we must include it before we get "bfd.h".  */
 #include "config.h"
 #ifdef HAVE_NCURSES_H       
 #include <ncurses.h>
Index: tui/tuiData.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiData.c,v
retrieving revision 1.7
diff -u -r1.7 tuiData.c
--- tuiData.c	2002/02/08 15:54:32	1.7
+++ tuiData.c	2002/03/01 05:45:49
@@ -1,5 +1,8 @@
 /* TUI data manipulation routines.
-   Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation,
+   Inc.
+
    Contributed by Hewlett-Packard Company.
 
    This file is part of GDB.
@@ -18,8 +21,15 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
+
+/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that
+   "defs.h" should be included first.  Unfortunatly some systems
+   (currently Debian GNU/Linux) include the <stdbool.h> via <curses.h>
+   and they clash with "bfd.h"'s definiton of true/false.  The correct
+   fix is to remove true/false from "bfd.h", however, until that
+   happens, hack around it by including "config.h" and <curses.h>
+   first.  */
 
-/* If we need <curses.h>, we must include it before we get "bfd.h".  */
 #include "config.h"
 #ifdef HAVE_NCURSES_H       
 #include <ncurses.h>
Index: tui/tuiDataWin.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiDataWin.c,v
retrieving revision 1.5
diff -u -r1.5 tuiDataWin.c
--- tuiDataWin.c	2002/02/08 15:54:32	1.5
+++ tuiDataWin.c	2002/03/01 05:45:49
@@ -1,5 +1,8 @@
 /* Data/register window display.
-   Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation,
+   Inc.
+
    Contributed by Hewlett-Packard Company.
 
    This file is part of GDB.
@@ -18,8 +21,15 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
+
+/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that
+   "defs.h" should be included first.  Unfortunatly some systems
+   (currently Debian GNU/Linux) include the <stdbool.h> via <curses.h>
+   and they clash with "bfd.h"'s definiton of true/false.  The correct
+   fix is to remove true/false from "bfd.h", however, until that
+   happens, hack around it by including "config.h" and <curses.h>
+   first.  */
 
-/* If we need <curses.h>, we must include it before we get "bfd.h".  */
 #include "config.h"
 #ifdef HAVE_NCURSES_H       
 #include <ncurses.h>
Index: tui/tuiDisassem.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiDisassem.c,v
retrieving revision 1.11
diff -u -r1.11 tuiDisassem.c
--- tuiDisassem.c	2002/02/08 15:54:32	1.11
+++ tuiDisassem.c	2002/03/01 05:45:49
@@ -1,5 +1,8 @@
 /* Disassembly display.
-   Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation,
+   Inc.
+
    Contributed by Hewlett-Packard Company.
 
    This file is part of GDB.
@@ -18,8 +21,15 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
+
+/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that
+   "defs.h" should be included first.  Unfortunatly some systems
+   (currently Debian GNU/Linux) include the <stdbool.h> via <curses.h>
+   and they clash with "bfd.h"'s definiton of true/false.  The correct
+   fix is to remove true/false from "bfd.h", however, until that
+   happens, hack around it by including "config.h" and <curses.h>
+   first.  */
 
-/* If we need <curses.h>, we must include it before we get "bfd.h".  */
 #include "config.h"
 #ifdef HAVE_NCURSES_H       
 #include <ncurses.h>
Index: tui/tuiGeneralWin.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiGeneralWin.c,v
retrieving revision 1.8
diff -u -r1.8 tuiGeneralWin.c
--- tuiGeneralWin.c	2002/02/08 15:54:32	1.8
+++ tuiGeneralWin.c	2002/03/01 05:45:49
@@ -1,5 +1,8 @@
 /* General window behavior.
-   Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation,
+   Inc.
+
    Contributed by Hewlett-Packard Company.
 
    This file is part of GDB.
@@ -18,8 +21,15 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
+
+/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that
+   "defs.h" should be included first.  Unfortunatly some systems
+   (currently Debian GNU/Linux) include the <stdbool.h> via <curses.h>
+   and they clash with "bfd.h"'s definiton of true/false.  The correct
+   fix is to remove true/false from "bfd.h", however, until that
+   happens, hack around it by including "config.h" and <curses.h>
+   first.  */
 
-/* If we need <curses.h>, we must include it before we get "bfd.h".  */
 #include "config.h"
 #ifdef HAVE_NCURSES_H       
 #include <ncurses.h>
Index: tui/tuiIO.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiIO.c,v
retrieving revision 1.11
diff -u -r1.11 tuiIO.c
--- tuiIO.c	2002/02/08 15:54:32	1.11
+++ tuiIO.c	2002/03/01 05:45:49
@@ -1,5 +1,8 @@
 /* TUI support I/O functions.
-   Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation,
+   Inc.
+
    Contributed by Hewlett-Packard Company.
 
    This file is part of GDB.
@@ -18,8 +21,15 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
+
+/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that
+   "defs.h" should be included first.  Unfortunatly some systems
+   (currently Debian GNU/Linux) include the <stdbool.h> via <curses.h>
+   and they clash with "bfd.h"'s definiton of true/false.  The correct
+   fix is to remove true/false from "bfd.h", however, until that
+   happens, hack around it by including "config.h" and <curses.h>
+   first.  */
 
-/* If we need <curses.h>, we must include it before we get "bfd.h".  */
 #include "config.h"
 #ifdef HAVE_NCURSES_H       
 #include <ncurses.h>
Index: tui/tuiLayout.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiLayout.c,v
retrieving revision 1.14
diff -u -r1.14 tuiLayout.c
--- tuiLayout.c	2002/02/08 15:54:32	1.14
+++ tuiLayout.c	2002/03/01 05:45:52
@@ -1,5 +1,8 @@
 /* TUI layout window management.
-   Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation,
+   Inc.
+
    Contributed by Hewlett-Packard Company.
 
    This file is part of GDB.
@@ -18,8 +21,15 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
+
+/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that
+   "defs.h" should be included first.  Unfortunatly some systems
+   (currently Debian GNU/Linux) include the <stdbool.h> via <curses.h>
+   and they clash with "bfd.h"'s definiton of true/false.  The correct
+   fix is to remove true/false from "bfd.h", however, until that
+   happens, hack around it by including "config.h" and <curses.h>
+   first.  */
 
-/* If we need <curses.h>, we must include it before we get "bfd.h".  */
 #include "config.h"
 #ifdef HAVE_NCURSES_H       
 #include <ncurses.h>
Index: tui/tuiRegs.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiRegs.c,v
retrieving revision 1.11
diff -u -r1.11 tuiRegs.c
--- tuiRegs.c	2002/02/08 15:54:32	1.11
+++ tuiRegs.c	2002/03/01 05:45:53
@@ -1,5 +1,8 @@
 /* TUI display registers in window.
-   Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation,
+   Inc.
+
    Contributed by Hewlett-Packard Company.
 
    This file is part of GDB.
@@ -18,8 +21,15 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
+
+/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that
+   "defs.h" should be included first.  Unfortunatly some systems
+   (currently Debian GNU/Linux) include the <stdbool.h> via <curses.h>
+   and they clash with "bfd.h"'s definiton of true/false.  The correct
+   fix is to remove true/false from "bfd.h", however, until that
+   happens, hack around it by including "config.h" and <curses.h>
+   first.  */
 
-/* If we need <curses.h>, we must include it before we get "bfd.h".  */
 #include "config.h"
 #ifdef HAVE_NCURSES_H       
 #include <ncurses.h>
Index: tui/tuiSource.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiSource.c,v
retrieving revision 1.8
diff -u -r1.8 tuiSource.c
--- tuiSource.c	2002/02/08 15:54:32	1.8
+++ tuiSource.c	2002/03/01 05:45:53
@@ -1,5 +1,8 @@
 /* TUI display source window.
-   Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation,
+   Inc.
+
    Contributed by Hewlett-Packard Company.
 
    This file is part of GDB.
@@ -18,8 +21,15 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
+
+/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that
+   "defs.h" should be included first.  Unfortunatly some systems
+   (currently Debian GNU/Linux) include the <stdbool.h> via <curses.h>
+   and they clash with "bfd.h"'s definiton of true/false.  The correct
+   fix is to remove true/false from "bfd.h", however, until that
+   happens, hack around it by including "config.h" and <curses.h>
+   first.  */
 
-/* If we need <curses.h>, we must include it before we get "bfd.h".  */
 #include "config.h"
 #ifdef HAVE_NCURSES_H       
 #include <ncurses.h>
Index: tui/tuiSourceWin.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiSourceWin.c,v
retrieving revision 1.10
diff -u -r1.10 tuiSourceWin.c
--- tuiSourceWin.c	2002/02/08 15:54:32	1.10
+++ tuiSourceWin.c	2002/03/01 05:45:53
@@ -1,5 +1,8 @@
 /* TUI display source/assembly window.
-   Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation,
+   Inc.
+
    Contributed by Hewlett-Packard Company.
 
    This file is part of GDB.
@@ -18,8 +21,15 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
+
+/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that
+   "defs.h" should be included first.  Unfortunatly some systems
+   (currently Debian GNU/Linux) include the <stdbool.h> via <curses.h>
+   and they clash with "bfd.h"'s definiton of true/false.  The correct
+   fix is to remove true/false from "bfd.h", however, until that
+   happens, hack around it by including "config.h" and <curses.h>
+   first.  */
 
-/* If we need <curses.h>, we must include it before we get "bfd.h".  */
 #include "config.h"
 #ifdef HAVE_NCURSES_H       
 #include <ncurses.h>
Index: tui/tuiStack.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiStack.c,v
retrieving revision 1.12
diff -u -r1.12 tuiStack.c
--- tuiStack.c	2002/02/08 15:54:32	1.12
+++ tuiStack.c	2002/03/01 05:45:53
@@ -1,5 +1,8 @@
 /* TUI display locator.
-   Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation,
+   Inc.
+
    Contributed by Hewlett-Packard Company.
 
    This file is part of GDB.
@@ -18,8 +21,15 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
+
+/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that
+   "defs.h" should be included first.  Unfortunatly some systems
+   (currently Debian GNU/Linux) include the <stdbool.h> via <curses.h>
+   and they clash with "bfd.h"'s definiton of true/false.  The correct
+   fix is to remove true/false from "bfd.h", however, until that
+   happens, hack around it by including "config.h" and <curses.h>
+   first.  */
 
-/* If we need <curses.h>, we must include it before we get "bfd.h".  */
 #include "config.h"
 #ifdef HAVE_NCURSES_H       
 #include <ncurses.h>
Index: tui/tuiWin.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiWin.c,v
retrieving revision 1.18
diff -u -r1.18 tuiWin.c
--- tuiWin.c	2002/02/08 15:54:32	1.18
+++ tuiWin.c	2002/03/01 05:45:54
@@ -1,5 +1,8 @@
 /* TUI window generic functions.
-   Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation,
+   Inc.
+
    Contributed by Hewlett-Packard Company.
 
    This file is part of GDB.
@@ -23,8 +26,15 @@
    like resize, scrolling, scrolling, changing focus, etc.
 
    Author: Susan B. Macchia  */
+
+/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that
+   "defs.h" should be included first.  Unfortunatly some systems
+   (currently Debian GNU/Linux) include the <stdbool.h> via <curses.h>
+   and they clash with "bfd.h"'s definiton of true/false.  The correct
+   fix is to remove true/false from "bfd.h", however, until that
+   happens, hack around it by including "config.h" and <curses.h>
+   first.  */
 
-/* If we need <curses.h>, we must include it before we get "bfd.h".  */
 #include "config.h"
 #ifdef HAVE_NCURSES_H       
 #include <ncurses.h>

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