Commit Graph

25 Commits

Author SHA1 Message Date
Jakub Jelinek 2afd3180c5 Update copyright years.
From-SVN: r244052
2017-01-04 12:30:51 +01:00
David Malcolm e39423c06d libiberty: Expose choose_tmpdir, and fix constness of return type
include/ChangeLog:
	* libiberty.h (choose_tmpdir): New prototype.

libiberty/ChangeLog:
	* choose-temp.c (choose_tmpdir): Remove now-redundant local
	copy of prototype.
	* functions.texi: Regenerate.
	* make-temp-file.c (choose_tmpdir): Convert return type from
	char * to const char * - given that this returns a pointer to
	a memoized allocation, the caller must not touch it.

From-SVN: r216285
2014-10-15 20:20:05 +00:00
Ozkan Sezer bcf11ab47f choose-temp.c: Include unistd.h for mingw targets.
2009-09-22  Ozkan Sezer  <sezeroz@gmail.com>

        * choose-temp.c: Include unistd.h for mingw targets.

From-SVN: r152029
2009-09-22 18:34:12 +02:00
Ralf Wildenhues 15b16eb559 hex.c: Fix typo.
* hex.c: Fix typo.
* choose-temp.c: Likewise.
* functions.texi: Regenerate.

From-SVN: r121435
2007-01-31 15:05:50 -05:00
Ben Elliston 7d37bf39d0 choose-temp.c (choose_temp_base): Check the result of the call to mktemp rather than testing the length of the...
* choose-temp.c (choose_temp_base): Check the result of the call
	to mktemp rather than testing the length of the modified string.

From-SVN: r120698
2007-01-12 11:37:48 +11:00
Gabriel Dos Reis d7cf8390c7 libiberty.h (ACONCAT): Properly cast value of alloca().
include/
2005-05-24  Gabriel Dos Reis  <gdr@integrable-solutions.net>

	* libiberty.h (ACONCAT): Properly cast value of alloca().

	* ansidecl.h (ATTRIBUTE_UNUSED_LABEL): Don't define if
	__cplusplus.

