xxgdb (1.12-17) 010-gcc-wall

Summary

 calldbx.c    |    1 
 calldbx.h    |   73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 command.c    |    7 +++--
 dbx.c        |    3 +-
 filemenu.c   |    1 
 gdb_parser.c |    1 
 regex.c      |   20 +++++++++++-----
 signals.c    |    1 
 source.c     |    2 -
 windows.c    |    2 -
 windows.h    |   70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 xdbx.c       |    5 +++-
 xxgdbiowin.c |   10 +++++++-
 13 files changed, 180 insertions(+), 16 deletions(-)

    
download this patch

Patch contents

#! /bin/sh /usr/share/dpatch/dpatch-run
## 010-gcc-wall.dpatch by Joey Schulze <joey@infodrom.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Clean up code so that it is -Wall clean

@DPATCH@
diff -urNad xxgdb~/calldbx.c xxgdb/calldbx.c
--- xxgdb~/calldbx.c	2008-05-17 10:05:14.000000000 +0200
+++ xxgdb/calldbx.c	2008-05-17 10:05:14.000000000 +0200
@@ -112,7 +112,6 @@
 static XtInputId	dbxInputId;		/* dbx input id */
 #ifndef SVR4				/* (MJH) */
 static char 	pty[11] = "/dev/pty??";	/* master side of pseudo-terminal */
-static char 	tty[11] = "/dev/tty??";	/* slave side of pseudo-terminal */
 #endif /* SVR4 */
 extern char	*dbxprompt;
 
diff -urNad xxgdb~/calldbx.h xxgdb/calldbx.h
--- xxgdb~/calldbx.h	1970-01-01 01:00:00.000000000 +0100
+++ xxgdb/calldbx.h	2008-05-17 10:05:14.000000000 +0200
@@ -0,0 +1,73 @@
+/*****************************************************************************
+ *
+ *  xdbx - X Window System interface to the dbx debugger
+ *
+ *  Copyright 1989 The University of Texas at Austin
+ *  Copyright 1990 Microelectronics and Computer Technology Corporation
+ *
+ *  Permission to use, copy, modify, and distribute this software and its
+ *  documentation for any purpose and without fee is hereby granted,
+ *  provided that the above copyright notice appear in all copies and that
+ *  both that copyright notice and this permission notice appear in
+ *  supporting documentation, and that the name of The University of Texas
+ *  and Microelectronics and Computer Technology Corporation (MCC) not be 
+ *  used in advertising or publicity pertaining to distribution of
+ *  the software without specific, written prior permission.  The
+ *  University of Texas and MCC makes no representations about the 
+ *  suitability of this software for any purpose.  It is provided "as is" 
+ *  without express or implied warranty.
+ *
+ *  THE UNIVERSITY OF TEXAS AND MCC DISCLAIMS ALL WARRANTIES WITH REGARD TO
+ *  THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ *  FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF TEXAS OR MCC BE LIABLE FOR
+ *  ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ *  Author:  	Po Cheung
+ *  Created:   	March 10, 1989
+ * 
+ *****************************************************************************
+ * 
+ *  xxgdb - X Window System interface to the gdb debugger
+ *  
+ * 	Copyright 1990,1993 Thomson Consumer Electronics, Inc.
+ *  
+ *  Permission to use, copy, modify, and distribute this software and its
+ *  documentation for any purpose and without fee is hereby granted,
+ *  provided that the above copyright notice appear in all copies and that
+ *  both that copyright notice and this permission notice appear in
+ *  supporting documentation, and that the name of Thomson Consumer
+ *  Electronics (TCE) not be used in advertising or publicity pertaining
+ *  to distribution of the software without specific, written prior
+ *  permission.  TCE makes no representations about the suitability of
+ *  this software for any purpose.  It is provided "as is" without express
+ *  or implied warranty.
+ *
+ *  TCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ *  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
+ *  SHALL TCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ *  SOFTWARE.
+ *
+ *****************************************************************************/
+
+/*  calldbx.h
+ *
+ *    Export public functions defined in calldbx.c
+ */
+
+#ifndef _CALLDBX_H_
+#define _CALLDBX_H_
+
+#ifdef CREATE_IO_WINDOW
+
+void create_io_window ();
+void close_io_window ();
+
+#endif
+
+#endif /* _CALLDBX_H_ */
diff -urNad xxgdb~/command.c xxgdb/command.c
--- xxgdb~/command.c	2008-05-17 10:05:14.000000000 +0200
+++ xxgdb/command.c	2008-05-17 10:05:14.000000000 +0200
@@ -96,6 +96,7 @@
 #endif
 #include <sys/wait.h>
 #include "global.h"
+#include "calldbx.h"
 
 #define	 REVERSE	0
 #define	 FORWARD	1
@@ -195,9 +196,9 @@
 		s = funcname;
 		while (*s == ' ') s++;	/* skip leading spaces (if any) */
 		if ((*s >= '0') && (*s <= '9'))
-			sprintf(command, "%s *%s\n",client_data,funcname);
+			sprintf(command, "%s *%s\n",(char *)client_data,funcname);
 		else
