This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

[phdm@macqel.be: PATCH : libiberty/setenv/size_t]


Noticed in a GDB snap... -s

------- Start of forwarded message -------
Subject: PATCH : libiberty/setenv/size_t
To: gdb-patches@sourceware.cygnus.com (gdb-patches@sourceware.cygnus.com)
Date: Thu, 12 Aug 1999 00:38:21 +0200 (CEST)
From: "Philippe De Muyter" <phdm@macqel.be>

Symptom :

test x"no" != xyes || \
  gcc -c -DHAVE_CONFIG_H -g -O2 -W -Wall -I. -I/share/src/gnu/gdb-19990809/libiberty/../include   /share/src/gnu/gdb-19990809/libiberty/setenv.c -o pic/setenv.o
gcc -c -DHAVE_CONFIG_H -g -O2 -W -Wall -I. -I/share/src/gnu/gdb-19990809/libiberty/../include  /share/src/gnu/gdb-19990809/libiberty/setenv.c
/share/src/gnu/gdb-19990809/libiberty/setenv.c: In function `setenv':
/share/src/gnu/gdb-19990809/libiberty/setenv.c:68: parse error before `size'
/share/src/gnu/gdb-19990809/libiberty/setenv.c:69: redeclaration of `size_t'
/share/src/gnu/gdb-19990809/libiberty/setenv.c:68: `size_t' previously declared here
/share/src/gnu/gdb-19990809/libiberty/setenv.c:69: parse error before `namelen'
/share/src/gnu/gdb-19990809/libiberty/setenv.c:70: redeclaration of `size_t'
/share/src/gnu/gdb-19990809/libiberty/setenv.c:69: `size_t' previously declared here
/share/src/gnu/gdb-19990809/libiberty/setenv.c:70: parse error before `vallen'
/share/src/gnu/gdb-19990809/libiberty/setenv.c:74: `size' undeclared (first use this function)
/share/src/gnu/gdb-19990809/libiberty/setenv.c:74: (Each undeclared identifier is reported only once
/share/src/gnu/gdb-19990809/libiberty/setenv.c:74: for each function it appears in.)
/share/src/gnu/gdb-19990809/libiberty/setenv.c:75: `NULL' undeclared (first use this function)
/share/src/gnu/gdb-19990809/libiberty/setenv.c:77: `namelen' undeclared (first use this function)
/share/src/gnu/gdb-19990809/libiberty/setenv.c:98: `vallen' undeclared (first use this function)
/share/src/gnu/gdb-19990809/libiberty/setenv.c:121: `size_t' undeclared (first use this function)
/share/src/gnu/gdb-19990809/libiberty/setenv.c:121: parse error before `len'
/share/src/gnu/gdb-19990809/libiberty/setenv.c:122: `len' undeclared (first use this function)
/share/src/gnu/gdb-19990809/libiberty/setenv.c:70: warning: unused variable `size_t'
/share/src/gnu/gdb-19990809/libiberty/setenv.c: In function `unsetenv':
/share/src/gnu/gdb-19990809/libiberty/setenv.c:147: parse error before `len'
/share/src/gnu/gdb-19990809/libiberty/setenv.c:153: `len' undeclared (first use this function)
/share/src/gnu/gdb-19990809/libiberty/setenv.c:147: warning: unused variable `size_t'
gnumake[1]: *** [setenv.o] Error 1
gnumake[1]: Leaving directory `/backup/tmp/gdbss/libiberty'
gnumake: *** [all-libiberty] Error 2

Possible fix :

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

	* setenv.c (sys/types.h, stdio.h): Include those files unconditionaly.

- --- ./libiberty/setenv.c	Wed Aug 11 18:42:46 1999
+++ ./libiberty/setenv.c	Wed Aug 11 11:56:59 1999
@@ -21,6 +21,8 @@
 #endif
 
 #include "ansidecl.h"
+#include <sys/types.h> /* For `size_t' */
+#include <stdio.h>     /* For `NULL' */
 
 #include <errno.h>
 #if !defined(errno) && !defined(HAVE_ERRNO_DECL)
@@ -30,9 +32,6 @@
 
 #if HAVE_STDLIB_H
 # include <stdlib.h>
- -#else
- -#include <sys/types.h> /* For `size_t' */
- -#include <stdio.h>     /* For `NULL' */
 #endif
 #if HAVE_STRING_H
 # include <string.h>
------- End of forwarded message -------


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