libiberty/
2005-05-24  Gabriel Dos Reis  <gdr@integrable-solutions.net>

	* configure.ac: Check declarations for calloc(), getenv(),
	malloc(), realloc() and sbrk().
	* config.in: Regenerate.
	* configure: Likewise.

	* alloca.c (C_alloca): Change "new" to "new_storage".  Use XNEWVEC
	instead of xmalloc.
	* choose-temp.c (choose_temp_base): Use XNEWVEC instea od xmalloc.
	* concat.c (liiberty_concat_ptr): Surround definition with an
	extern "C" block, if __cplusplus.
	(concat): Use XNEWVEC instead of xmalloc.
	(reconcat): Likewise.
	* cp-demangle.c (struct d_print_template): Rename member
	"template" to "template_decl".  Adjust use throughout the file.
	(d_print_resize): Properly cast return value of realloc().
	(cplus_demangle_print): Same for malloc().
	(d_demangle): Likewise.
	* cp-demint.c (cplus_demangle_fill_builtin_type): Rename parameter
	"typename" to "type_name".
	* cplus-dem.c (grow_vect): Use XRESIZEVEC instead of xrealloc().
	(work_stuff_copy_to_from): Use XNEWVEC insteand of xmalloc().
	(demangle_template_value_parm): Likewise.
	(demangle_template): Likewise.
	(recursively_demangle): Likewise.
	(do_hpacc_template_literal): Likewise.
	(do_arg): Likewise.
	(remember_type): Likewise.
	(remember_Ktype): Likewise.
	(register_Btype): Likewise.
	(string_need): Use XRESIZEVEC instead of xrealloc().
	* dyn-string.c (dyn_string_init): Use XNEWVEC.
	(dyn_string_new): Use XNEW.
	(dyn_string_resize): Use XRESIZEVEC.
	* fnmatch.c (fnmatch): Rename local variable "not" to "negate".
	* getopt.c (getenv): Declare only if !__cplusplus and !getenv.
	Otherwise include <stdlib.h>.
	(exchange): Cast return value of malloc().
	* hashtab.c (htab_size): Define as both macro and non-inline
	function.
	(htab_elements): Likewise.
	* getpwd.c (getpwd): Use XNEWVEC.
	(htab_create_alloc_ex): Use C90 prototype-style.
	* lrealpath.c (lrealpath): Appropriately cast return value of
	malloc().
	* make-relative-prefix.c (save_string): Likewise.
	* make-temp-file.c (try_dir): Rename from "try".  Adjust use in
	the file.
	(choose_tmpdir): Use XNEWVEC.
	* mkstemps.c (mkstemps): Rename parameter "template" to "pattern".
	* pex-common.c (pex_init_common): Use XNEW.
	(pex_add_remove): Use XRESIZEVEC.
	(pex_run): Likewise.
	(pex_get_status_and_time): Likewise.
	* pex-djgpp.c (pex_djgpp_exec_child): Likewise.
	* pex-msdos.c (pex_init): Use XNEW.
	(pex_msdos_exec_child): Likewise.
	(pex_msdos_exec_child): Use XRESIZEVEC.
	* pex-unix.c (pex_wait): Use XNEW.
	* pex-win32.c (fix_argv): Use XNEWVEC.
	* pexecute.c (pwait): Likewise.
	* setenv.c (setenv): Properly cast return value of malloc().
	* sigsetmask.c (sigsetmask): Rename local variables "old" and
	"new" to "old_sig" and "new_sig".
	* sort.c (main): Use XNEWVEC.
	* spaces.c (spaces): Cast return value of malloc().
	* strndup.c (strndup): Likewise.
	* ternary.c (ternary_insert): Use XNEW.
	* xmalloc.c (malloc, realloc, calloc, sbrk): Surround declaration
	with an extern "C" block if __cplusplus.
	* xstrdup.c (xstrdup): Cast return value of memcpy().
	* xstrerror.c (strerror): Enclose declaration in an extern "C"
	block if __cplusplus.
	* xstrndup.c (xstrndup): Use XNEW. Cast return value of memcpy().

From-SVN: r100115
2005-05-24 20:48:25 +00:00
Nick Clifton ee58dffdbc Update the address and phone number of the FSF organization.
From-SVN: r99519
2005-05-10 15:33:18 +00:00
Gabriel Dos Reis 9486db4fb6 demangle.h: Remove uses of PARAMS.
include/
2005-03-26  Gabriel Dos Reis  <gdr@integrable-solutions.net>

        * demangle.h: Remove uses of PARAMS.

        * libiberty.h (ANSI_PROTOTYPES): Remove guard since
        ANSI_PROTOTYPES is always assumed.
        Remove uses of PARAMS throughout.

libiberty/
2005-03-26  Gabriel Dos Reis  <gdr@integrable-solutions.net>

        Convert libiberty to use ISO C prototype style 2/n.
        * cp-demangle.h: Remove uses of PARAMS.
        * cp-demangle.c: Likewise.
        (d_dump, cplus_demangle_fill_name,
        cplus_demangle_fill_extended_operator,
        cplus_demangle_fill_ctor,
        cplus_demangle_fill_dtor, d_make_empty, d_make_comp,
        d_make_name,
        d_make_builtin_type, d_make_operator,
        d_make_extended_operator,
        d_make_ctor, d_make_dtor, d_make_template_param, d_make_sub,
        cplus_demangle_mangled_name, has_return_type,
        is_ctor_dtor_or_conversion, d_encoding, d_name, d_nested_name,
        d_prefix, d_unqualified_name, d_source_name, d_number,
        d_identifier, d_operator_name, d_special_name, d_call_offset,
        d_ctor_dtor_name, cplus_demangle_type, d_cv_qualifiers,
        d_function_type, d_bare_function_type, d_class_enum_type,
        d_array_type, d_pointer_to_member_type, d_template_param,
        d_template_args, d_template_arg, d_expression, d_expr_primary,
        d_local_name, d_discriminator, d_add_substitution,
        d_substitution, d_print_resize, d_print_append_char,
        d_print_append_buffer, d_print_error, cplus_demangle_print,
        d_print_comp, d_print_java_identifier, d_print_mod_list,
        d_print_mod, d_print_function_type, d_print_array_type,
        d_print_expr_op, d_print_cast, cplus_demangle_init_info,
        d_demangle, __cxa_demangle, cplus_demangle_v3,
        java_demangle_v3,
        is_ctor_or_dtor, is_gnu_v3_mangled_ctor,
        is_gnu_v3_mangled_dtor,
        print_usage, main):

