diff options
author | 2004-12-24 22:03:56 +0000 | |
---|---|---|
committer | 2004-12-24 22:03:56 +0000 | |
commit | 25e200da7abb1e899c6b29276c1d104f90573a1f (patch) | |
tree | 158c293047a20dae1f7ce43eb2d60d9c64d5581a | |
parent | update to gcc 3.3.5 (diff) | |
download | wireguard-openbsd-25e200da7abb1e899c6b29276c1d104f90573a1f.tar.xz wireguard-openbsd-25e200da7abb1e899c6b29276c1d104f90573a1f.zip |
fix up conflicts
-rw-r--r-- | gnu/lib/libiberty/include/ChangeLog | 37 | ||||
-rw-r--r-- | gnu/lib/libiberty/include/obstack.h | 40 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/ChangeLog | 12 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/calloc.c | 3 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/copysign.c | 8 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/functions.texi | 101 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/maint-tool | 8 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/memchr.c | 2 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/memcpy.c | 9 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/memmove.c | 4 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/memset.c | 8 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/physmem.c | 2 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/strcasecmp.c | 2 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/strdup.c | 21 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/strncasecmp.c | 2 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/strncmp.c | 2 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/strstr.c | 4 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/testsuite/test-demangle.c | 2 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/vfprintf.c | 3 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/vprintf.c | 4 | ||||
-rw-r--r-- | gnu/lib/libiberty/src/xatexit.c | 2 |
21 files changed, 204 insertions, 72 deletions
diff --git a/gnu/lib/libiberty/include/ChangeLog b/gnu/lib/libiberty/include/ChangeLog index 5fd99e8b8ae..319da2a09c2 100644 --- a/gnu/lib/libiberty/include/ChangeLog +++ b/gnu/lib/libiberty/include/ChangeLog @@ -1,3 +1,40 @@ +2004-09-30 Release Manager + + * GCC 3.3.5 Released. + +2004-05-31 Release Manager + + * GCC 3.3.4 Released. + +2004-03-02 Gabriel Dos Reis <gdr@integrable-solutions.net> + + PR bootstrap/14348 + Backport + 2003-10-22 Joseph S. Myers <jsm@polyomino.org.uk> + * obstack.h: Merge the following change from gnulib: + 2003-10-21 Paul Eggert <eggert@twinsun.com> + * obstack.h (obstack_1grow_fast): Properly parenthesize arg. + (obstack_ptr_grow_fast, obstack_int_grow_fast): + Don't use lvalue casts, as GCC plans to remove support for them + in GCC 3.5. Reported by Joseph S. Myers. This bug + was also present in the non-GCC version, indicating that this + code had always been buggy and had never been widely used. + (obstack_1grow, obstack_ptr_grow, obstack_int_grow, + obstack_blank): + Use the fast variant of each macro, rather than copying the + definiens of the fast variant; that way, we'll be more likely to + catch future bugs in the fast variants. + +2004-02-14 Release Manager + + * GCC 3.3.3 Released. + +2003-11-12 Daniel Jacobowitz <drow@mvista.com> + + Backport from mainline: + 2003-02-20 Daniel Jacobowitz <drow@mvista.com> + * libiberty.h (lrealpath): Add declaration. + 2003-10-16 Release Manager * GCC 3.3.2 Released. diff --git a/gnu/lib/libiberty/include/obstack.h b/gnu/lib/libiberty/include/obstack.h index d86d9f2c426..5496ff24071 100644 --- a/gnu/lib/libiberty/include/obstack.h +++ b/gnu/lib/libiberty/include/obstack.h @@ -343,7 +343,7 @@ extern int obstack_exit_failure; #endif -#define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = achar) +#define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = (achar)) #define obstack_blank_fast(h,n) ((h)->next_free += (n)) @@ -411,7 +411,7 @@ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ if (__o->next_free + 1 > __o->chunk_limit) \ _obstack_newchunk (__o, 1); \ - *(__o->next_free)++ = (datum); \ + obstack_1grow_fast (__o, datum); \ (void) 0; }) /* These assume that the obstack alignment is good enough for pointers or ints, @@ -423,19 +423,28 @@ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ if (__o->next_free + sizeof (void *) > __o->chunk_limit) \ _obstack_newchunk (__o, sizeof (void *)); \ - *((void **)__o->next_free)++ = ((void *)datum); \ - (void) 0; }) + obstack_ptr_grow_fast (__o, datum); }) # define obstack_int_grow(OBSTACK,datum) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ if (__o->next_free + sizeof (int) > __o->chunk_limit) \ _obstack_newchunk (__o, sizeof (int)); \ - *((int *)__o->next_free)++ = ((int)datum); \ + obstack_int_grow_fast (__o, datum); }) + +# define obstack_ptr_grow_fast(OBSTACK,aptr) \ +__extension__ \ +({ struct obstack *__o1 = (OBSTACK); \ + *(const void **) __o1->next_free = (aptr); \ + __o1->next_free += sizeof (const void *); \ (void) 0; }) -# define obstack_ptr_grow_fast(h,aptr) (*((void **) (h)->next_free)++ = (void *)aptr) -# define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint) +# define obstack_int_grow_fast(OBSTACK,aint) \ +__extension__ \ +({ struct obstack *__o1 = (OBSTACK); \ + *(int *) __o1->next_free = (aint); \ + __o1->next_free += sizeof (int); \ + (void) 0; }) # define obstack_blank(OBSTACK,length) \ __extension__ \ @@ -443,7 +452,7 @@ __extension__ \ int __len = (length); \ if (__o->chunk_limit - __o->next_free < __len) \ _obstack_newchunk (__o, __len); \ - __o->next_free += __len; \ + obstack_blank_fast (__o, __len); \ (void) 0; }) # define obstack_alloc(OBSTACK,length) \ @@ -530,26 +539,29 @@ __extension__ \ # define obstack_1grow(h,datum) \ ( (((h)->next_free + 1 > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), 1), 0) : 0), \ - (*((h)->next_free)++ = (datum))) + obstack_1grow_fast (h, datum)) # define obstack_ptr_grow(h,datum) \ ( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \ - (*((char **) (((h)->next_free+=sizeof(char *))-sizeof(char *))) = ((char *) datum))) + obstack_ptr_grow_fast (h, datum)) # define obstack_int_grow(h,datum) \ ( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \ - (*((int *) (((h)->next_free+=sizeof(int))-sizeof(int))) = ((int) datum))) + obstack_int_grow_fast (h, datum)) + +# define obstack_ptr_grow_fast(h,aptr) \ + (((const void **) ((h)->next_free += sizeof (void *)))[-1] = (aptr)) -# define obstack_ptr_grow_fast(h,aptr) (*((char **) (h)->next_free)++ = (char *) aptr) -# define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint) +# define obstack_int_grow_fast(h,aint) \ + (((int *) ((h)->next_free += sizeof (int)))[-1] = (aptr)) # define obstack_blank(h,length) \ ( (h)->temp = (length), \ (((h)->chunk_limit - (h)->next_free < (h)->temp) \ ? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \ - ((h)->next_free += (h)->temp)) + obstack_blank_fast (h, (h)->temp)) # define obstack_alloc(h,length) \ (obstack_blank ((h), (length)), obstack_finish ((h))) diff --git a/gnu/lib/libiberty/src/ChangeLog b/gnu/lib/libiberty/src/ChangeLog index 0539a5aa1ca..607bb148cc8 100644 --- a/gnu/lib/libiberty/src/ChangeLog +++ b/gnu/lib/libiberty/src/ChangeLog @@ -1,3 +1,15 @@ +2004-09-30 Release Manager + + * GCC 3.3.5 Released. + +2004-05-31 Release Manager + + * GCC 3.3.4 Released. + +2004-02-14 Release Manager + + * GCC 3.3.3 Released. + 2003-04-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * vsnprintf.c (vsnprintf): Don't pad string with extra nulls. diff --git a/gnu/lib/libiberty/src/calloc.c b/gnu/lib/libiberty/src/calloc.c index b342f6c1b3b..50736823077 100644 --- a/gnu/lib/libiberty/src/calloc.c +++ b/gnu/lib/libiberty/src/calloc.c @@ -13,8 +13,6 @@ Uses @code{malloc} to allocate storage for @var{nelem} objects of */ #include "ansidecl.h" -#include "libiberty.h" - #ifdef ANSI_PROTOTYPES #include <stddef.h> #else @@ -23,6 +21,7 @@ Uses @code{malloc} to allocate storage for @var{nelem} objects of /* For systems with larger pointers than ints, this must be declared. */ PTR malloc PARAMS ((size_t)); +void bzero PARAMS ((PTR, size_t)); PTR calloc (nelem, elsize) diff --git a/gnu/lib/libiberty/src/copysign.c b/gnu/lib/libiberty/src/copysign.c index 5c48a5422eb..d288be239eb 100644 --- a/gnu/lib/libiberty/src/copysign.c +++ b/gnu/lib/libiberty/src/copysign.c @@ -131,7 +131,9 @@ typedef union #if defined(__IEEE_BIG_ENDIAN) || defined(__IEEE_LITTLE_ENDIAN) -double DEFUN(copysign, (x, y), double x AND double y) +double +copysign (x, y) + double x, y; { __ieee_double_shape_type a,b; b.value = y; @@ -142,7 +144,9 @@ double DEFUN(copysign, (x, y), double x AND double y) #else -double DEFUN(copysign, (x, y), double x AND double y) +double +copysign (x, y) + double x, y; { if ((x < 0 && y > 0) || (x > 0 && y < 0)) return -x; diff --git a/gnu/lib/libiberty/src/functions.texi b/gnu/lib/libiberty/src/functions.texi index 841151ce5a2..4261d864676 100644 --- a/gnu/lib/libiberty/src/functions.texi +++ b/gnu/lib/libiberty/src/functions.texi @@ -392,22 +392,6 @@ and a path ending in @code{/} returns the empty string after it. @end deftypefn -@c make-relative-prefix.c:24 -@deftypefn Extension {const char*} make_relative_prefix (const char *@var{progname}, const char *@var{bin_prefix}, const char *@var{prefix}) - -Given three strings @var{progname}, @var{bin_prefix}, @var{prefix}, return a string -that gets to @var{prefix} starting with the directory portion of @var{progname} and -a relative pathname of the difference between @var{bin_prefix} and @var{prefix}. - -For example, if @var{bin_prefix} is @code{/alpha/beta/gamma/gcc/delta}, @var{prefix} -is @code{/alpha/beta/gamma/omega/}, and @var{progname} is @code{/red/green/blue/gcc}, -then this function will return @code{/red/green/blue/../../omega/}. - -The return value is normally allocated via @code{malloc}. If no relative prefix -can be found, return @code{NULL}. - -@end deftypefn - @c lrealpath.c:25 @deftypefn Replacement {const char*} lrealpath (const char *@var{name}) @@ -492,6 +476,14 @@ Copies @var{count} bytes from memory area @var{from} to memory area @end deftypefn +@c mempcpy.c:23 +@deftypefn Supplemental void* mempcpy (void *@var{out}, const void *@var{in}, size_t @var{length}) + +Copies @var{length} bytes from memory region @var{in} to region +@var{out}. Returns a pointer to @var{out} + @var{length}. + +@end deftypefn + @c memset.c:6 @deftypefn Supplemental void* memset (void *@var{s}, int @var{c}, size_t @var{count}) @@ -518,7 +510,7 @@ reading and writing. @end deftypefn -@c pexecute.c:67 +@c pexecute.txh:1 @deftypefn Extension int pexecute (const char *@var{program}, char * const *@var{argv}, const char *@var{this_pname}, const char *@var{temp_base}, char **@var{errmsg_fmt}, char **@var{errmsg_arg}, int flags) Executes a program. @@ -533,14 +525,15 @@ use if needed. This is currently only needed for MS-DOS ports that don't use @code{go32} (do any still exist?). Ports that don't need it can pass @code{NULL}. -(@code{@var{flags} & PEXECUTE_SEARCH}) is non-zero if @env{PATH} should be searched -(??? It's not clear that GCC passes this flag correctly). (@code{@var{flags} & -PEXECUTE_FIRST}) is nonzero for the first process in chain. -(@code{@var{flags} & PEXECUTE_FIRST}) is nonzero for the last process -in chain. The first/last flags could be simplified to only mark the -last of a chain of processes but that requires the caller to always -mark the last one (and not give up early if some error occurs). -It's more robust to require the caller to mark both ends of the chain. +(@code{@var{flags} & PEXECUTE_SEARCH}) is non-zero if @env{PATH} +should be searched (??? It's not clear that GCC passes this flag +correctly). (@code{@var{flags} & PEXECUTE_FIRST}) is nonzero for the +first process in chain. (@code{@var{flags} & PEXECUTE_FIRST}) is +nonzero for the last process in chain. The first/last flags could be +simplified to only mark the last of a chain of processes but that +requires the caller to always mark the last one (and not give up +early if some error occurs). It's more robust to require the caller +to mark both ends of the chain. The result is the pid on systems like Unix where we @code{fork}/@code{exec} and on systems like WIN32 and OS/2 where we @@ -575,21 +568,23 @@ name is unset/removed. @end deftypefn -@c pexecute.c:104 +@c pexecute.txh:39 @deftypefn Extension int pwait (int @var{pid}, int *@var{status}, int @var{flags}) Waits for a program started by @code{pexecute} to finish. @var{pid} is the process id of the task to wait for. @var{status} is -the `status' argument to wait. @var{flags} is currently unused (allows -future enhancement without breaking upward compatibility). Pass 0 for now. +the `status' argument to wait. @var{flags} is currently unused +(allows future enhancement without breaking upward compatibility). +Pass 0 for now. The result is the pid of the child reaped, or -1 for failure (@code{errno} says why). -On systems that don't support waiting for a particular child, @var{pid} is -ignored. On systems like MS-DOS that don't really multitask @code{pwait} -is just a mechanism to provide a consistent interface for the caller. +On systems that don't support waiting for a particular child, +@var{pid} is ignored. On systems like MS-DOS that don't really +multitask @code{pwait} is just a mechanism to provide a consistent +interface for the caller. @end deftypefn @@ -678,6 +673,19 @@ be the value @code{1}). @end deftypefn +@c snprintf.c:28 +@deftypefn Supplemental int snprintf (char *@var{buf}, size_t @var{n}, const char *@var{format}, ...) + +This function is similar to sprintf, but it will print at most @var{n} +characters. On error the return value is -1, otherwise it returns the +number of characters that would have been printed had @var{n} been +sufficiently large, regardless of the actual value of @var{n}. Note +some pre-C99 system libraries do not implement this correctly so users +cannot generally rely on the return value if the system version of +this function is used. + +@end deftypefn + @c spaces.c:22 @deftypefn Extension char* spaces (int @var{count}) @@ -687,6 +695,24 @@ valid until at least the next call. @end deftypefn +@c stpcpy.c:23 +@deftypefn Supplemental char* stpcpy (char *@var{dst}, const char *@var{src}) + +Copies the string @var{src} into @var{dst}. Returns a pointer to +@var{dst} + strlen(@var{src}). + +@end deftypefn + +@c stpncpy.c:23 +@deftypefn Supplemental char* stpncpy (char *@var{dst}, const char *@var{src}, size_t @var{len}) + +Copies the string @var{src} into @var{dst}, copying exactly @var{len} +and padding with zeros if necessary. If @var{len} < strlen(@var{src}) +then return @var{dst} + @var{len}, otherwise returns @var{dst} + +strlen(@var{src}). + +@end deftypefn + @c strcasecmp.c:15 @deftypefn Supplemental int strcasecmp (const char *@var{s1}, const char *@var{s2}) @@ -916,6 +942,19 @@ nonstandard but common function @code{_doprnt}. @end deftypefn +@c vsnprintf.c:28 +@deftypefn Supplemental int vsnprintf (char *@var{buf}, size_t @var{n}, const char *@var{format}, va_list @var{ap}) + +This function is similar to vsprintf, but it will print at most +@var{n} characters. On error the return value is -1, otherwise it +returns the number of characters that would have been printed had +@var{n} been sufficiently large, regardless of the actual value of +@var{n}. Note some pre-C99 system libraries do not implement this +correctly so users cannot generally rely on the return value if the +system version of this function is used. + +@end deftypefn + @c waitpid.c:3 @deftypefn Supplemental int waitpid (int @var{pid}, int *@var{status}, int) diff --git a/gnu/lib/libiberty/src/maint-tool b/gnu/lib/libiberty/src/maint-tool index ceeb48dbf39..6b9bf7f2cdb 100644 --- a/gnu/lib/libiberty/src/maint-tool +++ b/gnu/lib/libiberty/src/maint-tool @@ -223,6 +223,14 @@ sub deps { } $mine{'config.h'} = "config.h"; + opendir(INC, $srcdir); + while ($f = readdir INC) { + next unless $f =~ /\.h$/; + $mine{$f} = "\$(srcdir)/$f"; + $deps{$f} = join(' ', &deps_for("$srcdir/$f")); + } + $mine{'config.h'} = "config.h"; + open(IN, "$srcdir/Makefile.in"); open(OUT, ">$srcdir/Makefile.tmp"); while (<IN>) { diff --git a/gnu/lib/libiberty/src/memchr.c b/gnu/lib/libiberty/src/memchr.c index f94bea018f5..3948125963d 100644 --- a/gnu/lib/libiberty/src/memchr.c +++ b/gnu/lib/libiberty/src/memchr.c @@ -15,7 +15,7 @@ returned. */ #include <ansidecl.h> -#ifdef __STDC__ +#ifdef ANSI_PROTOTYPES #include <stddef.h> #else #define size_t unsigned long diff --git a/gnu/lib/libiberty/src/memcpy.c b/gnu/lib/libiberty/src/memcpy.c index 0f2bac7ac2c..5eece7a0a00 100644 --- a/gnu/lib/libiberty/src/memcpy.c +++ b/gnu/lib/libiberty/src/memcpy.c @@ -13,14 +13,19 @@ Copies @var{length} bytes from memory region @var{in} to region */ #include <ansidecl.h> -#ifdef __STDC__ +#ifdef ANSI_PROTOTYPES #include <stddef.h> #else #define size_t unsigned long #endif +void bcopy PARAMS((const void*, void*, size_t)); + PTR -DEFUN(memcpy, (out, in, length), PTR out AND const PTR in AND size_t length) +memcpy (out, in, length) + PTR out; + const PTR in; + size_t length; { bcopy(in, out, length); return out; diff --git a/gnu/lib/libiberty/src/memmove.c b/gnu/lib/libiberty/src/memmove.c index 3ec73208ca7..00ac053401b 100644 --- a/gnu/lib/libiberty/src/memmove.c +++ b/gnu/lib/libiberty/src/memmove.c @@ -13,12 +13,14 @@ Copies @var{count} bytes from memory area @var{from} to memory area */ #include <ansidecl.h> -#ifdef __STDC__ +#ifdef ANSI_PROTOTYPES #include <stddef.h> #else #define size_t unsigned long #endif +void bcopy PARAMS ((const void*, void*, size_t)); + PTR memmove (s1, s2, n) PTR s1; diff --git a/gnu/lib/libiberty/src/memset.c b/gnu/lib/libiberty/src/memset.c index 489ca174815..5119f858ad0 100644 --- a/gnu/lib/libiberty/src/memset.c +++ b/gnu/lib/libiberty/src/memset.c @@ -13,15 +13,17 @@ Sets the first @var{count} bytes of @var{s} to the constant byte */ #include <ansidecl.h> -#ifdef __STDC__ +#ifdef ANSI_PROTOTYPES #include <stddef.h> #else #define size_t unsigned long #endif PTR -DEFUN(memset, (dest, val, len), - PTR dest AND register int val AND register size_t len) +memset (dest, val, len) + PTR dest; + register int val; + register size_t len; { register unsigned char *ptr = (unsigned char*)dest; while (len-- > 0) diff --git a/gnu/lib/libiberty/src/physmem.c b/gnu/lib/libiberty/src/physmem.c index f64e07c74d4..9185c1224e8 100644 --- a/gnu/lib/libiberty/src/physmem.c +++ b/gnu/lib/libiberty/src/physmem.c @@ -145,7 +145,7 @@ physmem_total () #endif #if HAVE__SYSTEM_CONFIGURATION - /* This works on AIX 4.3.3+. */ + /* This works on AIX. */ return _system_configuration.physmem; #endif diff --git a/gnu/lib/libiberty/src/strcasecmp.c b/gnu/lib/libiberty/src/strcasecmp.c index 4bfe6507712..d2608dc0b87 100644 --- a/gnu/lib/libiberty/src/strcasecmp.c +++ b/gnu/lib/libiberty/src/strcasecmp.c @@ -25,7 +25,7 @@ static char sccsid[] = "@(#)strcasecmp.c 5.5 (Berkeley) 11/24/87"; #endif /* LIBC_SCCS and not lint */ #include <ansidecl.h> -#ifdef __STDC__ +#ifdef ANSI_PROTOTYPES #include <stddef.h> #else #define size_t unsigned long diff --git a/gnu/lib/libiberty/src/strdup.c b/gnu/lib/libiberty/src/strdup.c index 49233ba7aac..071a4a401af 100644 --- a/gnu/lib/libiberty/src/strdup.c +++ b/gnu/lib/libiberty/src/strdup.c @@ -9,13 +9,24 @@ Returns a pointer to a copy of @var{s} in memory obtained from */ +#include <ansidecl.h> +#ifdef ANSI_PROTOTYPES +#include <stddef.h> +#else +#define size_t unsigned long +#endif + +extern size_t strlen PARAMS ((const char*)); +extern PTR malloc PARAMS ((size_t)); +extern PTR memcpy PARAMS ((PTR, const PTR, size_t)); + char * strdup(s) char *s; { - char *result = (char*)malloc(strlen(s) + 1); - if (result == (char*)0) - return (char*)0; - strcpy(result, s); - return result; + size_t len = strlen (s) + 1; + char *result = (char*) malloc (len); + if (result == (char*) 0) + return (char*) 0; + return (char*) memcpy (result, s, len); } diff --git a/gnu/lib/libiberty/src/strncasecmp.c b/gnu/lib/libiberty/src/strncasecmp.c index 77cb4217701..10feee82198 100644 --- a/gnu/lib/libiberty/src/strncasecmp.c +++ b/gnu/lib/libiberty/src/strncasecmp.c @@ -25,7 +25,7 @@ static char sccsid[] = "@(#)strcasecmp.c 5.5 (Berkeley) 11/24/87"; #endif /* LIBC_SCCS and not lint */ #include <ansidecl.h> -#ifdef __STDC__ +#ifdef ANSI_PROTOTYPES #include <stddef.h> #else #define size_t unsigned long diff --git a/gnu/lib/libiberty/src/strncmp.c b/gnu/lib/libiberty/src/strncmp.c index 819cea6cb58..ad87e1fde8b 100644 --- a/gnu/lib/libiberty/src/strncmp.c +++ b/gnu/lib/libiberty/src/strncmp.c @@ -13,7 +13,7 @@ Compares the first @var{n} bytes of two strings, returning a value as */ #include <ansidecl.h> -#ifdef __STDC__ +#ifdef ANSI_PROTOTYPES #include <stddef.h> #else #define size_t unsigned long diff --git a/gnu/lib/libiberty/src/strstr.c b/gnu/lib/libiberty/src/strstr.c index 470e04b1a76..a059c7f5dcb 100644 --- a/gnu/lib/libiberty/src/strstr.c +++ b/gnu/lib/libiberty/src/strstr.c @@ -27,8 +27,8 @@ strstr (s1, s2) register char *p = s1; extern char *strchr (); extern int strncmp (); -#if __GNUC__==2 - extern __SIZE_TYPE__ strlen (); +#if __GNUC__ >= 2 + extern __SIZE_TYPE__ strlen (const char *); #endif register int len = strlen (s2); diff --git a/gnu/lib/libiberty/src/testsuite/test-demangle.c b/gnu/lib/libiberty/src/testsuite/test-demangle.c index 6e5d0b4b973..82f263e88af 100644 --- a/gnu/lib/libiberty/src/testsuite/test-demangle.c +++ b/gnu/lib/libiberty/src/testsuite/test-demangle.c @@ -65,7 +65,7 @@ getline(buf) line: copy this line into the buffer and return. */ while (c != EOF && c != '\n') { - if (count + 1 >= alloc) + if (count >= alloc) { alloc *= 2; data = xrealloc (data, alloc); diff --git a/gnu/lib/libiberty/src/vfprintf.c b/gnu/lib/libiberty/src/vfprintf.c index db7b2ff4c19..18f09d47d32 100644 --- a/gnu/lib/libiberty/src/vfprintf.c +++ b/gnu/lib/libiberty/src/vfprintf.c @@ -3,7 +3,8 @@ Copyright (C) 1998 Free Software Foundation, Inc. */ -#ifdef __STDC__ +#include "ansidecl.h" +#ifdef ANSI_PROTOTYPES #include <stdarg.h> #else #include <varargs.h> diff --git a/gnu/lib/libiberty/src/vprintf.c b/gnu/lib/libiberty/src/vprintf.c index c57c3e4f318..9487896ea5e 100644 --- a/gnu/lib/libiberty/src/vprintf.c +++ b/gnu/lib/libiberty/src/vprintf.c @@ -15,13 +15,13 @@ nonstandard but common function @code{_doprnt}. */ -#ifdef __STDC__ +#include <ansidecl.h> +#ifdef ANSI_PROTOTYPES #include <stdarg.h> #else #include <varargs.h> #endif #include <stdio.h> -#include <ansidecl.h> #undef vprintf int vprintf (format, ap) diff --git a/gnu/lib/libiberty/src/xatexit.c b/gnu/lib/libiberty/src/xatexit.c index abf340737e4..075599c61f9 100644 --- a/gnu/lib/libiberty/src/xatexit.c +++ b/gnu/lib/libiberty/src/xatexit.c @@ -27,7 +27,7 @@ failure. If you use @code{xatexit} to register functions, you must use #include <stdio.h> -#ifdef __STDC__ +#ifdef ANSI_PROTOTYPES #include <stddef.h> #else #define size_t unsigned long |