-			sprintf(command, "%s %s\n",client_data,funcname);
+			sprintf(command, "%s %s\n",(char *)client_data,funcname);
 		XFree (funcname);   /* AJK */
 		}
 	else
@@ -206,7 +207,7 @@
 			{
 			pos = XawTextGetInsertionPoint(sourceWindow);
 			line = TextPositionToLine(pos);
-			sprintf(command, "%s %d\n",client_data,line);
+			sprintf(command, "%s %d\n",(char *)client_data,line);
 			}
 		else
 			{
diff -urNad xxgdb~/dbx.c xxgdb/dbx.c
--- xxgdb~/dbx.c	2008-05-17 10:05:10.000000000 +0200
+++ xxgdb/dbx.c	2008-05-17 10:05:14.000000000 +0200
@@ -72,6 +72,7 @@
  *    query_dbx():	Send a command to dbx and process it.
  */
 #include <stdio.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include "global.h"
 
@@ -124,7 +125,7 @@
  */
 void debug_init()
 {
-    static visited = False;
+    static int visited = False;
 
     if (!visited) {
 	visited = True;
diff -urNad xxgdb~/filemenu.c xxgdb/filemenu.c
--- xxgdb~/filemenu.c	2008-05-17 10:05:14.000000000 +0200
+++ xxgdb/filemenu.c	2008-05-17 10:05:14.000000000 +0200
@@ -83,6 +83,7 @@
 
 #ifdef NO_SCANDIR 
 #include <stdio.h>
+#include <stdlib.h>
 #include <sys/param.h>
 #include <sys/types.h>
 #include <dirent.h>
diff -urNad xxgdb~/gdb_parser.c xxgdb/gdb_parser.c
--- xxgdb~/gdb_parser.c	2008-05-17 10:05:14.000000000 +0200
+++ xxgdb/gdb_parser.c	2008-05-17 10:05:14.000000000 +0200
@@ -81,6 +81,7 @@
 #include 	<string.h>
 #include 	<stdio.h>
 #include	<errno.h>
+#include	"calldbx.h"
 
 extern Boolean	Prompt;			/* True when gdb prompt arrives */
 
diff -urNad xxgdb~/regex.c xxgdb/regex.c
--- xxgdb~/regex.c	2008-05-17 10:05:14.000000000 +0200
+++ xxgdb/regex.c	2008-05-17 10:05:14.000000000 +0200
@@ -124,8 +124,6 @@
 
 #ifdef sparc
 #include <alloca.h>
-#else
-#pragma alloca
 #endif
 #define FAILURE_STACK   20000           /* max failure stack size */
 
@@ -307,7 +305,8 @@
       pending_exact -= (-(int)c); \
   }
 
-static int store_jump (), insert_jump ();
+void store_jump ();
+void insert_jump ();
 
 char *
 re_compile_pattern (pattern, size, bufp)
@@ -690,7 +689,7 @@
 /* Store where `from' points a jump operation to jump to where `to' points.
   `opcode' is the opcode to store. */
 
-static int
+void
 store_jump (from, opcode, to)
      char *from, *to;
      char opcode;
@@ -707,7 +706,7 @@
 
    If you call this function, you must zero out pending_exact.  */
 
-static int
+void
 insert_jump (op, from, to, current_end)
      char op;
      char *from, *to, *current_end;
@@ -738,7 +737,10 @@
   register char *fastmap = bufp->fastmap;
   register unsigned char *p = pattern;
   register unsigned char *pend = pattern + size;
-  register int j, k;
+  register int j;
+#ifdef emacs
+  register int k;
+#endif
   unsigned char *translate = (unsigned char *) bufp->translate;
 
   unsigned char *stackb[NFAILURES];
@@ -896,6 +898,9 @@
 		  fastmap[j] = 1;
 	      }
 	  break;
+
+	default:
+	  break;
 	}
 
       /* Get here means we have successfully found the possible starting
@@ -1570,6 +1575,9 @@
 	      while (--mcnt);
 	    }
 	  break;
+
+	default:
+	  break;
 	}
       continue;    /* Successfully matched one pattern command; keep matching */
 
diff -urNad xxgdb~/signals.c xxgdb/signals.c
--- xxgdb~/signals.c	2008-05-17 10:05:14.000000000 +0200
+++ xxgdb/signals.c	2008-05-17 10:05:14.000000000 +0200
@@ -49,6 +49,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <signal.h>
 #ifdef	_POSIX_SOURCE
 #include <sys/types.h>
diff -urNad xxgdb~/source.c xxgdb/source.c
--- xxgdb~/source.c	2008-05-17 10:05:10.000000000 +0200
+++ xxgdb/source.c	2008-05-17 10:05:14.000000000 +0200
@@ -363,7 +363,7 @@
 #endif /* EDIT_BUTTON */
 
 /* fixes keybindings in source window */
-extern PopupSearch();
+extern void PopupSearch();
 void Search(w, event, params, num_params)
     Widget w;
     XEvent *event;
