This is the mail archive of the gdb-patches@sourceware.cygnus.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]

PATCH : readline/shell/NULL


Symptom :

gcc -c -DHAVE_CONFIG_H   -I. -I/share/src/gnu/gdb-19990809/readline -I/usr/local/include -DRL_LIBRARY_VERSION='"4.0"' -g -O2 -W -Wall /share/src/gnu/gdb-19990809/readline/shell.c
/share/src/gnu/gdb-19990809/readline/shell.c: In function `get_home_dir':
/share/src/gnu/gdb-19990809/readline/shell.c:128: `NULL' undeclared (first use this function)
/share/src/gnu/gdb-19990809/readline/shell.c:128: (Each undeclared identifier is reported only once
/share/src/gnu/gdb-19990809/readline/shell.c:128: for each function it appears in.)
/share/src/gnu/gdb-19990809/readline/shell.c:125: warning: `home_dir' may be used uninitialized in this function
gnumake[1]: *** [shell.o] Error 1

Possible fix :

Thu Aug 12 00:11:02 1999  Philippe De Muyter  <phdm@macqel.be>

	* shell.c (get_home_dir): Initialize `home_dir' to 0, not NULL.

--- ./readline/shell.c	Wed Aug 11 18:42:45 1999
+++ ./readline/shell.c	Wed Aug 11 11:53:22 1999
@@ -125,7 +125,7 @@ get_home_dir ()
   char *home_dir;
   struct passwd *entry;
 
-  home_dir = (char *)NULL;
+  home_dir = (char *)0;
   entry = getpwuid (getuid ());
   if (entry)
     home_dir = entry->pw_dir;



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