2005-03-26  Gabriel Dos Reis  <gdr@integrable-solutions.net>

        Convert libiberty to ISO C prototype style 1/n.
        * _doprnt.c: Remove conditional #include <varargs.h> on
        ANSI_PROTOTYPES as the latter is always assumed.
        (_doprnt, checkit, main): Use ISO C prototype.
        * alloca.c (find_stack_direction, C_alloca): Use ISO C
        prototype.
        * argv.c: Remove conditional #includes on ANSI_PROTOTYPES.
        (dupargv, freeargv, buildargv, main): Use ISO C prototype.
        * atexit.c (atexit): Likewise
        * asprintf.c: Remove conditional include on ANSI_PROTOTYPES.
        (asprintf): Use ISO C prototype.
        * basename.c (basename): Likewise
        * bcmp.c (bcmp): Likewise.
        * bcopy.c (bcopy): Likewise.
        * bzero.c (bzero): Likewise.
        * bsearch.c (bsearch): Likewise.  Improve const-correctness.
        * choose-temp.c (choose_temp_base): Likewise.
        * calloc.c: Remove conditional #include on ANSI_PROTOTYPES.
        (calloc): Use ISO C prototype.
        * clock.c (clock): Likewise.
        * concat.c: Remove conditional #include on ANSI_PROTOTYPES.
        (vconcat_length, vconcat_copy, concat_length, concat_copy,
        concat_copy2, concat, reconcat, main): Use ISO C prototype.
        * copysign.c (copysign): Likewise.

From-SVN: r97085
2005-03-26 19:24:33 +00:00
DJ Delorie 5bed56d982 argv.c, [...]: Improve manual formatting.
* argv.c, asprintf.c, choose-temp.c, concat.c, cplus-dem.c,
ffs.c, fnmatch.txh, getruntime.c, make-temp-file.c,
mkstemps.c, pexecute.c, random.c, strsitnal.c, vasprintf.c:
Improve manual formatting.
* functions.texi: Regenerate.

From-SVN: r46323
2001-10-17 17:15:41 -04:00
DJ Delorie aac04c15d7 Makefile.in (TEXIFILES): Add fnmatch.txh.
* Makefile.in (TEXIFILES): Add fnmatch.txh.
(maint-undoc): New.
maint-tool: Add "undoc" tool.
* alloca.c, argv.c, asprintf.c, choose-temp.c, concat.c,
fdmatch.c, ffs.c, getruntime.c, insque.c, lbasename.c,
make-temp-file.c, mkstemps.c, pexecute.c, random.c, spaces.c,
strerror.s, strsignal.c, strtol.c, vasprintf.c: Add or update
documentation.
* fnmatch.txh: New.
* functions.texi: Regenerate.

From-SVN: r46274
2001-10-15 22:50:13 -04:00
Zack Weinberg 33437dc76d choose-temp.c: Split off make_temp_file...
* choose-temp.c: Split off make_temp_file, and the code
        duplicated between it and choose_temp_base, into...
        * make-temp-file.c: ... here; new file.

        * Makefile.in (CFILES): Add make-temp-file.c.
        (REQUIRED_OFILES): Add make-temp-file.o.

