From 17427edd1fc510ae6eb7903cc8664e15500490d6 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 20 Nov 2000 09:16:41 +0000 Subject: [PATCH] Update. 2000-11-20 Ulrich Drepper * csu/gmon-start.c: Always have prototype for __gmon_start. * csu/version.c: Add prototypes for __libc_print_version and __libc_main. * iconv/gconv.c: Include gconv_int.h and gconv.h. * iconv/gconv.h (struct __gconv_step): Remove const from __from_name and __to_name. * iconv/gconv_builtin.h: Add ASCII module definitions. * iconv/gconv_conf.c (__gconv_path_elem): Remove const. (add_module): Add cast to avoid warning. Rework construction of strings for new module. * iconv/gconv_db.c (__gconv_alias_compare): Make s1 and s2 const. (derivation_compare): Likewise. * iconv/gconv_dl.c (do_release_shlib): Remove const from nodep. (__gconv_release_shlib): Cast do_release_shlib as parameter for twalk. * iconv/gconv_int.h (__gconv_path_elem): Remove const. (struct gconv_alias): Remove const from fromname and toname. * iconv/gconv_simple.c: Include gconv_builtin.h to get prototypes for loop functions. (internal_ucs4_loop): Use correct const-ness. (ucs4_internal_loop): Likewise. (internal_ucs4le_loop): Likewise. (ucs4le_internal_loop_single): Likewise. * iconv/gconv_trans.c (__gconv_transliterate): Make from_idx, from_tbl, to_idx, to_tbl, winbuf, winbufend const. Change casts in assignments appropriately. (struct known_trans): Remove const from fname. (trans_compare): Make s1 and s2 const. * iconv/loop.c (LOOPFC): Make outend parameter const. Add cast to avoid warning. * iconv/skeleton.c: Remove cast in calls of loop functions. * iconvdata/gconv-modules: Remove US-ASCII definitions. * iconvdata/iso646.c: Remove US_ASCII support. * include/set-hooks.h (DEFINE_HOOK): Also generate prototype. * include/unistd.h: Add __libc_check_standard_fds prototype. * string/bits/string2.h (__mempcpy_args): Add const to casts. * sysdeps/generic/initfini.c: Add prototypes for dummy, _init, and _fini. * sysdeps/generic/libc-start.c: Add prototype for __libc_start_main. * sysdeps/i386/i486/bits/string.h (strcmp): Add const to casts. * sysdeps/unix/sysv/linux/dl-osinfo.h (dl_fatal): Add cast to avoid warning. * sysdeps/unix/sysv/linux/init-first.c: Add prototypes for __libc_init_first and _dl_start. * sysdeps/unix/sysv/linux/mips/clone.S: Fix comments. --- ChangeLog | 48 +++++++++++++++++++++++++++- csu/version.c | 2 ++ iconv/gconv.c | 2 +- iconv/gconv.h | 4 +-- iconv/gconv_builtin.h | 22 +++++++++++++ iconv/gconv_conf.c | 23 ++++++------- iconv/gconv_db.c | 8 ++--- iconv/gconv_dl.c | 4 +-- iconv/gconv_int.h | 6 ++-- iconv/gconv_simple.c | 35 ++++++++++++-------- iconv/gconv_trans.c | 42 +++++++++++++----------- iconv/loop.c | 4 +-- iconv/skeleton.c | 11 +++---- iconvdata/gconv-modules | 16 ---------- iconvdata/iso646.c | 2 -- include/set-hooks.h | 3 +- include/unistd.h | 5 +++ string/bits/string2.h | 4 +-- sysdeps/generic/initfini.c | 5 ++- sysdeps/generic/libc-start.c | 11 +++++-- sysdeps/i386/i486/bits/string.h | 18 ++++++----- sysdeps/unix/sysv/linux/dl-osinfo.h | 2 +- sysdeps/unix/sysv/linux/init-first.c | 6 ++++ 23 files changed, 183 insertions(+), 100 deletions(-) diff --git a/ChangeLog b/ChangeLog index e780eda9b4..5389040f25 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,52 @@ +2000-11-20 Ulrich Drepper + + * csu/gmon-start.c: Always have prototype for __gmon_start. + * csu/version.c: Add prototypes for __libc_print_version and + __libc_main. + * iconv/gconv.c: Include gconv_int.h and gconv.h. + * iconv/gconv.h (struct __gconv_step): Remove const from __from_name + and __to_name. + * iconv/gconv_builtin.h: Add ASCII module definitions. + * iconv/gconv_conf.c (__gconv_path_elem): Remove const. + (add_module): Add cast to avoid warning. Rework construction of + strings for new module. + * iconv/gconv_db.c (__gconv_alias_compare): Make s1 and s2 const. + (derivation_compare): Likewise. + * iconv/gconv_dl.c (do_release_shlib): Remove const from nodep. + (__gconv_release_shlib): Cast do_release_shlib as parameter for twalk. + * iconv/gconv_int.h (__gconv_path_elem): Remove const. + (struct gconv_alias): Remove const from fromname and toname. + * iconv/gconv_simple.c: Include gconv_builtin.h to get prototypes + for loop functions. + (internal_ucs4_loop): Use correct const-ness. + (ucs4_internal_loop): Likewise. + (internal_ucs4le_loop): Likewise. + (ucs4le_internal_loop_single): Likewise. + * iconv/gconv_trans.c (__gconv_transliterate): Make from_idx, from_tbl, + to_idx, to_tbl, winbuf, winbufend const. Change casts in + assignments appropriately. + (struct known_trans): Remove const from fname. + (trans_compare): Make s1 and s2 const. + * iconv/loop.c (LOOPFC): Make outend parameter const. Add cast to + avoid warning. + * iconv/skeleton.c: Remove cast in calls of loop functions. + * iconvdata/gconv-modules: Remove US-ASCII definitions. + * iconvdata/iso646.c: Remove US_ASCII support. + * include/set-hooks.h (DEFINE_HOOK): Also generate prototype. + * include/unistd.h: Add __libc_check_standard_fds prototype. + * string/bits/string2.h (__mempcpy_args): Add const to casts. + * sysdeps/generic/initfini.c: Add prototypes for dummy, _init, and + _fini. + * sysdeps/generic/libc-start.c: Add prototype for __libc_start_main. + * sysdeps/i386/i486/bits/string.h (strcmp): Add const to casts. + * sysdeps/unix/sysv/linux/dl-osinfo.h (dl_fatal): Add cast to avoid + warning. + * sysdeps/unix/sysv/linux/init-first.c: Add prototypes for + __libc_init_first and _dl_start. + 2000-11-20 Hiroyuki Machida - * sysdeps/unix/sysv/linux/mips/clone.S: Fix comments. + * sysdeps/unix/sysv/linux/mips/clone.S: Fix comments. * sysdeps/unix/sysv/linux/mips/kernel_stat.h (kernel_stat): Expand time_t to 'long int' not, 'unsigned int'. Use 'long int' for diff --git a/csu/version.c b/csu/version.c index 05c53b8474..dc5e65a016 100644 --- a/csu/version.c +++ b/csu/version.c @@ -34,6 +34,7 @@ Compiled by GNU CC version "__VERSION__".\n" #include +extern void __libc_print_version (void); void __libc_print_version (void) { @@ -58,6 +59,7 @@ weak_alias (__gnu_get_libc_version, gnu_get_libc_version) /* This function is the entry point for the shared object. Running the library as a program will get here. */ +extern void __libc_main (void) __attribute__ ((noreturn)); void __libc_main (void) { diff --git a/iconv/gconv.c b/iconv/gconv.c index 0b7b917b6a..88d76056c8 100644 --- a/iconv/gconv.c +++ b/iconv/gconv.c @@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA. */ #include -#include +#include #include #include #include diff --git a/iconv/gconv.h b/iconv/gconv.h index c2fdf83a25..03574d859e 100644 --- a/iconv/gconv.h +++ b/iconv/gconv.h @@ -115,8 +115,8 @@ struct __gconv_step int __counter; - __const char *__from_name; - __const char *__to_name; + char *__from_name; + char *__to_name; __gconv_fct __fct; __gconv_init_fct __init_fct; diff --git a/iconv/gconv_builtin.h b/iconv/gconv_builtin.h index e6c7b5fac3..246bb95ae7 100644 --- a/iconv/gconv_builtin.h +++ b/iconv/gconv_builtin.h @@ -76,6 +76,28 @@ BUILTIN_TRANSFORMATION ("INTERNAL", "ISO-10646/UCS2/", 1, "=INTERNAL->ucs2", 4, 4, 2, 2) +BUILTIN_ALIAS ("ANSI_X3.4//", "ANSI_X3.4-1968//") +BUILTIN_ALIAS ("ISO-IR-6//", "ANSI_X3.4-1968//") +BUILTIN_ALIAS ("ANSI_X3.4-1986//", "ANSI_X3.4-1968//") +BUILTIN_ALIAS ("ISO_646.IRV:1991//", "ANSI_X3.4-1968//") +BUILTIN_ALIAS ("ASCII//", "ANSI_X3.4-1968//") +BUILTIN_ALIAS ("ISO646-US//", "ANSI_X3.4-1968//") +BUILTIN_ALIAS ("US-ASCII//", "ANSI_X3.4-1968//") +BUILTIN_ALIAS ("US//", "ANSI_X3.4-1968//") +BUILTIN_ALIAS ("IBM367//", "ANSI_X3.4-1968//") +BUILTIN_ALIAS ("CP367//", "ANSI_X3.4-1968//") +BUILTIN_ALIAS ("CSASCII//", "ANSI_X3.4-1968//") +BUILTIN_ALIAS ("OSF00010020//", "ANSI_X3.4-1968//") + +BUILTIN_TRANSFORMATION ("ANSI_X3.4-1968//", "INTERNAL", 1, "=ascii->INTERNAL", + __gconv_transform_ascii_internal, NULL, NULL, + 4, 4, 1, 1) + +BUILTIN_TRANSFORMATION ("INTERNAL", "ANSI_X3.4-1968//", 1, "=INTERNAL->ascii", + __gconv_transform_internal_ascii, NULL, NULL, + 4, 4, 1, 1) + + #if BYTE_ORDER == BIG_ENDIAN BUILTIN_ALIAS ("UNICODEBIG//", "ISO-10646/UCS2/") BUILTIN_ALIAS ("UCS-2BE//", "ISO-10646/UCS2/") diff --git a/iconv/gconv_conf.c b/iconv/gconv_conf.c index 57c832d6a9..a9b458130a 100644 --- a/iconv/gconv_conf.c +++ b/iconv/gconv_conf.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -38,7 +39,7 @@ static const char default_gconv_path[] = GCONV_PATH; /* The path elements, as determined by the __gconv_get_path function. All path elements end in a slash. */ -const struct path_elem *__gconv_path_elem; +struct path_elem *__gconv_path_elem; /* Maximum length of a single path element in __gconv_path_elem. */ size_t __gconv_max_path_elem_len; @@ -283,7 +284,7 @@ add_module (char *rp, const char *directory, size_t dir_len, void **modules, /* See whether we must add the ending. */ need_ext = 0; - if (wp - module < sizeof (gconv_module_ext) + if (wp - module < (ptrdiff_t) sizeof (gconv_module_ext) || memcmp (wp - sizeof (gconv_module_ext), gconv_module_ext, sizeof (gconv_module_ext)) != 0) /* We must add the module extension. */ @@ -304,23 +305,19 @@ add_module (char *rp, const char *directory, size_t dir_len, void **modules, { char *tmp; - new_module->from_string = memcpy ((char *) new_module - + sizeof (struct gconv_module), - from, to - from); + new_module->from_string = tmp = (char *) (new_module + 1); + tmp = __mempcpy (tmp, from, to - from); - new_module->to_string = memcpy ((char *) new_module->from_string - + (to - from), to, module - to); + new_module->to_string = tmp; + tmp = __mempcpy (tmp, to, module - to); new_module->cost_hi = cost_hi; new_module->cost_lo = modcounter; - new_module->module_name = (char *) new_module->to_string + (module - to); + new_module->module_name = tmp; - if (dir_len == 0) - tmp = (char *) new_module->module_name; - else - tmp = __mempcpy ((char *) new_module->module_name, - directory, dir_len); + if (dir_len != 0) + tmp = __mempcpy (tmp, directory, dir_len); tmp = __mempcpy (tmp, module, wp - module); diff --git a/iconv/gconv_db.c b/iconv/gconv_db.c index dd51670af1..d003981d3e 100644 --- a/iconv/gconv_db.c +++ b/iconv/gconv_db.c @@ -44,8 +44,8 @@ __libc_lock_define_initialized (static, lock) int __gconv_alias_compare (const void *p1, const void *p2) { - struct gconv_alias *s1 = (struct gconv_alias *) p1; - struct gconv_alias *s2 = (struct gconv_alias *) p2; + const struct gconv_alias *s1 = (const struct gconv_alias *) p1; + const struct gconv_alias *s2 = (const struct gconv_alias *) p2; return strcmp (s1->fromname, s2->fromname); } @@ -90,8 +90,8 @@ struct known_derivation static int derivation_compare (const void *p1, const void *p2) { - struct known_derivation *s1 = (struct known_derivation *) p1; - struct known_derivation *s2 = (struct known_derivation *) p2; + const struct known_derivation *s1 = (const struct known_derivation *) p1; + const struct known_derivation *s2 = (const struct known_derivation *) p2; int result; result = strcmp (s1->from, s2->from); diff --git a/iconv/gconv_dl.c b/iconv/gconv_dl.c index 114619ec11..720ae4836b 100644 --- a/iconv/gconv_dl.c +++ b/iconv/gconv_dl.c @@ -149,7 +149,7 @@ __gconv_find_shlib (const char *name) static struct __gconv_loaded_object *release_handle; static void -do_release_shlib (const void *nodep, VISIT value, int level) +do_release_shlib (void *nodep, VISIT value, int level) { struct __gconv_loaded_object *obj = *(struct __gconv_loaded_object **) nodep; @@ -184,7 +184,7 @@ __gconv_release_shlib (struct __gconv_loaded_object *handle) /* Process all entries. Please note that we also visit entries with release counts <= 0. This way we can finally unload them if necessary. */ - __twalk (loaded, do_release_shlib); + __twalk (loaded, (__action_fn_t) do_release_shlib); } diff --git a/iconv/gconv_int.h b/iconv/gconv_int.h index ad2d6e7d4a..0c7a422e2e 100644 --- a/iconv/gconv_int.h +++ b/iconv/gconv_int.h @@ -33,7 +33,7 @@ struct path_elem }; /* Variable with search path for `gconv' implementation. */ -extern const struct path_elem *__gconv_path_elem; +extern struct path_elem *__gconv_path_elem; /* Maximum length of a single path element. */ extern size_t __gconv_max_path_elem_len; @@ -41,8 +41,8 @@ extern size_t __gconv_max_path_elem_len; /* Structure for alias definition. Simply to strings. */ struct gconv_alias { - const char *fromname; - const char *toname; + char *fromname; + char *toname; }; diff --git a/iconv/gconv_simple.c b/iconv/gconv_simple.c index 70c43c8fe8..ab9f46a9b3 100644 --- a/iconv/gconv_simple.c +++ b/iconv/gconv_simple.c @@ -29,6 +29,15 @@ #include #include +#define BUILTIN_ALIAS(s1, s2) /* nothing */ +#define BUILTIN_TRANSFORMATION(From, To, Cost, Name, Fct, Init, End, MinF, \ + MaxF, MinT, MaxT) \ + extern int Fct (struct __gconv_step *, struct __gconv_step_data *, \ + __const unsigned char **, __const unsigned char *, \ + unsigned char **, size_t *, int, int); +#include "gconv_builtin.h" + + #ifndef EILSEQ # define EILSEQ EINVAL #endif @@ -66,7 +75,7 @@ internal_ucs4_loop (struct __gconv_step *step, size_t cnt; for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4) - *((uint32_t *) outptr)++ = bswap_32 (*(uint32_t *) inptr); + *((uint32_t *) outptr)++ = bswap_32 (*(const uint32_t *) inptr); *inptrp = inptr; *outptrp = outptr; @@ -215,9 +224,9 @@ ucs4_internal_loop (struct __gconv_step *step, uint32_t inval; #if __BYTE_ORDER == __LITTLE_ENDIAN - inval = bswap_32 (*(uint32_t *) inptr); + inval = bswap_32 (*(const uint32_t *) inptr); #else - inval = *(uint32_t *) inptr; + inval = *(const uint32_t *) inptr; #endif if (__builtin_expect (inval, 0) > 0x7fffffff) @@ -420,7 +429,7 @@ internal_ucs4le_loop (struct __gconv_step *step, size_t cnt; for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4) - *((uint32_t *) outptr)++ = bswap_32 (*(uint32_t *) inptr); + *((uint32_t *) outptr)++ = bswap_32 (*(const uint32_t *) inptr); *inptrp = inptr; *outptrp = outptr; @@ -566,9 +575,9 @@ ucs4le_internal_loop (struct __gconv_step *step, uint32_t inval; #if __BYTE_ORDER == __BIG_ENDIAN - inval = bswap_32 (*(uint32_t *) inptr); + inval = bswap_32 (*(const uint32_t *) inptr); #else - inval = *(uint32_t *) inptr; + inval = *(const uint32_t *) inptr; #endif if (__builtin_expect (inval, 0) > 0x7fffffff) @@ -796,13 +805,13 @@ ucs4le_internal_loop_single (struct __gconv_step *step, #define LOOPFCT FROM_LOOP #define BODY \ { \ - if (__builtin_expect (*((uint32_t *) inptr), 0) > 0x7f) \ + if (__builtin_expect (*((const uint32_t *) inptr), 0) > 0x7f) \ { \ STANDARD_ERR_HANDLER (4); \ } \ else \ /* It's an one byte sequence. */ \ - *outptr++ = *((uint32_t *) inptr)++; \ + *outptr++ = *((const uint32_t *) inptr)++; \ } #define LOOP_NEED_FLAGS #include @@ -827,7 +836,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step, #define LOOPFCT FROM_LOOP #define BODY \ { \ - uint32_t wc = *((uint32_t *) inptr); \ + uint32_t wc = *((const uint32_t *) inptr); \ \ /* Since we control every character we read this cannot happen. */ \ assert (wc <= 0x7fffffff); \ @@ -1146,7 +1155,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step, #define LOOPFCT FROM_LOOP #define BODY \ { \ - uint16_t u1 = *((uint16_t *) inptr); \ + uint16_t u1 = *((const uint16_t *) inptr); \ \ if (__builtin_expect (u1 >= 0xd800 && u1 < 0xe000, 0)) \ { \ @@ -1186,7 +1195,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step, #define LOOPFCT FROM_LOOP #define BODY \ { \ - uint32_t val = *((uint32_t *) inptr); \ + uint32_t val = *((const uint32_t *) inptr); \ \ if (__builtin_expect (val, 0) >= 0x10000) \ { \ @@ -1236,7 +1245,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step, #define LOOPFCT FROM_LOOP #define BODY \ { \ - uint16_t u1 = bswap_16 (*((uint16_t *) inptr)); \ + uint16_t u1 = bswap_16 (*((const uint16_t *) inptr)); \ \ if (__builtin_expect (u1 >= 0xd800 && u1 < 0xe000, 0)) \ { \ @@ -1276,7 +1285,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step, #define LOOPFCT FROM_LOOP #define BODY \ { \ - uint32_t val = *((uint32_t *) inptr); \ + uint32_t val = *((const uint32_t *) inptr); \ if (__builtin_expect (val, 0) >= 0x10000) \ { \ STANDARD_ERR_HANDLER (4); \ diff --git a/iconv/gconv_trans.c b/iconv/gconv_trans.c index 4a42a35afd..919d438abe 100644 --- a/iconv/gconv_trans.c +++ b/iconv/gconv_trans.c @@ -41,18 +41,18 @@ __gconv_transliterate (struct __gconv_step *step, { /* Find out about the locale's transliteration. */ uint_fast32_t size; - uint32_t *from_idx; - uint32_t *from_tbl; - uint32_t *to_idx; - uint32_t *to_tbl; - uint32_t *winbuf; - uint32_t *winbufend; + const uint32_t *from_idx; + const uint32_t *from_tbl; + const uint32_t *to_idx; + const uint32_t *to_tbl; + const uint32_t *winbuf; + const uint32_t *winbufend; uint_fast32_t low; uint_fast32_t high; /* The input buffer. There are actually 4-byte values. */ - winbuf = (uint32_t *) *inbufp; - winbufend = (uint32_t *) inbufend; + winbuf = (const uint32_t *) *inbufp; + winbufend = (const uint32_t *) inbufend; /* If there is no transliteration information in the locale don't do anything and return the error. */ @@ -61,10 +61,14 @@ __gconv_transliterate (struct __gconv_step *step, goto no_rules; /* Get the rest of the values. */ - from_idx = (uint32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TRANSLIT_FROM_IDX); - from_tbl = (uint32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TRANSLIT_FROM_TBL); - to_idx = (uint32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TRANSLIT_TO_IDX); - to_tbl = (uint32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TRANSLIT_TO_TBL); + from_idx = + (const uint32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TRANSLIT_FROM_IDX); + from_tbl = + (const uint32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TRANSLIT_FROM_TBL); + to_idx = + (const uint32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TRANSLIT_TO_IDX); + to_tbl = + (const uint32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TRANSLIT_TO_TBL); /* Test whether there is enough input. */ if (winbuf + 1 > winbufend) @@ -156,9 +160,9 @@ __gconv_transliterate (struct __gconv_step *step, if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_TRANSLIT_IGNORE_LEN) != 0) { int n = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_TRANSLIT_IGNORE_LEN); - uint32_t *ranges = (uint32_t *) _NL_CURRENT (LC_CTYPE, - _NL_CTYPE_TRANSLIT_IGNORE); - uint32_t wc = *(uint32_t *) (*inbufp); + const uint32_t *ranges = + (const uint32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TRANSLIT_IGNORE); + const uint32_t wc = *(const uint32_t *) (*inbufp); int i; /* Test whether there is enough input. */ @@ -184,7 +188,7 @@ __gconv_transliterate (struct __gconv_step *step, /* One last chance: use the default replacement. */ if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_TRANSLIT_DEFAULT_MISSING_LEN) != 0) { - uint32_t *default_missing = (uint32_t *) + const uint32_t *default_missing = (const uint32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TRANSLIT_DEFAULT_MISSING); const unsigned char *toinptr = (const unsigned char *) default_missing; uint32_t len = _NL_CURRENT_WORD (LC_CTYPE, @@ -230,7 +234,7 @@ struct known_trans /* This structure must remain the first member. */ struct trans_struct info; - const char *fname; + char *fname; void *handle; int open_count; }; @@ -247,8 +251,8 @@ __libc_lock_define_initialized (static, lock); static int trans_compare (const void *p1, const void *p2) { - struct known_trans *s1 = (struct known_trans *) p1; - struct known_trans *s2 = (struct known_trans *) p2; + const struct known_trans *s1 = (const struct known_trans *) p1; + const struct known_trans *s2 = (const struct known_trans *) p2; return strcmp (s1->info.name, s2->info.name); } diff --git a/iconv/loop.c b/iconv/loop.c index 3a2779ed4a..7b5ef0030f 100644 --- a/iconv/loop.c +++ b/iconv/loop.c @@ -217,7 +217,7 @@ static inline int FCTNAME (LOOPFCT) (struct __gconv_step *step, struct __gconv_step_data *step_data, const unsigned char **inptrp, const unsigned char *inend, - unsigned char **outptrp, unsigned char *outend, + unsigned char **outptrp, const unsigned char *outend, size_t *irreversible EXTRA_LOOP_DECLS) { #ifdef LOOP_NEED_STATE @@ -326,7 +326,7 @@ SINGLE(LOOPFCT) (struct __gconv_step *step, UNPACK_BYTES #else /* Add the bytes from the state to the input buffer. */ - for (inlen = 0; inlen < (state->__count & 7); ++ inlen) + for (inlen = 0; inlen < (size_t) (state->__count & 7); ++inlen) bytebuf[inlen] = state->__value.__wchb[inlen]; #endif diff --git a/iconv/skeleton.c b/iconv/skeleton.c index 43d5d9e4a9..58f381295f 100644 --- a/iconv/skeleton.c +++ b/iconv/skeleton.c @@ -502,15 +502,13 @@ FUNCTION_NAME (struct __gconv_step *step, struct __gconv_step_data *data, if (FROM_DIRECTION) /* Run the conversion loop. */ nstatus = FROM_LOOP (step, data, inptrp, inend, - &outbuf, - (unsigned char *) outerr, + &outbuf, outerr, lirreversiblep EXTRA_LOOP_ARGS); else /* Run the conversion loop. */ nstatus = TO_LOOP (step, data, inptrp, inend, - &outbuf, - (unsigned char *) outerr, + &outbuf, outerr, lirreversiblep EXTRA_LOOP_ARGS); } @@ -524,15 +522,14 @@ FUNCTION_NAME (struct __gconv_step *step, struct __gconv_step_data *data, nstatus = GEN_unaligned (FROM_LOOP) (step, data, inptrp, inend, &outbuf, - (unsigned char *) outerr, + outerr, lirreversiblep EXTRA_LOOP_ARGS); else /* Run the conversion loop. */ nstatus = GEN_unaligned (TO_LOOP) (step, data, inptrp, inend, - &outbuf, - (unsigned char *) outerr, + &outbuf, outerr, lirreversiblep EXTRA_LOOP_ARGS); } diff --git a/iconvdata/gconv-modules b/iconvdata/gconv-modules index 0aa334cced..021dd78448 100644 --- a/iconvdata/gconv-modules +++ b/iconvdata/gconv-modules @@ -33,22 +33,6 @@ # alias: alias name which is not really recognized. # name: the real name of the character set -# from to module cost -alias ANSI_X3.4// ANSI_X3.4-1968// -alias ISO-IR-6// ANSI_X3.4-1968// -alias ANSI_X3.4-1986// ANSI_X3.4-1968// -alias ISO_646.IRV:1991// ANSI_X3.4-1968// -alias ASCII// ANSI_X3.4-1968// -alias ISO646-US// ANSI_X3.4-1968// -alias US-ASCII// ANSI_X3.4-1968// -alias US// ANSI_X3.4-1968// -alias IBM367// ANSI_X3.4-1968// -alias CP367// ANSI_X3.4-1968// -alias CSASCII// ANSI_X3.4-1968// -alias OSF00010020// ANSI_X3.4-1968// -module ANSI_X3.4-1968// INTERNAL ISO646 2 -module INTERNAL ANSI_X3.4-1968// ISO646 2 - alias ISO-IR-4// BS_4730// alias ISO646-GB// BS_4730// alias GB// BS_4730// diff --git a/iconvdata/iso646.c b/iconvdata/iso646.c index d26ed5e3e4..4cfd98c106 100644 --- a/iconvdata/iso646.c +++ b/iconvdata/iso646.c @@ -62,7 +62,6 @@ enum direction enum variant { illegal_var, - US, /* ANSI_X3.4-1968 */ GB, /* BS_4730 */ CA, /* CSA_Z243.4-1985-1 */ CA2, /* CSA_Z243.4-1985-2 */ @@ -90,7 +89,6 @@ enum variant static const char *names[] = { - [US] = "ANSI_X3.4-1968//", [GB] = "BS_4730//", [CA] = "CSA_Z243.4-1985-1//", [CA2] = "CSA_Z243.4-1985-2//", diff --git a/include/set-hooks.h b/include/set-hooks.h index 709f4c0a61..6dfd61c631 100644 --- a/include/set-hooks.h +++ b/include/set-hooks.h @@ -52,7 +52,8 @@ do { \ which calls each function on the hook in turn, with ARGS. */ # define DEFINE_HOOK_RUNNER(name, runner, proto, args) \ -DEFINE_HOOK (name, proto); void runner proto { RUN_HOOK (name, args); } +DEFINE_HOOK (name, proto); \ +extern void runner proto; void runner proto { RUN_HOOK (name, args); } #else diff --git a/include/unistd.h b/include/unistd.h index 04b4739758..cd51117078 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -98,4 +98,9 @@ extern void *__sbrk (intptr_t __delta); environment variables that normally affect them. */ extern int __libc_enable_secure; + +/* Various internal function. */ +extern void __libc_check_standard_fds (void); + + #endif diff --git a/string/bits/string2.h b/string/bits/string2.h index 2cff87be12..32a1746ae8 100644 --- a/string/bits/string2.h +++ b/string/bits/string2.h @@ -208,8 +208,8 @@ __STRING2_COPY_TYPE (8); # if _STRING_ARCH_unaligned # define __mempcpy_args(src) \ - ((char *) (src))[0], ((char *) (src))[2], ((char *) (src))[4], \ - ((char *) (src))[6], \ + ((__const char *) (src))[0], ((__const char *) (src))[2], \ + ((__const char *) (src))[4], ((__const char *) (src))[6], \ __extension__ __STRING2_SMALL_GET16 (src, 0), \ __extension__ __STRING2_SMALL_GET16 (src, 4), \ __extension__ __STRING2_SMALL_GET32 (src, 0), \ diff --git a/sysdeps/generic/initfini.c b/sysdeps/generic/initfini.c index 836d606cfd..60dcdc0564 100644 --- a/sysdeps/generic/initfini.c +++ b/sysdeps/generic/initfini.c @@ -50,6 +50,7 @@ asm ("\n/*@HEADER_ENDS*/"); /* To determine whether we need .end and .align: */ asm ("\n/*@TESTS_BEGIN*/"); +extern void dummy (void (*foo) (void)); void dummy (void (*foo) (void)) { @@ -68,10 +69,11 @@ call_gmon_start(void) void (*gmon_start) (void) = __gmon_start__; if (gmon_start) - gmon_start (); + gmon_start (); } SECTION (".init"); +extern void _init (void); void _init (void) { @@ -97,6 +99,7 @@ asm ("\n/*@_init_EPILOG_ENDS*/"); asm ("\n/*@_fini_PROLOG_BEGINS*/"); SECTION (".fini"); +extern void _fini (void); void _fini (void) { diff --git a/sysdeps/generic/libc-start.c b/sysdeps/generic/libc-start.c index a95ce56d2b..c4b8bc6809 100644 --- a/sysdeps/generic/libc-start.c +++ b/sysdeps/generic/libc-start.c @@ -33,8 +33,15 @@ extern void *__libc_stack_end; extern void __pthread_initialize_minimal (void) __attribute__ ((weak)); #endif -/* Prototype for local function. */ -extern void __libc_check_standard_fds (void); + +extern int BP_SYM (__libc_start_main) (int (*main) (int, char **, char **), + int argc, + char *__unbounded *__unbounded ubp_av, + void (*init) (void), + void (*fini) (void), + void (*rtld_fini) (void), + void *__unbounded stack_end) + __attribute__ ((noreturn)); int /* GKM FIXME: GCC: this should get __BP_ prefix by virtue of the diff --git a/sysdeps/i386/i486/bits/string.h b/sysdeps/i386/i486/bits/string.h index 532dcc103c..1a33630b29 100644 --- a/sysdeps/i386/i486/bits/string.h +++ b/sysdeps/i386/i486/bits/string.h @@ -1057,18 +1057,20 @@ __strncat_g (char *__dest, __const char __src[], size_t __n) : (__builtin_constant_p (s1) && sizeof ((s1)[0]) == 1 \ && sizeof ((s2)[0]) == 1 && strlen (s1) < 4 \ ? (__builtin_constant_p (s2) && sizeof ((s2)[0]) == 1 \ - ? __strcmp_cc ((unsigned char *) (s1), \ - (unsigned char *) (s2), strlen (s1)) \ - : __strcmp_cg ((unsigned char *) (s1), \ - (unsigned char *) (s2), strlen (s1))) \ + ? __strcmp_cc ((__const unsigned char *) (s1), \ + (__const unsigned char *) (s2), \ + strlen (s1)) \ + : __strcmp_cg ((__const unsigned char *) (s1), \ + (__const unsigned char *) (s2), \ + strlen (s1))) \ : (__builtin_constant_p (s2) && sizeof ((s1)[0]) == 1 \ && sizeof ((s2)[0]) == 1 && strlen (s2) < 4 \ ? (__builtin_constant_p (s1) \ - ? __strcmp_cc ((unsigned char *) (s1), \ - (unsigned char *) (s2), \ + ? __strcmp_cc ((__const unsigned char *) (s1), \ + (__const unsigned char *) (s2), \ strlen (s2)) \ - : __strcmp_gc ((unsigned char *) (s1), \ - (unsigned char *) (s2), \ + : __strcmp_gc ((__const unsigned char *) (s1), \ + (__const unsigned char *) (s2), \ strlen (s2))) \ : __strcmp_gg (s1, s2))))) diff --git a/sysdeps/unix/sysv/linux/dl-osinfo.h b/sysdeps/unix/sysv/linux/dl-osinfo.h index 1834da8a9f..1a94d17960 100644 --- a/sysdeps/unix/sysv/linux/dl-osinfo.h +++ b/sysdeps/unix/sysv/linux/dl-osinfo.h @@ -71,7 +71,7 @@ dl_fatal (const char *str) make sure the library can actually work. */ \ FATAL ("FATAL: cannot determine library version\n"); \ __close (fd); \ - buf[MIN (reslen, sizeof (bufmem) - 1)] = '\0'; \ + buf[MIN (reslen, (ssize_t) sizeof (bufmem) - 1)] = '\0'; \ } \ else \ buf = uts.release; \ diff --git a/sysdeps/unix/sysv/linux/init-first.c b/sysdeps/unix/sysv/linux/init-first.c index 101523faca..0e5b4a287d 100644 --- a/sysdeps/unix/sysv/linux/init-first.c +++ b/sysdeps/unix/sysv/linux/init-first.c @@ -108,12 +108,16 @@ init (int argc, char **argv, char **envp) strong_alias (init, _init); +extern void __libc_init_first (void); + void __libc_init_first (void) { } #else +extern void __libc_init_first (int argc, char **argv, char **envp); + void __libc_init_first (int argc, char **argv, char **envp) { @@ -127,6 +131,8 @@ __libc_init_first (int argc, char **argv, char **envp) in ld.so causes disaster, because the _init definition above will cause ld.so to gain an init function, which is not a cool thing. */ +extern void _dl_start (void) __attribute__ ((noreturn)); + void _dl_start (void) {