This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
PATCH : libiberty/setenv/size_t
- To: "Philippe De Muyter" <phdm@macqel.be>
- Subject: PATCH : libiberty/setenv/size_t
- From: Elena Zannoni <ezannoni@cygnus.com>
- Date: Fri, 13 Aug 1999 18:33:48 -0400 (EDT)
- Cc: gdb-patches@sourceware.cygnus.com (gdb-patches@sourceware.cygnus.com)
- References: <199908112358.BAA04072@mail.macqel.be>
Same with this one.
Philippe De Muyter writes:
>
> 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>
>