From-SVN: r40683
2001-03-21 07:29:37 +00:00
Kaveh R. Ghazi 69197e7e5e configure.in (ac_libiberty_warn_cflags): Add -pedantic.
libiberty:
	* configure.in (ac_libiberty_warn_cflags): Add -pedantic.

	* choose-temp.c (try, choose_temp_base, make_temp_file): Constify.

	* cp-demangle.c (demangle_char): Change parameter from char to int.
	(demangle_expression, demangle_expr_primary): Remove extra
	semi-colon in prototype.

	* dyn-string.c (dyn_string_append_char): Change parameter from
	char to int.

	* memcmp.c (memcmp): Constify.

	* mkstemps.c (gcc_uint64_t): Mark GNUC `long long' case with
	__extension__.

	* partition.c (elem_compare): Prototype.  Don't cast away
	const-ness.

	* setenv.c (setenv): Use braces to avoid ambiguous `else'.

include:
	* demangle.h (demangling_styles): Remove trailing comma in enum.

	* dyn-string.h (dyn_string_append_char): Change parameter from
	char to int.

From-SVN: r34447
2000-06-07 21:13:14 +00:00
Kaveh R. Ghazi 5a657fc371 libiberty.h (make_temp_file): Add a prototype.
include:

        * libiberty.h (make_temp_file):  Add a prototype.

libiberty:

        * choose-temp.c: Remove obsolete comment about gcc.
        (make_temp_file): Constify a char*.

gcc:

        * collect2.c (make_temp_file): Don't prototype.

        * gcc.c (make_temp_file): Likewise.

        * mips.c (mips_make_temp_file): Renamed from `make_temp_file'.

From-SVN: r29662
1999-09-25 13:11:17 +00:00
Richard Henderson a81c752ad3 argv.c: Include stdlib.h and string.h instead of prototyping directly.
* argv.c: Include stdlib.h and string.h instead of
        prototyping directly.
        * choose-temp.c: Conditionally include string.h.

From-SVN: r28099
1999-07-14 10:29:38 -07:00
Mumit Khan 7a1528bc63 * choose-temp.c (DIR_SEPARATOR): Use '\\' only for native windows32.
From-SVN: r26619
1999-04-24 18:23:06 -06:00
Kaveh R. Ghazi 087aa39894 Warning fixes:
* argv.c (buildargv): Cast the result of alloca in assignment.
        * choose-temp.c: Include stdlib.h.
        * cplus-dem.c (demangle_arm_pt): Remove unused prototype.
        (snarf_numeric_literal): Constify first parameter.
        (code_for_qualifier): Avoid a gcc extension, make the parameter an
        int, not a char.
        (demangle_qualifier): Likewise.
        (demangle_signature): Cast the argument of a ctype function to
        unsigned char.
        (arm_pt): Add parens around assignment used as truth value.
        (demangle_arm_hp_template): Constify variable `args'.
        (do_hpacc_template_const_value): Cast the argument of a ctype
        function to unsigned char.
        (do_hpacc_template_literal): Remove unused variable `i'.
        (snarf_numeric_literal): Constify parameter `args'.
        Cast the argument of a ctype function to unsigned char.
        * floatformat.c (floatformat_to_double): Add explicit braces to
        avoid ambiguous `else'.
        * fnmatch.c (fnmatch): Change type of variables `c', `c1',
        `cstart' and `cend' to unsigned char.  Cast the argument of macro
        `FOLD', which uses ctype functions, to unsigned char.
        * objalloc.c (free): Add prototype.

From-SVN: r24392
1998-12-22 06:57:17 +00:00
Kaveh R. Ghazi 11a0bb74cd choose-temp.c: Don't check IN_GCC anymore.
* choose-temp.c: Don't check IN_GCC anymore.
        * floatformat.c (floatformat_from_double): Use `const', not `CONST'.
        * memchr.c (memchr): Likewise.
        * memcpy.c (memcpy): Likewise.
        * memmove.c (memmove): Likewise.
        * mkstemp.c: Don't check IN_GCC anymore.
        * pexecute.c: Likewise.
        * splay-tree.c: Likewise.
        * strchr.c (strchr): Use `const', not `CONST'.
        * strrchr.c (strrchr): Likewise.
        * strtol.c (strtol): Likewise.
        * strtoul.c (strtoul): Likewise.