diff -urNad xxgdb~/windows.c xxgdb/windows.c
--- xxgdb~/windows.c	2008-05-17 10:05:10.000000000 +0200
+++ xxgdb/windows.c	2008-05-17 10:05:14.000000000 +0200
@@ -201,8 +201,6 @@
      Widget client_data;
      XtPointer call_data;
 {
-  Arg 	args[MAXARGS];
-  Cardinal 	n;
   Boolean       ToggleState;
 
   XtVaGetValues(w, XtNstate, &ToggleState, NULL);
diff -urNad xxgdb~/windows.h xxgdb/windows.h
--- xxgdb~/windows.h	1970-01-01 01:00:00.000000000 +0100
+++ xxgdb/windows.h	2008-05-17 10:08:13.000000000 +0200
@@ -0,0 +1,70 @@
+/*****************************************************************************
+ *
+ *  xdbx - X Window System interface to the dbx debugger
+ *
+ *  Copyright 1989 The University of Texas at Austin
+ *  Copyright 1990 Microelectronics and Computer Technology Corporation
+ *
+ *  Permission to use, copy, modify, and distribute this software and its
+ *  documentation for any purpose and without fee is hereby granted,
+ *  provided that the above copyright notice appear in all copies and that
+ *  both that copyright notice and this permission notice appear in
+ *  supporting documentation, and that the name of The University of Texas
+ *  and Microelectronics and Computer Technology Corporation (MCC) not be 
+ *  used in advertising or publicity pertaining to distribution of
+ *  the software without specific, written prior permission.  The
+ *  University of Texas and MCC makes no representations about the 
+ *  suitability of this software for any purpose.  It is provided "as is" 
+ *  without express or implied warranty.
+ *
+ *  THE UNIVERSITY OF TEXAS AND MCC DISCLAIMS ALL WARRANTIES WITH REGARD TO
+ *  THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ *  FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF TEXAS OR MCC BE LIABLE FOR
+ *  ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ *  CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ *  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ *  Author:  	Po Cheung
+ *  Created:   	March 10, 1989
+ * 
+ *****************************************************************************
+ * 
+ *  xxgdb - X Window System interface to the gdb debugger
+ *  
+ * 	Copyright 1990,1993 Thomson Consumer Electronics, Inc.
+ *  
+ *  Permission to use, copy, modify, and distribute this software and its
+ *  documentation for any purpose and without fee is hereby granted,
+ *  provided that the above copyright notice appear in all copies and that
+ *  both that copyright notice and this permission notice appear in
+ *  supporting documentation, and that the name of Thomson Consumer
+ *  Electronics (TCE) not be used in advertising or publicity pertaining
+ *  to distribution of the software without specific, written prior
+ *  permission.  TCE makes no representations about the suitability of
+ *  this software for any purpose.  It is provided "as is" without express
+ *  or implied warranty.
+ *
+ *  TCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ *  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
+ *  SHALL TCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
+ *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ *  SOFTWARE.
+ *
+ *****************************************************************************/
+
+/*  windows.h
+ *
+ *    Export public functions defined in windows.c
+ */
+
+#ifndef _WINDOWS_H_
+#define _WINDOWS_H_
+
+#include <X11/Xos.h>
+
+void State_Transient(Widget w, Widget client_data, XtPointer call_data);
+
+#endif /* _WINDOWS_H_ */
diff -urNad xxgdb~/xdbx.c xxgdb/xdbx.c
--- xxgdb~/xdbx.c	2008-05-17 10:05:14.000000000 +0200
+++ xxgdb/xdbx.c	2008-05-17 10:05:14.000000000 +0200
@@ -83,6 +83,7 @@
 #include "global.h"
 #include "bitmaps.h"
 #include "patchlevel.h"
+#include "windows.h"
 
 #define VERSION	"2.1"
 #define Offset(field) (XtOffset(XdbxResources *, field))
@@ -458,7 +459,7 @@
     return dbxargv;
 }
 
-void main(argc, argv)
+int main(argc, argv)
 int argc;
 char **argv;
 {
@@ -503,4 +504,6 @@
 #endif /* NEW_INTERFACE */
 
     XtAppMainLoop(app_context);
+
+    return 0;
 }
diff -urNad xxgdb~/xxgdbiowin.c xxgdb/xxgdbiowin.c
--- xxgdb~/xxgdbiowin.c	2008-05-17 10:05:14.000000000 +0200
+++ xxgdb/xxgdbiowin.c	2008-05-17 10:05:14.000000000 +0200
@@ -8,6 +8,7 @@
 #include <sys/un.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <unistd.h>
 
 #if ( defined(SYSV) || defined(SVR4) ) && !defined(HPUX) && !defined(linux)
 #define signal sigset
@@ -19,7 +20,7 @@
 {
 }
 
-main ()
+int main ()
 {
     int sock;
     struct sockaddr_un name;
@@ -57,10 +58,17 @@
 #ifdef SVR4
     setpgid(0,0);
 #else
+#ifdef linux
+    setpgrp();
+#else
     setpgrp(0,0);
 #endif
+#endif
     close(0);
     close(1);
     while (1) pause();
+
+    /* not reached */
+    return 0;
 }