diff options
Diffstat (limited to 'gnu/egcs/libiberty')
-rw-r--r-- | gnu/egcs/libiberty/ChangeLog | 413 | ||||
-rw-r--r-- | gnu/egcs/libiberty/Makefile.in | 93 | ||||
-rw-r--r-- | gnu/egcs/libiberty/argv.c | 8 | ||||
-rw-r--r-- | gnu/egcs/libiberty/basename.c | 39 | ||||
-rw-r--r-- | gnu/egcs/libiberty/config.in | 15 | ||||
-rw-r--r-- | gnu/egcs/libiberty/configure.in | 22 | ||||
-rw-r--r-- | gnu/egcs/libiberty/floatformat.c | 10 | ||||
-rw-r--r-- | gnu/egcs/libiberty/getcwd.c | 10 | ||||
-rw-r--r-- | gnu/egcs/libiberty/getruntime.c | 18 | ||||
-rw-r--r-- | gnu/egcs/libiberty/setenv.c | 2 | ||||
-rw-r--r-- | gnu/egcs/libiberty/splay-tree.c | 14 | ||||
-rw-r--r-- | gnu/egcs/libiberty/strtol.c | 5 | ||||
-rw-r--r-- | gnu/egcs/libiberty/strtoul.c | 7 | ||||
-rw-r--r-- | gnu/egcs/libiberty/testsuite/demangle-expected | 16 | ||||
-rw-r--r-- | gnu/egcs/libiberty/vasprintf.c | 1 | ||||
-rw-r--r-- | gnu/egcs/libiberty/xmalloc.c | 12 |
16 files changed, 560 insertions, 125 deletions
diff --git a/gnu/egcs/libiberty/ChangeLog b/gnu/egcs/libiberty/ChangeLog index caf12de495b..c858409d301 100644 --- a/gnu/egcs/libiberty/ChangeLog +++ b/gnu/egcs/libiberty/ChangeLog @@ -1,3 +1,311 @@ +Thu Mar 16 01:33:58 2000 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (partition.o): Depend on config.h + +2000-03-14 Bernd Schmidt <bernds@cygnus.co.uk> + + * hashtab.c (find_empty_slot_for_expand): New function. + (htab_expand): Use it instead of htab_find_slot. + (htab_find_with_hash): Renamed from htab_find; now accepts extra + argument HASH. + (htab_find_slot_with_hash): Likewise for htab_find_slot. + (htab_find): New wrapper function. + (htab_find_slot): Likewise. + (htab_traverse): Pass slot, not entry, to called function. + +2000-03-09 Alex Samuel <samuel@codesourcery.com> + + * Makefile.in (CFILES): Add partition.c. + (REQUIRED_OFILES): Add partition.o. + (partition.o): New rule. + * partition.c: New file. + +2000-03-09 Zack Weinberg <zack@wolery.cumb.org> + + * hashtab.c (htab_create): Set del_f. + (htab_delete, htab_empty, htab_remove_elt, htab_clear_slot): + Use it. + +2000-03-08 Zack Weinberg <zack@wolery.cumb.org> + + * hashtab.c: Remove debugging variables (all_searches, + all_collisions, all_expansions). Delete + all_hash_table_collisions. + (create_hash_table, delete_hash_table, empty_hash_table, + find_hash_table_entry, remove_element_from_hash_table_entry, + clear_hash_table_slot, traverse_hash_table, hash_table_size, + hash_table_elements_number, hash_table_collisions): Rename to: + htab_create, htab_delete, htab_empty, htab_find_slot, + htab_remove_elt, htab_clear_slot, htab_traverse, htab_size, + htab_elements, htab_collisions. + (htab_find): New function, handles common case where you don't + plan to add or delete an entry. + (htab_expand): Don't create a whole new table, just a new + entry vector. + (htab_find_slot): Simplify logic. + +1999-08-03 Ian Lance Taylor <ian@zembu.com> + + * floatformat.c: Add casts to avoid signed/unsigned warnings. + * pexecute.c: Add ATTRIBUTE_UNUSED as needed on Unix. + + * Makefile.in (install_to_libdir): Change $(TARGETLIB).n to + $(TARGETLIB)n so it works on MSDOS. + (install_to_tooldir): Likewise. + +1999-07-21 Ian Lance Taylor <ian@zembu.com> + + From Mark Elbrecht: + * makefile.dos: Remove; obsolete. + * configure.bat: Remove; obsolete. + +1999-07-11 Ian Lance Taylor <ian@zembu.com> + + * splay-tree.c (splay_tree_insert): Add initialization to avoid + warning. + +2000-01-04 Mumit Khan <khan@xraylith.wisc.edu> + + * pexecute.c: Conditionally include string.h. + (fix_argv): Handle embedded whitespace in args for Mingw32. + +2000-01-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * configure.in (ac_libiberty_warn_cflags): Turn on warnings if + we're using gcc. + + * Makefile.in (COMPILE.c): Add @ac_libiberty_warn_cflags@ + +1999-12-27 Geoff Keating <geoffk@cygnus.com> + + * vasprintf.c (int_vasprintf): Don't re-read the format character + as this mishandles strings like '%%s'. + +1999-12-05 Mark Mitchell <mark@codesourcery.com> + + * splay-tree.c (splay_tree_new): Use struct splay_tree_node_s + rather than struct splay_tree_node. + (splay_tree_insert): Use struct splay_tree_s rather than struct + splay_tree. + +Sun Nov 28 00:59:39 1999 Philippe De Muyter <phdm@macqel.be> + + * hashtab.c (sys/types.h): File included. + +1999-11-22 Jason Merrill <jason@casey.cygnus.com> + + * strtoul.c, strtol.c, random.c: Remove advertising clause from + BSD license, pursuant with + + ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change + +Wed Nov 10 09:42:39 1999 Jeffrey A Law (law@cygnus.com) + + * hashtab.c: Include stdio.h. + +Mon Nov 8 09:23:41 1999 Jeffrey A Law (law@cygnus.com) + + * hashtab.c (traverse_hash_table): Protect prototype with PARAMS. + +Tue Nov 2 03:23:13 1999 Philippe De Muyter <phdm@macqel.be> + + * xstrdup (sys/types.h): Include this file. + +1999-10-28 Nathan Sidwell <nathan@acm.org> + + * Makefile.in (SUBDIRS): New macro. + (mostlyclean, clean, distclean, maintainer-clean): Adjust to + avoid multiple subdirectory cleaning. + (*-subdir): Use SUBDIRS. + +1999-10-25 Jim Kingdon <http://developer.redhat.com/> + + * cplus-dem.c: Move declarations of standard_symbol_characters and + hp_symbol_characters inside #ifdef MAIN to avoid compiler + warnings. + +1999-10-23 08:51 -0700 Zack Weinberg <zack@bitmover.com> + + * hashtab.c (find_hash_table_entry): When returning a + DELETED_ENTRY slot, change it to EMPTY_ENTRY first. + (clear_hash_table_slot): New function which deletes an entry + by its position in the table, not its value. + (traverse_hash_table): New function which calls a hook + function for every live entry in the table. + +1999-10-19 Mark Mitchell <mark@codesourcery.com> + + * cplus-dem.c (INTBUF_SIZE): New macro. + (string_append_template_idx): New function. + (demangle_expression): Likewise. + (demangle_integral_value): Use it. + (demangle_real_value): New function, split out from ... + (demangle_template_value_parm): ... here. Use + string_append_template_idx. Use demangle_real_value. + (demangle_template): Use string_append_template_idx. + (demangle_qualified): Use consume_count_with_underscores. + (get_count): Tweak formatting. + (do_type): Use string_append_template_idx. + +1999-10-18 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * calloc.c: Add a public domain notice. + +Mon Oct 18 02:30:47 1999 Philippe De Muyter <phdm@macqel.be> + + * setenv.c (sys/types.h, stdio.h): Include those files unconditionaly. + +Fri Oct 15 01:47:51 1999 Vladimir Makarov <vmakarov@loony.cygnus.com> + + * Makefile.in (CFILES): Add hashtab.c + (REQUIRED_OFILES): Add hashtab.o + (hashtab.o): Add dependencies. + * hashtab.c: New file + +Wed Oct 13 01:16:47 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * basename.c (DIR_SEPARATOR): New macro. + (DIR_SEPARATOR_2): Likewise. + (HAVE_DOS_BASED_FILESYSTEM): Likewise. + (IS_DIR_SEPARATOR): Likewise. + (main): Handle MSDOS style pathname. + +1999-10-11 Mark Mitchell <mark@codesourcery.com> + + * cplus-dem.c (do_type): Handle pointer to member types whose + enclosing classes have namespace scope. + +Sun Oct 10 01:23:50 1999 Marc Espie <espie@cvs.openbsd.org> + + * config.table: Provide a backup shell for executing move-if-change. + +1999-10-02 Mark Mitchell <mark@codesourcery.com> + + * xmalloc.c (xmalloc): Fix spelling error. + (xcalloc, xrealloc): Likewise. + +1999-10-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * cplus-dem.c (fancy_abort, demangle_integral_value, + demangle_arm_hp_template, recursively_demangle, + standard_symbol_characters, hp_symbol_characters, main): Add prototype. + (program_name, program_version, fatal): Constify a char*. + (usage, fatal): Mark with ATTRIBUTE_NORETURN. + (main): Call return, not exit. + +1999-09-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * choose-temp.c: Remove obsolete comment about gcc. + (make_temp_file): Constify a char*. + +Wed Sep 8 20:03:28 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * xmemdup.c: Include sys/types.h. + +1999-09-07 Jeff Garzik <jgarzik@pobox.com> + + * xmemdup.c: New xmemdup function. + * Makefile.in, makefile.vms, vmsbuild.com: Use xmemdup.[co]. + +Tue Sep 7 23:32:18 1999 Linas Vepstas <linas@linas.org> + + * config.table: Add openedition target. + * config/mh-openedition: New file. + +Thu Sep 2 01:36:12 1999 Marc Espie <espie@cvs.openbsd.org> + + * pexecute.c (pexecute): Fill in temp_base when needed. + +1999-08-31 Richard Henderson <rth@cygnus.com> + + * getpwd.c: Check HAVE_GETCWD before defining it away. + +1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * Makefile.in (CFILES): Add calloc.c and getpwd.c. + (REQUIRED_OFILES): Add getpwd.o. + (getpwd.o): Add target. + + * configure.in (AC_PREREQ): Bump to 2.13. + (AC_CHECK_HEADERS): Add check for <sys/stat.h>. + + * getpwd.c: New file, moved here from gcc. + +1999-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * cplus-dem.c (gnu_special): Cast a `size_t' to `long' when + comparing against a signed quantity. + (arm_special): Likewise. + (demangle_fund_type): Likewise. + (do_hpacc_template_const_value): Mark parameter `work' with + ATTRIBUTE_UNUSED. + (main): Constify variable `valid_symbols'. + +Tue Aug 24 02:50:45 1999 Philippe De Muyter <phdm@macqel.be> + + * strtoul.c (strtoul): Add parentheses around && within ||. + +Fri Aug 6 23:32:29 1999 Daniel Jacobowitz <drow@drow.them.org> + + * Makefile.in (FLAGS_TO_PASS): Include prefix, exec_prefix, + libdir, libsubdir and tooldir. + +1999-08-01 Mark Mitchell <mark@codesourcery.com> + + * splay-tree.c (splay_tree_insert): Return the new node. + +1999-07-14 Richard Henderson <rth@cygnus.com> + + * argv.c: Include stdlib.h and string.h instead of + prototyping directly. + * choose-temp.c: Conditionally include string.h. + +1999-07-12 Jason Merrill <jason@yorick.cygnus.com> + + * Makefile.in (NEEDED): Add bcmp, bcopy, bzero. + +1999-07-11 Ian Lance Taylor <ian@zembu.com> + + * splay-tree.c (splay_tree_insert): Add initialization to avoid + warning. + +1999-07-07 Jason Merrill <jason@yorick.cygnus.com> + + * Makefile.in (needed-list): Only include stuff we actually need + for libstdc++. + +1999-06-21 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> + + * configure.in (checkfuncs): Add gettimeofday. + * config.in, configure: Regenerated. + +Mon Jun 21 05:56:01 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * configure.in (*-*-uwin*): UWIN has sys_{errlist,nerr} even if + the test fails. + * configure: Regenerate. + +1999-06-10 Mike Stump <mrs@wrs.com> + + * Makefile.in (setenv.o): Add config.h dep for setenv.o to fix + parallel builds. + +1999-05-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * putenv.c: Include ansidecl.h to define `const'. + * setenv.c: Likewise. + +Wed May 26 03:58:20 1999 "Melissa O'Neill" <oneill@cs.sfu.ca> + + * Makefile.in (CFILES): Add putenv.c and setenv.c. + * configure.in (funcs): Add putenv and setenv. + (AC_CHECK_FUNCS): Check for putenv and setenv. + * configure: Rebuilt. + * putenv.c setenv.c: New files. + + * getcwd.c (getcwd): If pathname is NULL, then obtain SIZE + bytes of space using malloc. + Mon May 17 01:42:34 1999 Stu Grossman <grossman@babylon-5.cygnus.com> * cplus-dem.c (demangle_fund_type (near 'I' case)): Don't advance @@ -42,7 +350,7 @@ Sun Apr 25 01:18:21 1999 Mumit Khan <khan@xraylith.wisc.edu> 1999-04-20 Jim Blandy <jimb@zwingli.cygnus.com> Fix from Dale Hawkins: - * cplus-dem.c (mop_up): Set typevec_size to zero, so it'll be + * cplus-dem.c (mop_up): Set typevec_size to zero, so it'll be reallocated properly if we use it again. * cplus-dem.c (demangle_fund_type): Check for buffer overrun. Be @@ -68,6 +376,17 @@ Sun Apr 11 23:20:59 1999 Mumit Khan <khan@xraylith.wisc.edu> (xcalloc): UWIN has sbrk. (xrealloc): Fix guard macro. +1999-04-11 Richard Henderson <rth@cygnus.com> + + * alloca-conf.h (alloca) [C_ALLOCA]: Don't use Gcc builtin + or <alloca.h>. + * clock.c (GNU_HZ): New definition. + (clock): Use it. + * getruntime.c: Likewise. + + * config.table: Use mh-beos. + * config/mh-beos: New file. + 1999-04-11 Mark Mitchell <mark@codesourcery.com> * cplus-dem.c (demangle_template_value_parm): Handle @@ -122,7 +441,7 @@ Sun Apr 11 23:20:59 1999 Mumit Khan <khan@xraylith.wisc.edu> * cplus-dem.c (demangle_prefix): Don't grab all the '__' strings when doing arm or hp style. (demangle_nested_args): Decr forgetting_types field when done. - + Thu Mar 11 01:22:58 1999 Mumit Khan <khan@xraylith.wisc.edu> * pexecute.c (__CYGWIN32__): Rename to @@ -156,10 +475,10 @@ Tue Feb 9 01:12:27 1999 Marc Espie <Marc.Espie@liafa.jussieu.fr> * configure.in (funcs): Check for and conditionally add mkstemps to the list of functions libiberty will provide. * configure: Rebuilt. - + Wed Feb 3 00:01:15 1999 Mumit Khan <khan@xraylith.wisc.edu> - * clock.c (HZ): Define in terms of (ISO C) CLOCKS_PER_SEC on + * clock.c (HZ): Define in terms of (ISO C) CLOCKS_PER_SEC on platforms that don't have HZ. * getruntime.c (HZ): Likewise. @@ -228,7 +547,7 @@ Fri Dec 18 17:50:18 1998 David Taylor <taylor@texas.cygnus.com> * cplus-dem.c (demangle_arm_pt): remove declaration -- function doesn't exist. (do_hpacc_template_literal): remove unused variable `i'. - + Fri Dec 18 16:11:43 EST 1998 Andrew MacLeod <amacleod@cygnus.com> * cplus-dem.c (demangle_fund_type): Process CV and u codes before @@ -334,7 +653,7 @@ Mon Nov 23 16:59:49 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 1998-11-16 Benjamin Kosnik <bkoz@haight.constant.com> - * cplus-dem.c (demangle_fund_type): Add demangling for C9x types. + * cplus-dem.c (demangle_fund_type): Add demangling for C9x types. Thu Nov 19 22:15:50 1998 Jeffrey A Law (law@cygnus.com) @@ -387,8 +706,8 @@ Sat Nov 7 16:02:10 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> Mon Nov 2 15:05:33 1998 Geoffrey Noer <noer@cygnus.com> - * configure.in: detect cygwin* instead of cygwin32* - * configure: regenerate + * configure.in: detect cygwin* instead of cygwin32* + * configure: regenerate Mon Nov 2 10:22:01 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> @@ -478,9 +797,9 @@ Thu Oct 15 18:51:12 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> Tue Oct 13 23:51:51 1998 Jeffrey A Law (law@cygnus.com) - * mkstemp.c: Check HAVE_SYS_TIME_H before including sys/time.h - * configure.in (AC_CHECK_HEADERS): Check for sys/time.h too. - * config.in, configure: Rebuilt. + * mkstemp.c: Check HAVE_SYS_TIME_H before including sys/time.h + * configure.in (AC_CHECK_HEADERS): Check for sys/time.h too. + * config.in, configure: Rebuilt. * getopt.c: Check HAVE_STRINGS_H before including strings.h. * configure.in (AC_CHECK_HEADERS): Check for strings.h too. @@ -488,7 +807,7 @@ Tue Oct 13 23:51:51 1998 Jeffrey A Law (law@cygnus.com) Mon Oct 12 19:15:59 1998 Geoffrey Noer <noer@cygnus.com> - * configure.in: in comment, call AC_EXEEXT instead of AM_EXEEXT + * configure.in: in comment, call AC_EXEEXT instead of AM_EXEEXT Sun Oct 11 17:36:06 1998 Michael Tiemann <tiemann@holodeck.cygnus.com> @@ -928,8 +1247,8 @@ Fri Feb 6 01:35:17 1998 Manfred Hollstein <manfred@s-direktnet.de> Thu Feb 5 18:48:56 1998 Geoffrey Noer <noer@cygnus.com> - * config/mh-cygwin32: remove vasprintf.o from EXTRA_OFILES - since it gets built automatically + * config/mh-cygwin32: remove vasprintf.o from EXTRA_OFILES + since it gets built automatically Sun Feb 1 02:52:32 1998 Mike Stump <mrs@wrs.com> @@ -1014,24 +1333,24 @@ Mon Sep 29 12:28:41 1997 Ian Lance Taylor <ian@cygnus.com> Mon Sep 29 12:27:59 1997 Ian Lance Taylor <ian@cygnus.com> - * pexecute.c: Use spawn if __CYGWIN32__. + * pexecute.c: Use spawn if __CYGWIN32__. 1997-08-08 Paul Eggert <eggert@twinsun.com> - * pexecute.c: Include "config.h" first, as per autoconf manual. + * pexecute.c: Include "config.h" first, as per autoconf manual. Fri Jun 27 15:20:29 1997 Scott Christley <scottc@net-community.com> - * pexecute.c (fix_argv): New function. - (pexecute): Win32 but not Cygwin32 needs its arguments fixed. - Add underscore to cwait function call. + * pexecute.c (fix_argv): New function. + (pexecute): Win32 but not Cygwin32 needs its arguments fixed. + Add underscore to cwait function call. Sun Sep 28 12:00:52 1997 Mark Mitchell <mmitchell@usa.net> - * cplus-dem.c (demangle_template): Add new parameter. Handle new - template-function mangling. - (consume_count_with_underscores): New function. - (demangle_signature): Handle new name-mangling scheme. + * cplus-dem.c (demangle_template): Add new parameter. Handle new + template-function mangling. + (consume_count_with_underscores): New function. + (demangle_signature): Handle new name-mangling scheme. Wed Sep 24 00:31:59 1997 Felix Lee <flee@yin.cygnus.com> @@ -1409,7 +1728,7 @@ Tue Jun 25 23:01:07 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) Tue Jun 25 22:50:07 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) - * Makefile.in (datadir): Set to $(prefix)/share. + * Makefile.in (datadir): Set to $(prefix)/share. Thu Jun 20 21:17:52 1996 Ian Lance Taylor <ian@cygnus.com> @@ -1455,7 +1774,7 @@ Wed Apr 17 11:17:55 1996 Doug Evans <dje@canuck.cygnus.com> Tue Apr 16 11:27:16 1996 Jeffrey A Law (law@cygnus.com) - * Makefile.in (lneeded-list): If alloca.o is needed, so is xmalloc.o. + * Makefile.in (lneeded-list): If alloca.o is needed, so is xmalloc.o. Reverts Feb 8, 1995 change. Mon Apr 15 12:53:26 1996 Doug Evans <dje@canuck.cygnus.com> @@ -1709,7 +2028,7 @@ Wed Jun 28 19:13:23 1995 Jason Merrill <jason@phydeaux.cygnus.com> * cplus-dem.c: Update from gcc. * argv.c, dummy.c: If __STDC__, #include "alloca-conf.h" after - <stddef.h>. + <stddef.h>. * alloca-norm.h: If __STDC__, declare alloca with its parameter. Thu Jun 22 18:57:47 1995 Stan Shebs <shebs@andros.cygnus.com> @@ -1802,17 +2121,17 @@ Mon May 15 19:53:17 1995 Per Bothner <bothner@kalessin.cygnus.com> Thu May 4 14:36:42 1995 Jason Merrill <jason@phydeaux.cygnus.com> * cplus-dem.c: Use const instead of CONST. Don't include - ansidecl.h directly. + ansidecl.h directly. Wed Apr 19 01:30:27 1995 Jason Merrill <jason@phydeaux.cygnus.com> * cplus-dem.c: Don't include libiberty.h. Do declare xmalloc and - xrealloc. + xrealloc. (-DMAIN): Don't rely on an externally-defined version number; - instead, require the version number to be defined as a - preprocessor macro. Handle the RS/6000 leading dot. Define - xmalloc, xrealloc and fatal. Don't strip a leading underscore - if we couldn't demangle the word. + instead, require the version number to be defined as a + preprocessor macro. Handle the RS/6000 leading dot. Define + xmalloc, xrealloc and fatal. Don't strip a leading underscore + if we couldn't demangle the word. Tue Apr 4 13:03:51 1995 Stan Shebs <shebs@andros.cygnus.com> @@ -1986,7 +2305,7 @@ Fri Aug 19 15:29:12 1994 Kung Hsu (kung@mexican.cygnus.com) Thu Aug 18 14:37:14 1994 Kung Hsu (kung@mexican.cygnus.com) * cplus-dem.c (demangle args): Handle ARM repeat encoding where - the type index is greater than 9. + the type index is greater than 9. Wed Aug 17 16:13:49 1994 Kung Hsu (kung@mexican.cygnus.com) @@ -2048,7 +2367,7 @@ Thu Jun 16 17:54:01 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) Sun Jun 12 01:37:09 1994 Jason Merrill (jason@deneb.cygnus.com) * cplus-dem.c (demangle_template): Separate consecutive >'s with a - space. + space. (gnu_special): Demangle template and qualified names in a vtable name. Fri May 27 12:27:52 1994 Ken Raeburn (raeburn@cujo.cygnus.com) @@ -2092,13 +2411,13 @@ Fri May 6 11:01:59 1994 D. V. Henkel-Wallace (gumby@rtl.cygnus.com) Mon Apr 11 00:54:33 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * getopt.c [not __GNU_LIBRARY__] [__GCC__] [not __STDC__]: - Declare strlen to return int. Don't include stddef.h. + * getopt.c [not __GNU_LIBRARY__] [__GCC__] [not __STDC__]: + Declare strlen to return int. Don't include stddef.h. Fri Apr 1 00:38:17 1994 Jim Wilson (wilson@mole.gnu.ai.mit.edu) - * getopt.c: Delete use of IN_GCC to control whether - stddef.h or gstddef.h is included. + * getopt.c: Delete use of IN_GCC to control whether + stddef.h or gstddef.h is included. Thu Apr 14 14:00:56 1994 Kung Hsu (kung@mexican.cygnus.com) @@ -2171,27 +2490,27 @@ Thu Feb 24 11:51:12 1994 David J. Mackenzie (djm@rtl.cygnus.com) Thu Feb 10 14:44:16 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * getopt.c [not __GNU_LIBRARY__] [__GNUC__] [not IN_GCC]: - Test just __STDC__, not emacs. + * getopt.c [not __GNU_LIBRARY__] [__GNUC__] [not IN_GCC]: + Test just __STDC__, not emacs. Wed Feb 9 00:14:00 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * getopt.c [not __GNU_LIBRARY__] [__GNUC__] [not IN_GCC] - [emacs] [not __STDC__]: Don't include stddef.h. Don't declare strlen. + * getopt.c [not __GNU_LIBRARY__] [__GNUC__] [not IN_GCC] + [emacs] [not __STDC__]: Don't include stddef.h. Don't declare strlen. Fri Dec 24 19:43:00 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) - * getopt.c (_NO_PROTO): Define before config.h is included. + * getopt.c (_NO_PROTO): Define before config.h is included. Mon Sep 20 15:59:03 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - * getopt.c, getopt1.c [emacs || CONFIG_BROKETS]: Include + * getopt.c, getopt1.c [emacs || CONFIG_BROKETS]: Include <config.h> only under these, else "config.h". Thu Aug 12 18:16:49 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - * getopt.c, getopt1.c [HAVE_CONFIG_H]: Include - <config.h> instead of "config.h". + * getopt.c, getopt1.c [HAVE_CONFIG_H]: Include + <config.h> instead of "config.h". Sun Feb 20 17:17:01 1994 Ian Lance Taylor (ian@lisa.cygnus.com) @@ -2567,7 +2886,7 @@ Fri May 21 09:53:57 1993 Jim Kingdon (kingdon@lioth.cygnus.com) Tue May 18 17:12:10 1993 Fred Fish (fnf@cygnus.com) - (merge changes from dlong@cse.ucsc.edu) + (merge changes from dlong@cse.ucsc.edu) * cplus-dem.c (consume_count): Simplify. * cplus-dem.c (arm_pt, demangle_class_name): New functions. * cplus-dem.c (various): Calls to arm_pt, demangle_class_name. diff --git a/gnu/egcs/libiberty/Makefile.in b/gnu/egcs/libiberty/Makefile.in index 622b92c1400..9aa57f06d4b 100644 --- a/gnu/egcs/libiberty/Makefile.in +++ b/gnu/egcs/libiberty/Makefile.in @@ -1,6 +1,6 @@ # # Makefile -# Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 +# Copyright (C) 1990, 91 - 99, 2000 # Free Software Foundation # # This file is part of the libiberty library. @@ -85,7 +85,15 @@ FLAGS_TO_PASS = \ "LDFLAGS=$(LDFLAGS)" \ "LOADLIBES=$(LOADLIBES)" \ "RANLIB=$(RANLIB)" \ - "SHELL=$(SHELL)" + "SHELL=$(SHELL)" \ + "prefix=$(prefix)" \ + "exec_prefix=$(exec_prefix)" \ + "libdir=$(libdir)" \ + "libsubdir=$(libsubdir)" \ + "tooldir=$(tooldir)" + +# Subdirectories to recurse into. We need to override this during cleaning +SUBDIRS = testsuite all: stamp-picdir $(TARGETLIB) needed-list required-list all-subdir @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all @@ -98,7 +106,7 @@ installcheck: installcheck-subdir INCDIR=$(srcdir)/$(MULTISRCTOP)../include -COMPILE.c = $(CC) -c @DEFS@ $(LIBCFLAGS) -I. -I$(INCDIR) $(HDEFINES) +COMPILE.c = $(CC) -c @DEFS@ $(LIBCFLAGS) -I. -I$(INCDIR) $(HDEFINES) @ac_libiberty_warn_cflags@ .c.o: test x"$(enable_shared)" != xyes || \ $(COMPILE.c) $(PICFLAG) $< -o pic/$@ @@ -115,23 +123,24 @@ HFILES = alloca-conf.h # NOTE: If you add new files to the library, add them to this list # (alphabetical), and add them to REQUIRED_OFILES or funcs in # configure.in. -CFILES = asprintf.c alloca.c argv.c atexit.c basename.c bcmp.c bcopy.c \ - bzero.c choose-temp.c clock.c concat.c cplus-dem.c fdmatch.c \ - fnmatch.c getcwd.c getopt.c getopt1.c getpagesize.c \ - getruntime.c floatformat.c hex.c index.c insque.c memchr.c \ - memcmp.c memcpy.c memmove.c memset.c mkstemps.c objalloc.c obstack.c \ - pexecute.c random.c rename.c rindex.c sigsetmask.c spaces.c \ - splay-tree.c strcasecmp.c strncasecmp.c strchr.c strdup.c strerror.c \ - strrchr.c strsignal.c strstr.c strtod.c strtol.c strtoul.c \ - tmpnam.c vasprintf.c vfork.c vfprintf.c vprintf.c vsprintf.c \ - waitpid.c xatexit.c xexit.c xmalloc.c xstrdup.c xstrerror.c +CFILES = asprintf.c alloca.c argv.c atexit.c basename.c bcmp.c bcopy.c \ + bzero.c calloc.c choose-temp.c clock.c concat.c cplus-dem.c fdmatch.c \ + fnmatch.c getcwd.c getpwd.c getopt.c getopt1.c getpagesize.c \ + getruntime.c floatformat.c hashtab.c hex.c index.c insque.c memchr.c \ + memcmp.c memcpy.c memmove.c memset.c mkstemps.c objalloc.c obstack.c \ + partition.c pexecute.c putenv.c random.c rename.c rindex.c \ + setenv.c sigsetmask.c spaces.c splay-tree.c strcasecmp.c \ + strncasecmp.c strchr.c strdup.c strerror.c strrchr.c \ + strsignal.c strstr.c strtod.c strtol.c strtoul.c tmpnam.c \ + vasprintf.c vfork.c vfprintf.c vprintf.c vsprintf.c waitpid.c \ + xatexit.c xexit.c xmalloc.c xmemdup.c xstrdup.c xstrerror.c # These are always included in the library. REQUIRED_OFILES = argv.o choose-temp.o concat.o cplus-dem.o \ - fdmatch.o fnmatch.o getopt.o getopt1.o getruntime.o hex.o \ - floatformat.o objalloc.o obstack.o pexecute.o spaces.o \ + fdmatch.o fnmatch.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o \ + hex.o floatformat.o objalloc.o obstack.o partition.o pexecute.o spaces.o \ splay-tree.o strerror.o strsignal.o xatexit.o xexit.o xmalloc.o \ - xstrdup.o xstrerror.o + xmemdup.o xstrdup.o xstrerror.o $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(ALLOCA) rm -f $(TARGETLIB) @@ -143,24 +152,32 @@ INSTALL_DEST = @INSTALL_DEST@ install: install_to_$(INSTALL_DEST) install-subdir install_to_libdir: all - $(INSTALL_DATA) $(TARGETLIB) $(libdir)$(MULTISUBDIR)/$(TARGETLIB).n - ( cd $(libdir)$(MULTISUBDIR) ; $(RANLIB) $(TARGETLIB).n ) - mv -f $(libdir)$(MULTISUBDIR)/$(TARGETLIB).n $(libdir)$(MULTISUBDIR)/$(TARGETLIB) + $(INSTALL_DATA) $(TARGETLIB) $(libdir)$(MULTISUBDIR)/$(TARGETLIB)n + ( cd $(libdir)$(MULTISUBDIR) ; $(RANLIB) $(TARGETLIB)n ) + mv -f $(libdir)$(MULTISUBDIR)/$(TARGETLIB)n $(libdir)$(MULTISUBDIR)/$(TARGETLIB) @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install install_to_tooldir: all - $(INSTALL_DATA) $(TARGETLIB) $(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB).n - ( cd $(tooldir)/lib$(MULTISUBDIR) ; $(RANLIB) $(TARGETLIB).n ) - mv -f $(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB).n $(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB) + $(INSTALL_DATA) $(TARGETLIB) $(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB)n + ( cd $(tooldir)/lib$(MULTISUBDIR) ; $(RANLIB) $(TARGETLIB)n ) + mv -f $(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB)n $(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB) @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install -# needed-list is used by libstdc++. +# needed-list is used by libstdc++. NEEDED is the list of functions +# to include there. Do not add anything LGPL to this list; libstdc++ +# can't use anything encumbering. +NEEDED = atexit calloc memchr memcmp memcpy memmove memset rename strchr \ + strerror strrchr strstr strtol strtoul tmpnam vfprintf vprintf \ + vfork waitpid bcmp bcopy bzero needed-list: Makefile - f="$(LIBOBJS) $(ALLOCA) $(EXTRA_OFILES)"; \ - case $$f in \ - *alloca.o*) f="$$f xmalloc.o xexit.o" ;; \ - esac; \ - echo $$f > needed-list + rm -f needed-list; touch needed-list; \ + for f in $(NEEDED); do \ + for g in $(LIBOBJS) $(EXTRA_OFILES); do \ + case "$$g" in \ + *$$f*) echo $$g >> needed-list ;; \ + esac; \ + done; \ + done # required-list was used when building a shared bfd/opcodes/libiberty # library. I don't know if it used by anything currently. @@ -191,19 +208,24 @@ ls: # Need to deal with profiled libraries, too. +# Cleaning has to be done carefully to ensure that we don't clean our SUBDIRS +# multiple times, hence our explicit recursion with an empty SUBDIRS. mostlyclean: mostlyclean-subdir rm -rf *.o pic core errs \#* *.E a.out rm -f needed.awk needed2.awk errors dummy needed-list config.h stamp-* rm -f $(CONFIG_H) $(NEEDED_LIST) stamp-picdir @$(MULTICLEAN) multi-clean DO=mostlyclean -clean: mostlyclean clean-subdir +clean: clean-subdir + $(MAKE) SUBDIRS="" mostlyclean rm -f *.a required-list tmpmulti.out @$(MULTICLEAN) multi-clean DO=clean -distclean: clean distclean-subdir +distclean: distclean-subdir + $(MAKE) SUBDIRS="" clean @$(MULTICLEAN) multi-clean DO=distclean rm -f *~ Makefile config.status xhost-mkfrag TAGS multilib.out rm -f config.log -maintainer-clean realclean: distclean maintainer-clean-subdir +maintainer-clean realclean: maintainer-clean-subdir + $(MAKE) SUBDIRS="" distclean force: @@ -223,7 +245,9 @@ install-info-subdir clean-info-subdir dvi-subdir install-subdir \ etags-subdir mostlyclean-subdir clean-subdir distclean-subdir \ maintainer-clean-subdir: @target=`echo $@ | sed -e 's/-subdir//'`; \ - cd testsuite && $(MAKE) $$target + for dir in . $(SUBDIRS) ; do \ + test $$dir = . || (cd $$dir && $(MAKE) $$target) || exit 1; \ + done $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(ALLOCA): stamp-picdir @@ -241,13 +265,16 @@ getcwd.o: config.h getopt.o: config.h $(INCDIR)/getopt.h getopt1.o: config.h $(INCDIR)/getopt.h getpagesize.o: config.h +getpwd.o: config.h $(INCDIR)/libiberty.h getruntime.o: config.h $(INCDIR)/libiberty.h hex.o: $(INCDIR)/libiberty.h floatformat.o: $(INCDIR)/floatformat.h mkstemps.o: config.h objalloc.o: $(INCDIR)/objalloc.h obstack.o: config.h $(INCDIR)/obstack.h +partition.o: config.h $(INCDIR)/partition.h pexecute.o: config.h $(INCDIR)/libiberty.h +setenv.o: config.h spaces.o: $(INCDIR)/libiberty.h splay-tree.o: config.h $(INCDIR)/libiberty.h $(INCDIR)/splay-tree.h $(INCDIR)/ansidecl.h strerror.o: config.h $(INCDIR)/libiberty.h @@ -255,5 +282,7 @@ strsignal.o: config.h $(INCDIR)/libiberty.h xatexit.o: $(INCDIR)/libiberty.h xexit.o: $(INCDIR)/libiberty.h xmalloc.o: $(INCDIR)/libiberty.h +xmemdup.o: config.h $(INCDIR)/libiberty.h xstrdup.o: config.h $(INCDIR)/libiberty.h xstrerror.o: config.h $(INCDIR)/libiberty.h +hashtab.o: config.h $(INCDIR)/libiberty.h $(INCDIR)/hashtab.h $(INCDIR)/ansidecl.h diff --git a/gnu/egcs/libiberty/argv.c b/gnu/egcs/libiberty/argv.c index 85c17e930ee..f596ffd0110 100644 --- a/gnu/egcs/libiberty/argv.c +++ b/gnu/egcs/libiberty/argv.c @@ -35,12 +35,8 @@ Boston, MA 02111-1307, USA. */ #ifdef __STDC__ #include <stddef.h> -extern void *memcpy (void *s1, const void *s2, size_t n); /* 4.11.2.1 */ -extern size_t strlen (const char *s); /* 4.11.6.3 */ -extern void *malloc (size_t size); /* 4.10.3.3 */ -extern void *realloc (void *ptr, size_t size); /* 4.10.3.4 */ -extern void free (void *ptr); /* 4.10.3.2 */ -extern char *strdup (const char *s); /* Non-ANSI */ +#include <string.h> +#include <stdlib.h> #else /* !__STDC__ */ diff --git a/gnu/egcs/libiberty/basename.c b/gnu/egcs/libiberty/basename.c index f544c853910..7698f06f8ae 100644 --- a/gnu/egcs/libiberty/basename.c +++ b/gnu/egcs/libiberty/basename.c @@ -14,24 +14,53 @@ DESCRIPTION last component of the pathname ("ls.c" in this case). BUGS - Presumes a UNIX style path with UNIX style separators. + Presumes a UNIX or DOS/Windows style path with UNIX or DOS/Windows + style separators. */ #include "ansidecl.h" #include "libiberty.h" +#include <ctype.h> + +#ifndef DIR_SEPARATOR +#define DIR_SEPARATOR '/' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +#define HAVE_DOS_BASED_FILE_SYSTEM +#ifndef DIR_SEPARATOR_2 +#define DIR_SEPARATOR_2 '\\' +#endif +#endif + +/* Define IS_DIR_SEPARATOR. */ +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ char * basename (name) const char *name; { - const char *base = name; + const char *base; - while (*name) +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha (name[0]) && name[1] == ':') + name += 2; +#endif + + for (base = name; *name; name++) { - if (*name++ == '/') + if (IS_DIR_SEPARATOR (*name)) { - base = name; + base = name + 1; } } return (char *) base; } + diff --git a/gnu/egcs/libiberty/config.in b/gnu/egcs/libiberty/config.in index 520729f894e..6e64208da92 100644 --- a/gnu/egcs/libiberty/config.in +++ b/gnu/egcs/libiberty/config.in @@ -85,6 +85,9 @@ /* Define if you have the getrusage function. */ #undef HAVE_GETRUSAGE +/* Define if you have the gettimeofday function. */ +#undef HAVE_GETTIMEOFDAY + /* Define if you have the index function. */ #undef HAVE_INDEX @@ -115,6 +118,9 @@ /* Define if you have the psignal function. */ #undef HAVE_PSIGNAL +/* Define if you have the putenv function. */ +#undef HAVE_PUTENV + /* Define if you have the random function. */ #undef HAVE_RANDOM @@ -127,6 +133,9 @@ /* Define if you have the sbrk function. */ #undef HAVE_SBRK +/* Define if you have the setenv function. */ +#undef HAVE_SETENV + /* Define if you have the sigsetmask function. */ #undef HAVE_SIGSETMASK @@ -202,6 +211,12 @@ /* Define if you have the <sys/param.h> header file. */ #undef HAVE_SYS_PARAM_H +/* Define if you have the <sys/resource.h> header file. */ +#undef HAVE_SYS_RESOURCE_H + +/* Define if you have the <sys/stat.h> header file. */ +#undef HAVE_SYS_STAT_H + /* Define if you have the <sys/time.h> header file. */ #undef HAVE_SYS_TIME_H diff --git a/gnu/egcs/libiberty/configure.in b/gnu/egcs/libiberty/configure.in index 3fcfe9dcaa2..cc1b2c2082b 100644 --- a/gnu/egcs/libiberty/configure.in +++ b/gnu/egcs/libiberty/configure.in @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script -AC_PREREQ(2.12.1) +AC_PREREQ(2.13) AC_INIT(pexecute.c) dnl We use these options to decide which functions to include. @@ -55,6 +55,7 @@ AC_PROG_CC_GNU if test $ac_cv_prog_gcc = yes; then GCC=yes + ac_libiberty_warn_cflags='-W -Wall -Wtraditional' dnl Check whether -g works, even if CFLAGS is set, in case the package dnl plays around with CFLAGS (such as to build both debugging and dnl normal versions of a library), tasteless as that idea is. @@ -71,9 +72,11 @@ dnl normal versions of a library), tasteless as that idea is. fi else GCC= + ac_libiberty_warn_cflags= test "${CFLAGS+set}" = set || CFLAGS="-g" fi ]) +AC_SUBST(ac_libiberty_warn_cflags) LIB_AC_PROG_CC @@ -106,7 +109,7 @@ AC_SUBST_FILE(host_makefile_frag) # It's OK to check for header files. Although the compiler may not be # able to link anything, it had better be able to at least compile # something. -AC_CHECK_HEADERS(sys/file.h sys/param.h stdlib.h string.h unistd.h strings.h sys/time.h sys/resource.h) +AC_CHECK_HEADERS(sys/file.h sys/param.h stdlib.h string.h unistd.h strings.h sys/time.h sys/resource.h sys/stat.h) AC_HEADER_SYS_WAIT # This is the list of functions which libiberty will provide if they @@ -130,9 +133,11 @@ funcs="$funcs memcpy" funcs="$funcs memmove" funcs="$funcs memset" funcs="$funcs mkstemps" +funcs="$funcs putenv" funcs="$funcs random" funcs="$funcs rename" funcs="$funcs rindex" +funcs="$funcs setenv" funcs="$funcs sigsetmask" funcs="$funcs strcasecmp" funcs="$funcs strchr" @@ -154,21 +159,21 @@ funcs="$funcs waitpid" vars="sys_errlist sys_nerr sys_siglist" -checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk" +checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk gettimeofday" # These are neither executed nor required, but they help keep # autoheader happy without adding a bunch of text to acconfig.h. if test "x" = "y"; then AC_CHECK_FUNCS(asprintf atexit basename bcmp bcopy bzero calloc clock getcwd) AC_CHECK_FUNCS(getpagesize index insque mkstemps memchr memcmp memcpy memmove) - AC_CHECK_FUNCS(memset random rename rindex sigsetmask strcasecmp) - AC_CHECK_FUNCS(strchr strdup strncasecmp strrchr strstr strtod strtol) + AC_CHECK_FUNCS(memset putenv random rename rindex sigsetmask strcasecmp) + AC_CHECK_FUNCS(setenv strchr strdup strncasecmp strrchr strstr strtod strtol) AC_CHECK_FUNCS(strtoul tmpnam vasprintf vfprintf vprintf vsprintf waitpid) AC_DEFINE(HAVE_SYS_ERRLIST) AC_DEFINE(HAVE_SYS_NERR) AC_DEFINE(HAVE_SYS_SIGLIST) AC_CHECK_FUNCS(getrusage on_exit psignal strerror strsignal sysconf times) - AC_CHECK_FUNCS(sbrk) + AC_CHECK_FUNCS(sbrk gettimeofday) fi # For each of these functions, if the host does not provide the @@ -291,6 +296,11 @@ if test -z "${setobjs}"; then # can hang configure; on other versions, vfork exists just as a stub. # FIXME: This should be removed once vfork in uwin's runtime is fixed. ac_cv_func_vfork_works=no + # Under uwin 2.0+, sys_nerr and sys_errlist exist, but they are + # macros (actually, these are imported from a DLL, but the end effect + # is the same), so the test below won't find them. + AC_DEFINE(HAVE_SYS_NERR) + AC_DEFINE(HAVE_SYS_ERRLIST) ;; esac diff --git a/gnu/egcs/libiberty/floatformat.c b/gnu/egcs/libiberty/floatformat.c index c4f21e4ce89..1d8f16df353 100644 --- a/gnu/egcs/libiberty/floatformat.c +++ b/gnu/egcs/libiberty/floatformat.c @@ -1,5 +1,5 @@ /* IEEE floating point support routines, for GDB, the GNU Debugger. - Copyright (C) 1991, 1994 Free Software Foundation, Inc. + Copyright (C) 1991, 1994, 1999 Free Software Foundation, Inc. This file is part of GDB. @@ -128,7 +128,7 @@ get_field (data, order, total_len, start, len) --cur_byte; /* Move towards the most significant part of the field. */ - while (cur_bitshift < len) + while ((unsigned int) cur_bitshift < len) { if (len - cur_bitshift < FLOATFORMAT_CHAR_BIT) /* This is the last byte; zero out the bits which are not part of @@ -179,7 +179,7 @@ floatformat_to_double (fmt, from, to) mant_off = fmt->man_start; dto = 0.0; - special_exponent = exponent == 0 || exponent == fmt->exp_nan; + special_exponent = exponent == 0 || (unsigned long) exponent == fmt->exp_nan; /* Don't bias zero's, denorms or NaNs. */ if (!special_exponent) @@ -255,7 +255,7 @@ put_field (data, order, total_len, start, len, stuff_to_put) --cur_byte; /* Move towards the most significant part of the field. */ - while (cur_bitshift < len) + while ((unsigned int) cur_bitshift < len) { if (len - cur_bitshift < FLOATFORMAT_CHAR_BIT) { @@ -335,7 +335,7 @@ floatformat_from_double (fmt, from, to) If we are discarding a zero, we should be (but are not) creating a denormalized number which means adjusting the exponent (I think). */ - if (mant_bits_left == fmt->man_len + if ((unsigned int) mant_bits_left == fmt->man_len && fmt->intbit == floatformat_intbit_no) { mant_long &= 0x7fffffff; diff --git a/gnu/egcs/libiberty/getcwd.c b/gnu/egcs/libiberty/getcwd.c index 06d55c04f58..47b1c1eec31 100644 --- a/gnu/egcs/libiberty/getcwd.c +++ b/gnu/egcs/libiberty/getcwd.c @@ -14,6 +14,9 @@ DESCRIPTION current directory's path doesn't fit in LEN characters, the result is NULL and errno is set. + If pathname is a null pointer, getcwd() will obtain size bytes of + space using malloc. + BUGS Emulated via the getwd() call, which is reasonable for most systems that do not have getcwd(). @@ -48,6 +51,13 @@ getcwd (buf, len) errno = ERANGE; return 0; } + if (!buf) { + buf = (char*)malloc(len); + if (!buf) { + errno = ENOMEM; + return 0; + } + } strcpy (buf, ourbuf); } return buf; diff --git a/gnu/egcs/libiberty/getruntime.c b/gnu/egcs/libiberty/getruntime.c index c7a33d78d7c..b855ea6e82f 100644 --- a/gnu/egcs/libiberty/getruntime.c +++ b/gnu/egcs/libiberty/getruntime.c @@ -40,6 +40,10 @@ Boston, MA 02111-1307, USA. */ #include <sys/times.h> #endif +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif + /* This is a fallback; if wrong, it will likely make obviously wrong results. */ @@ -47,8 +51,16 @@ Boston, MA 02111-1307, USA. */ #define CLOCKS_PER_SEC 1 #endif -#if defined (HAVE_TIMES) && ! defined (HZ) -#define HZ CLOCKS_PER_SEC +#ifdef _SC_CLK_TCK +#define GNU_HZ sysconf(_SC_CLK_TCK) +#else +#ifdef HZ +#define GNU_HZ HZ +#else +#ifdef CLOCKS_PER_SEC +#define GNU_HZ CLOCKS_PER_SEC +#endif +#endif #endif long @@ -65,7 +77,7 @@ get_run_time () struct tms tms; times (&tms); - return (tms.tms_utime + tms.tms_stime) * (1000000 / HZ); + return (tms.tms_utime + tms.tms_stime) * (1000000 / GNU_HZ); #else /* ! HAVE_TIMES */ /* Fall back on clock and hope it's correctly implemented. */ const long clocks_per_sec = CLOCKS_PER_SEC; diff --git a/gnu/egcs/libiberty/setenv.c b/gnu/egcs/libiberty/setenv.c index 8a039d18fa8..eec13006c22 100644 --- a/gnu/egcs/libiberty/setenv.c +++ b/gnu/egcs/libiberty/setenv.c @@ -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) diff --git a/gnu/egcs/libiberty/splay-tree.c b/gnu/egcs/libiberty/splay-tree.c index b6bb5a6a8f0..22ea07d84ad 100644 --- a/gnu/egcs/libiberty/splay-tree.c +++ b/gnu/egcs/libiberty/splay-tree.c @@ -1,5 +1,5 @@ /* A splay-tree datatype. - Copyright (C) 1998 Free Software Foundation, Inc. + Copyright (C) 1998, 1999 Free Software Foundation, Inc. Contributed by Mark Mitchell (mark@markmitchell.com). This file is part of GNU CC. @@ -235,7 +235,7 @@ splay_tree_new (compare_fn, delete_key_fn, delete_value_fn) splay_tree_delete_key_fn delete_key_fn; splay_tree_delete_value_fn delete_value_fn; { - splay_tree sp = (splay_tree) xmalloc (sizeof (struct splay_tree)); + splay_tree sp = (splay_tree) xmalloc (sizeof (struct splay_tree_s)); sp->root = 0; sp->comp = compare_fn; sp->delete_key = delete_key_fn; @@ -256,15 +256,15 @@ splay_tree_delete (sp) /* Insert a new node (associating KEY with DATA) into SP. If a previous node with the indicated KEY exists, its data is replaced - with the new value. */ + with the new value. Returns the new node. */ -void +splay_tree_node splay_tree_insert (sp, key, value) splay_tree sp; splay_tree_key key; splay_tree_value value; { - int comparison; + int comparison = 0; splay_tree_splay (sp, key); @@ -284,7 +284,7 @@ splay_tree_insert (sp, key, value) /* Create a new node, and insert it at the root. */ splay_tree_node node; - node = (splay_tree_node) xmalloc (sizeof (struct splay_tree_node)); + node = (splay_tree_node) xmalloc (sizeof (struct splay_tree_node_s)); node->key = key; node->value = value; @@ -305,6 +305,8 @@ splay_tree_insert (sp, key, value) sp->root = node; } + + return sp->root; } /* Lookup KEY in SP, returning VALUE if present, and NULL diff --git a/gnu/egcs/libiberty/strtol.c b/gnu/egcs/libiberty/strtol.c index 37d170660f2..5467cc3e2e9 100644 --- a/gnu/egcs/libiberty/strtol.c +++ b/gnu/egcs/libiberty/strtol.c @@ -10,10 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. + * 3. [rescinded 22 July 1999] * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. diff --git a/gnu/egcs/libiberty/strtoul.c b/gnu/egcs/libiberty/strtoul.c index ff6f2d6784d..2ec32043e6b 100644 --- a/gnu/egcs/libiberty/strtoul.c +++ b/gnu/egcs/libiberty/strtoul.c @@ -10,10 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. + * 3. [rescinded 22 July 1999] * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -91,7 +88,7 @@ strtoul(nptr, endptr, base) break; if (c >= base) break; - if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim) + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) any = -1; else { any = 1; diff --git a/gnu/egcs/libiberty/testsuite/demangle-expected b/gnu/egcs/libiberty/testsuite/demangle-expected index ad04d116d8b..d3a1fe43890 100644 --- a/gnu/egcs/libiberty/testsuite/demangle-expected +++ b/gnu/egcs/libiberty/testsuite/demangle-expected @@ -2470,3 +2470,19 @@ _Utf390_1__1_9223372036854775807__9223372036854775 --format=gnu call__H1Z4Test_RX01_t1C2ZX01PMX01FPX01i_vQ2X016output C<Test, Test::output> call<Test>(Test &) +# +--format=gnu +fn__FPQ21n1cPMQ21n1cFPQ21n1c_i +fn(n::c *, int (n::c::*)(n::c *)) +# +--format=gnu +f__FGt3Bar1i21i +f(Bar<2>, i) +# +--format=gnu +f__FGt3Bar1i_21_i +f(Bar<21>, int) +# +--format=gnu +f__FGt3Bar1i24XY_t +f(Bar<2>, XY_t) diff --git a/gnu/egcs/libiberty/vasprintf.c b/gnu/egcs/libiberty/vasprintf.c index eeb80e661f7..b959f5f9ca5 100644 --- a/gnu/egcs/libiberty/vasprintf.c +++ b/gnu/egcs/libiberty/vasprintf.c @@ -105,6 +105,7 @@ int_vasprintf (result, format, args) (void) va_arg (ap, char *); break; } + p++; } } #ifdef TEST diff --git a/gnu/egcs/libiberty/xmalloc.c b/gnu/egcs/libiberty/xmalloc.c index be25c5aca19..621c6d216c7 100644 --- a/gnu/egcs/libiberty/xmalloc.c +++ b/gnu/egcs/libiberty/xmalloc.c @@ -81,12 +81,12 @@ xmalloc (size) else allocated = (char *) sbrk (0) - (char *) &environ; fprintf (stderr, - "\n%s%sCan not allocate %lu bytes after allocating %lu bytes\n", + "\n%s%sCannot allocate %lu bytes after allocating %lu bytes\n", name, *name ? ": " : "", (unsigned long) size, (unsigned long) allocated); #else /* HAVE_SBRK */ fprintf (stderr, - "\n%s%sCan not allocate %lu bytes\n", + "\n%s%sCannot allocate %lu bytes\n", name, *name ? ": " : "", (unsigned long) size); #endif /* HAVE_SBRK */ @@ -116,12 +116,12 @@ xcalloc (nelem, elsize) else allocated = (char *) sbrk (0) - (char *) &environ; fprintf (stderr, - "\n%s%sCan not allocate %lu bytes after allocating %lu bytes\n", + "\n%s%sCannot allocate %lu bytes after allocating %lu bytes\n", name, *name ? ": " : "", (unsigned long) (nelem * elsize), (unsigned long) allocated); #else /* HAVE_SBRK */ fprintf (stderr, - "\n%s%sCan not allocate %lu bytes\n", + "\n%s%sCannot allocate %lu bytes\n", name, *name ? ": " : "", (unsigned long) (nelem * elsize)); #endif /* HAVE_SBRK */ @@ -154,12 +154,12 @@ xrealloc (oldmem, size) else allocated = (char *) sbrk (0) - (char *) &environ; fprintf (stderr, - "\n%s%sCan not reallocate %lu bytes after allocating %lu bytes\n", + "\n%s%sCannot reallocate %lu bytes after allocating %lu bytes\n", name, *name ? ": " : "", (unsigned long) size, (unsigned long) allocated); #else /* HAVE_SBRK */ fprintf (stderr, - "\n%s%sCan not reallocate %lu bytes\n", + "\n%s%sCannot reallocate %lu bytes\n", name, *name ? ": " : "", (unsigned long) size); #endif /* HAVE_SBRK */ |