From-SVN: r24307
1998-12-14 07:01:03 +00:00
Kaveh R. Ghazi 9b1a92d882 choose-temp.c: Always include libiberty.h.
* choose-temp.c: Always include libiberty.h.  Avoid redundancies.
        * cplus-dem.c: Likewise.  Conform to libiberty.h.
        * pexecute.c: Likewise.
        * splay-tree.c: Likewise.

From-SVN: r23935
1998-11-27 10:28:57 +00:00
Kaveh R. Ghazi 2931b6d47f choose-temp.c: Don't include gansidecl.h.
* choose-temp.c: Don't include gansidecl.h.
        * mkstemp.c: Likewise.
        * pexecute.c: Likewise.

From-SVN: r23560
1998-11-07 13:03:59 +00:00
Kaveh R. Ghazi 91e0f659c9 Warning fixes:
* choose-temp.c: Prototype mkstemps() when IN_GCC.
        * cplus-dem.c (consume_count): Cast argument of ctype macro to
        `unsigned char'.
        (cplus_demangle_opname): Cast the result of `strlen' to (int) when
        comparing against one.
        (cplus_mangle_opname): Likewise.
        (demangle_integral_value): Cast argument of ctype macro to
        `unsigned char'.
        (demangle_template_value_parm): Likewise.
        (demangle_template): Initialize variable `bindex'.  Cast the
        result of `strlen' to (int) when comparing against one.  Remove
        unused variable `start_of_value_parm'.
        (demangle_class_name): Cast the result of `strlen' to (int) when
        comparing against one.
        (demangle_prefix): Cast argument of ctype macro to `unsigned char'.
        (gnu_special): Likewise.  Cast the result of `strlen' to (int)
        when comparing against one.
        (demangle_qualified): Cast argument of ctype macro to `unsigned char'.
        (get_count): Likewise.
        (do_type): Likewise.  Cast the result of `strlen' to (int) when
        comparing against one.
        (demangle_fund_type): Cast argument of ctype macro to `unsigned char'.
        (demangle_function_name): Cast the result of `strlen' to (int)
        when comparing against one.
        * mkstemp.c (mkstemps): Cast variable `len' to (int) when
        comparing against one.

From-SVN: r23113
1998-10-15 15:55:04 +00:00
Jeffrey A Law 16ba4214ee pexecute.c: Updates from gcc.
* pexecute.c: Updates from gcc.  Copy in gcc has been removed.  This
        is the canonical copy.  Define ISSPACE if !IN_GCC.
        * alloca.c, vfprintf.c, choose-temp.c, mkstemp.c: Similarly.
        * Makefile.in: Build mkstemp.o

From-SVN: r22252
1998-09-05 05:09:09 -06:00
Kaveh R. Ghazi 4cb1caaf7b Patched in the gcc directory:
* Makefile.in (choose-temp.o): Depend on system.h.
Patched in both the libiberty and gcc directories:
        * choose-temp.c: Include system.h when IN_GCC.

From-SVN: r18952
1998-04-02 11:07:45 +00:00
Ian Lance Taylor b9fb3c420b choose-temp.c: Fix handling of sys/file.h to work in libiberty.
Mon Feb 23 14:33:15 1998  Ian Lance Taylor  <ian@cygnus.com>
        * choose-temp.c: Fix handling of sys/file.h to work in libiberty.

From-SVN: r18240
1998-02-25 16:09:55 -07:00
Jeffrey A Law 84f79fea91 * choose-temp.c: Sync with gcc.
From-SVN: r17394
1998-01-17 14:23:29 -07:00
Jason Merrill 6599da043e Initial revision
From-SVN: r14877
1997-08-21 18:57:35 -04:00