[xdebug-general] debugclient fixes

From: Reini Urban <rurban[@]x-ray.at>
Date: Tue, 07 Sep 2004 12:26:25 +0200

with a recently modern gcc we need more:

$ make
gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -Wall -Werror -c main.c
main.c: In Funktion >>main<<:
main.c:190: Warnung: implicit declaration of function `memset'
main.c:253: Warnung: implicit declaration of function `strlen'
main.c:253: Warnung: suggest parentheses around && within ||
main.c:259: Warnung: implicit declaration of function `strdup'
main.c:259: Warnung: Zuweisung erzeugt Zeiger von Ganzzahl ohne
Typkonvertierung
main.c:272: Warnung: implicit declaration of function `strncmp'
make: *** [main.o] Fehler 1

rurban[@]reini /usr/src/php/xdebug
$ make
gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -Wall -Werror -c main.c
main.c: In Funktion >>main<<:
main.c:254: Warnung: suggest parentheses around && within ||
make: *** [main.o] Fehler 1

I'm not sure about the C precedence rules and if I did the proper
nesting. Please review the if parens.

-- 
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/

--- debugclient/main.c.orig 2004-04-17 11:24:06.000000000 +0100
+++ debugclient/main.c 2004-09-07 11:20:26.725854200 +0100
@@ -31,6 +31,7 @@
 #endif
 #include <stdlib.h>
 #include <sys/stat.h>
+#include <string.h>
 
 #ifdef HAVE_LIBEDIT
 #include <signal.h>
@@ -250,7 +251,7 @@
                                         /* If there is a 'previous' command, and when the command
                                          * just consists of an "enter", then we set the command to
                                          * the previous command. */
- if (prev_cmd && strlen(cmd) == 0 || (strlen(cmd) == 1 && cmd[0] == '\n')) {
+ if ((prev_cmd && (strlen(cmd) == 0)) || (strlen(cmd) == 1 && cmd[0] == '\n')) {
                                                 cmd = prev_cmd;
                                         } else {
                                                 if (prev_cmd) {
Received on Tue Sep 07 2004 - 12:26:31 BST

This archive was generated by hypermail 2.2.0 : Mon Jun 25 2018 - 06:00:03 BST