substitutions; the semicolon terminators are enough for ld anyway.
* elf/dl-deps.c (_dl_map_object_deps): Use alloca instead of
dynamically sized auto array in function already using alloca.
* locale/programs/ld-ctype.c (ctype_output): Likewise.
* locale/programs/ld-time.c (time_output): Likewise.
* elf/dl-misc.c (_dl_debug_vdprintf): Use macro instead of const for
IOV array size.
* locale/programs/charmap.c (charmap_read): Avoid alloca (or strdupa)
when also using dynamically-sized auto array.
* locale/programs/locfile.c (locfile_read): Likewise.
* locale/programs/repertoire.c (repertoire_read): Likewise.
* nis/nis_print_group_entry.c (nis_print_group_entry): Likewise.
* locale/programs/locarchive.c (enlarge_archive): Likewise.
* posix/annexc.c (check_header): Likewise.
* iconv/gconv_int.h (norm_add_slashes): Don't handle null SUFFIX.
strlen ("") gets optimized away just as well.
* intl/loadmsgcat.c (_nl_init_domain_conv): Update caller.
* wcsmbs/wcsmbsload.c (__wcsmbs_load_conv): Likewise.
2004-03-24 Roland McGrath <roland@redhat.com>
+ * Makerules ($(common-objpfx)shlib.lds): Don't use \n in rhs of sed
+ substitutions; the semicolon terminators are enough for ld anyway.
+
+ * elf/dl-deps.c (_dl_map_object_deps): Use alloca instead of
+ dynamically sized auto array in function already using alloca.
+ * locale/programs/ld-ctype.c (ctype_output): Likewise.
+ * locale/programs/ld-time.c (time_output): Likewise.
+ * elf/dl-misc.c (_dl_debug_vdprintf): Use macro instead of const for
+ IOV array size.
+ * locale/programs/charmap.c (charmap_read): Avoid alloca (or strdupa)
+ when also using dynamically-sized auto array.
+ * locale/programs/locfile.c (locfile_read): Likewise.
+ * locale/programs/repertoire.c (repertoire_read): Likewise.
+ * nis/nis_print_group_entry.c (nis_print_group_entry): Likewise.
+ * locale/programs/locarchive.c (enlarge_archive): Likewise.
+ * posix/annexc.c (check_header): Likewise.
+
+ * iconv/gconv_int.h (norm_add_slashes): Don't handle null SUFFIX.
+ strlen ("") gets optimized away just as well.
+ * intl/loadmsgcat.c (_nl_init_domain_conv): Update caller.
+ * wcsmbs/wcsmbsload.c (__wcsmbs_load_conv): Likewise.
+
* Makefile ($(objpfx)c++-types-check.out): Reduce duplication in
defining this target. Also elide -Wstrict-prototypes from CFLAGS.
PROVIDE(__start___libc_freeres_ptrs = .); \
*(__libc_freeres_ptrs) \
PROVIDE(__stop___libc_freeres_ptrs = .);/'\
- -e 's/^.*\*(\.jcr).*$$/&\n\
- PROVIDE(__start___libc_subfreeres = .);\n\
- __libc_subfreeres : { *(__libc_subfreeres) }\n\
- PROVIDE(__stop___libc_subfreeres = .);\n\
- PROVIDE(__start___libc_atexit = .);\n\
- __libc_atexit : { *(__libc_atexit) }\n\
- PROVIDE(__stop___libc_atexit = .);\n\
- PROVIDE(__start___libc_thread_subfreeres = .);\n\
- __libc_thread_subfreeres : { *(__libc_thread_subfreeres) }\n\
+ -e 's/^.*\*(\.jcr).*$$/& \
+ PROVIDE(__start___libc_subfreeres = .);\
+ __libc_subfreeres : { *(__libc_subfreeres) }\
+ PROVIDE(__stop___libc_subfreeres = .);\
+ PROVIDE(__start___libc_atexit = .);\
+ __libc_atexit : { *(__libc_atexit) }\
+ PROVIDE(__stop___libc_atexit = .);\
+ PROVIDE(__start___libc_thread_subfreeres = .);\
+ __libc_thread_subfreeres : { *(__libc_thread_subfreeres) }\
PROVIDE(__stop___libc_thread_subfreeres = .);/'
mv -f $@T $@
common-generated += shlib.lds
struct link_map **preloads, unsigned int npreloads,
int trace_mode, int open_mode)
{
- struct list known[1 + npreloads + 1];
+ struct list *known = __alloca (sizeof *known * (1 + npreloads + 1));
struct list *runp, *tail;
unsigned int nlist, i;
/* Object name. */
static void
_dl_debug_vdprintf (int fd, int tag_p, const char *fmt, va_list arg)
{
- const int niovmax = 64;
- struct iovec iov[niovmax];
+# define NIOVMAX 64
+ struct iovec iov[NIOVMAX];
int niov = 0;
pid_t pid = 0;
char pidbuf[12];
}
/* Append to the output. */
- assert (niov < niovmax);
+ assert (niov < NIOVMAX);
iov[niov].iov_len = 12;
iov[niov++].iov_base = pidbuf;
++fmt;
/* Append constant string. */
- assert (niov < niovmax);
+ assert (niov < NIOVMAX);
if ((iov[niov].iov_len = fmt - startp) != 0)
iov[niov++].iov_base = (char *) startp;
char *result; \
char *tmp; \
size_t cnt = 0; \
- size_t suffix_len = (suffix) == NULL ? 0 : strlen (suffix); \
+ const size_t suffix_len = strlen (suffix); \
\
while (*cp != '\0') \
if (*cp++ == '/') \
if (cnt < 1) \
{ \
*tmp++ = '/'; \
- if (suffix != NULL) \
+ if (suffix_len != 0) \
tmp = __mempcpy (tmp, suffix, suffix_len); \
} \
} \
# ifdef _LIBC
/* We always want to use transliteration. */
outcharset = norm_add_slashes (outcharset, "TRANSLIT");
- charset = norm_add_slashes (charset, NULL);
+ charset = norm_add_slashes (charset, "");
if (__gconv_open (outcharset, charset, &domain->conv,
GCONV_AVOID_NOCONV)
!= __GCONV_OK)
-/* Copyright (C) 1996, 1998-2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1998-2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
char *i18npath = getenv ("I18NPATH");
if (i18npath != NULL && *i18npath != '\0')
{
- char path[strlen (i18npath) + sizeof ("/charmaps")];
+ const size_t pathlen = strlen (i18npath);
+ char i18npathbuf[pathlen + 1];
+ char path[pathlen + sizeof ("/charmaps")];
char *next;
- i18npath = strdupa (i18npath);
+ i18npath = memcpy (i18npathbuf, i18npath, pathlen + 1);
while (cmfile == NULL
&& (next = strsep (&i18npath, ":")) != NULL)
-/* Copyright (C) 1995-2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.org>, 1995.
struct locale_ctype_t *ctype = locale->categories[LC_CTYPE].ctype;
const size_t nelems = (_NL_ITEM_INDEX (_NL_CTYPE_EXTRA_MAP_1)
+ ctype->nr_charclass + ctype->map_collection_nr);
- struct iovec iov[2 + nelems + 2 * ctype->nr_charclass
- + ctype->map_collection_nr + 4];
+ struct iovec *iov = alloca (sizeof *iov
+ * (2 + nelems + 2 * ctype->nr_charclass
+ + ctype->map_collection_nr + 4));
struct locale_file data;
- uint32_t idx[nelems + 1];
+ uint32_t *idx = alloca (sizeof *idx * (nelems + 1));
uint32_t default_missing_len;
size_t elem, cnt, offset, total;
char *cp;
-/* Copyright (C) 1995-2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.org>, 1995.
const char *output_path)
{
struct locale_time_t *time = locale->categories[LC_TIME].time;
- struct iovec iov[2 + _NL_ITEM_INDEX (_NL_NUM_LC_TIME)
- + time->num_era - 1
- + 2 * 99
- + 2 + time->num_era * 10 - 1];
+ struct iovec *iov = alloca (sizeof *iov
+ * (2 + _NL_ITEM_INDEX (_NL_NUM_LC_TIME)
+ + time->num_era - 1
+ + 2 * 99
+ + 2 + time->num_era * 10 - 1));
struct locale_file data;
uint32_t idx[_NL_ITEM_INDEX (_NL_NUM_LC_TIME)];
size_t cnt, last_idx, num, n;
size_t prefix_len = output_prefix ? strlen (output_prefix) : 0;
char archivefname[prefix_len + sizeof (ARCHIVE_NAME)];
char fname[prefix_len + sizeof (ARCHIVE_NAME) + sizeof (".XXXXXX") - 1];
- struct oldlocrecent *oldlocrecarray;
if (output_prefix)
memcpy (archivefname, output_prefix, prefix_len);
+ head->locrectab_offset);
/* Sort the old locrec table in order of data position. */
- oldlocrecarray = (struct oldlocrecent *)
- alloca (head->namehash_size
- * sizeof (struct oldlocrecent));
+ struct oldlocrecent oldlocrecarray[head->namehash_size];
for (cnt = 0, loccnt = 0; cnt < head->namehash_size; ++cnt)
if (oldnamehashtab[cnt].locrec_offset != 0)
{
-/* Copyright (C) 1996-2001, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
char *i18npath = getenv ("I18NPATH");
if (i18npath != NULL && *i18npath != '\0')
{
- char path[strlen (filename) + 1 + strlen (i18npath)
- + sizeof ("/locales/") - 1];
+ const size_t pathlen = strlen (i18npath);
+ char i18npathbuf[pathlen + 1];
+ char path[strlen (filename) + 1 + pathlen
+ + sizeof ("/locales/") - 1];
char *next;
- i18npath = strdupa (i18npath);
-
+ i18npath = memcpy (i18npathbuf, i18npath, pathlen + 1);
while (ldfile == NULL
&& (next = strsep (&i18npath, ":")) != NULL)
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1998,1999,2000,2001,2002,2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
char *i18npath = getenv ("I18NPATH");
if (i18npath != NULL && *i18npath != '\0')
{
- char path[strlen (filename) + 1 + strlen (i18npath)
+ const size_t pathlen = strlen (i18npath);
+ char i18npathbuf[pathlen + 1];
+ char path[strlen (filename) + 1 + pathlen
+ sizeof ("/repertoiremaps/") - 1];
char *next;
- i18npath = strdupa (i18npath);
-
+ i18npath = memcpy (i18npathbuf, i18npath, pathlen + 1);
while (repfile == NULL
&& (next = strsep (&i18npath, ":")) != NULL)
-/* Copyright (c) 1997, 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (c) 1997, 1998, 2000, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
char buf[grouplen + 50];
char leafbuf[grouplen + 3];
char domainbuf[grouplen + 3];
- unsigned long mem_exp_cnt = 0, mem_imp_cnt = 0, mem_rec_cnt = 0;
- unsigned long nomem_exp_cnt = 0, nomem_imp_cnt = 0, nomem_rec_cnt = 0;
- char **mem_exp, **mem_imp, **mem_rec;
- char **nomem_exp, **nomem_imp, **nomem_rec;
nis_result *res;
char *cp, *cp2;
u_int i;
(__type_of (NIS_RES_OBJECT (res)) != NIS_GROUP_OBJ))
return;
- mem_exp = alloca (sizeof (char *) * NIS_RES_NUMOBJ (res));
- mem_imp = alloca (sizeof (char *) * NIS_RES_NUMOBJ (res));
- mem_rec = alloca (sizeof (char *) * NIS_RES_NUMOBJ (res));
- nomem_exp = alloca (sizeof (char *) * NIS_RES_NUMOBJ (res));
- nomem_imp = alloca (sizeof (char *) * NIS_RES_NUMOBJ (res));
- nomem_rec = alloca (sizeof (char *) * NIS_RES_NUMOBJ (res));
+ char *mem_exp[NIS_RES_NUMOBJ (res)];
+ char *mem_imp[NIS_RES_NUMOBJ (res)];
+ char *mem_rec[NIS_RES_NUMOBJ (res)];
+ char *nomem_exp[NIS_RES_NUMOBJ (res)];
+ char *nomem_imp[NIS_RES_NUMOBJ (res)];
+ char *nomem_rec[NIS_RES_NUMOBJ (res)];
+ unsigned long mem_exp_cnt = 0, mem_imp_cnt = 0, mem_rec_cnt = 0;
+ unsigned long nomem_exp_cnt = 0, nomem_imp_cnt = 0, nomem_rec_cnt = 0;
for (i = 0;
i < NIS_RES_OBJECT (res)->GR_data.gr_members.gr_members_len; ++i)
+2004-03-24 Roland McGrath <roland@redhat.com>
+
+ * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
+ constraint instead of "0".
+
2004-03-24 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002,2003,2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
"jmp 2b\n\t"
".previous"
: "=m" (*lock)
- : "0" (*lock));
+ : "m" (*lock));
return 0;
}
+2004-03-24 Roland McGrath <roland@redhat.com>
+
+ * fetch-value.c (_td_locate_field): Cast DB_DESC_OFFSET to int32_t.
+ * thread_dbP.h (DB_DESC_OFFSET): Remove cast from definition.
+
2004-03-13 Jakub Jelinek <jakub@redhat.com>
* db_info.c: Don't use TLS_TP_OFFSET in the #if, but
/* Helper routines for libthread_db.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
if (elemsize & 0xff000000U)
elemsize = bswap_32 (elemsize);
- *address += DB_DESC_OFFSET (desc) + (elemsize / 8 * (idx - (psaddr_t) 0));
+ *address += (int32_t) DB_DESC_OFFSET (desc);
+ *address += (elemsize / 8 * (idx - (psaddr_t) 0));
return TD_OK;
}
/* Private header for thread debug library
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
#define DB_DESC_SIZE(desc) ((desc)[0])
#define DB_DESC_NELEM(desc) ((desc)[1])
-#define DB_DESC_OFFSET(desc) ((int32_t) (desc)[2])
+#define DB_DESC_OFFSET(desc) ((desc)[2])
#define DB_SIZEOF_DESC (3 * sizeof (uint32_t))
#define DB_DEFINE_DESC(name, size, nelem, offset) \
const uint32_t name[3] = { (size), (nelem), (offset) }
-/* Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2002, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
static int
check_header (const struct header *header, const char **except)
{
- char line[BUFSIZ], *command;
+ char line[BUFSIZ], command[sizeof fmt + strlen (header->name)
+ + 2 * strlen (CC)
+ + strlen (INC) + strlen (macrofile)];
FILE *input;
int result = 0;
int found[header->nsyms];
int i;
memset (found, '\0', header->nsyms * sizeof (int));
- command = alloca (sizeof fmt + strlen (header->name) + 2 * strlen (CC)
- + strlen (INC) + strlen (macrofile));
-
-
- if (command == NULL)
- {
- puts ("No more memory.");
- exit (1);
- }
printf ("=== %s ===\n", header->name);
sprintf (command, fmt, header->name, CC, INC, CC, macrofile);
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1998,1999,2000,2001,2002,2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
/* Normalize the name and add the slashes necessary for a
complete lookup. */
complete_name = norm_add_slashes (charset_name,
- use_translit ? "TRANSLIT" : NULL);
+ use_translit ? "TRANSLIT" : "");
/* It is not necessary to use transliteration in this direction
since the internal character set is supposed to be able to