Commit graph

69 commits

Author SHA1 Message Date
Stefan Liebler 876cdf517d Avoid -Wstringop-overflow= warning in iconv module.
On s390x when compiling with GCC 12, I get this warning:
utf8-utf16-z9.c:
../iconv/loop.c: In function ‘__from_utf8_loop_etf3eh_single’:
../iconv/loop.c:445:22: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
  445 |     bytebuf[inlen++] = *inptr++;
      |     ~~~~~~~~~~~~~~~~~^~~~~~~~~~
../iconv/loop.c:381:17: note: at offset 4 into destination object ‘bytebuf’ of size 4
  381 |   unsigned char bytebuf[MAX_NEEDED_INPUT];
      |                 ^~~~~~~
../iconv/loop.c:445:22: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
  445 |     bytebuf[inlen++] = *inptr++;
      |     ~~~~~~~~~~~~~~~~~^~~~~~~~~~
../iconv/loop.c:381:17: note: at offset 5 into destination object ‘bytebuf’ of size 4
  381 |   unsigned char bytebuf[MAX_NEEDED_INPUT];
      |                 ^~~~~~~

This patch tells the compiler that inend is always behind inptr which
avoids the warning.  Note that the SINGLE function is only used to
implement the mb*towc*() or wc*tomb*() functions.  Those functions use
inptr and inend pointing to a variable on stack, compute the inend pointer
or explicitly check the arguments which always leads to inptr < inend.

Special notes for backporters (according to Siddhesh Poyarekar):
If someone wants to backport this patch to release branches, they should
also backport the following wcrtomb change. Otherwise the assumptions
assumed by this patch are not true.

commit 9bcd12d223
Author: Siddhesh Poyarekar <siddhesh@sourceware.org>
Date:   Fri May 13 19:10:15 2022 +0530

    wcrtomb: Make behavior POSIX compliant

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2022-06-14 11:03:06 +02:00
Paul Eggert 581c785bf3 Update copyright dates with scripts/update-copyrights
I used these shell commands:

../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright
(cd ../glibc && git commit -am"[this commit message]")

and then ignored the output, which consisted lines saying "FOO: warning:
copyright statement not found" for each of 7061 files FOO.

I then removed trailing white space from math/tgmath.h,
support/tst-support-open-dev-null-range.c, and
sysdeps/x86_64/multiarch/strlen-vec.S, to work around the following
obscure pre-commit check failure diagnostics from Savannah.  I don't
know why I run into these diagnostics whereas others evidently do not.

remote: *** 912-#endif
remote: *** 913:
remote: *** 914-
remote: *** error: lines with trailing whitespace found
...
remote: *** error: sysdeps/unix/sysv/linux/statx_cp.c: trailing lines
2022-01-01 11:40:24 -08:00
Siddhesh Poyarekar 30891f35fa Remove "Contributed by" lines
We stopped adding "Contributed by" or similar lines in sources in 2012
in favour of git logs and keeping the Contributors section of the
glibc manual up to date.  Removing these lines makes the license
header a bit more consistent across files and also removes the
possibility of error in attribution when license blocks or files are
copied across since the contributed-by lines don't actually reflect
reality in those cases.

Move all "Contributed by" and similar lines (Written by, Test by,
etc.) into a new file CONTRIBUTED-BY to retain record of these
contributions.  These contributors are also mentioned in
manual/contrib.texi, so we just maintain this additional record as a
courtesy to the earlier developers.

The following scripts were used to filter a list of files to edit in
place and to clean up the CONTRIBUTED-BY file respectively.  These
were not added to the glibc sources because they're not expected to be
of any use in future given that this is a one time task:

https://gist.github.com/siddhesh/b5ecac94eabfd72ed2916d6d8157e7dc
https://gist.github.com/siddhesh/15ea1f5e435ace9774f485030695ee02

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2021-09-03 22:06:44 +05:30
Joseph Myers c8126360df Fix iconv build with GCC mainline
Current GCC mainline produces -Wstringop-overflow errors building some
iconv converters, as discussed at
<https://gcc.gnu.org/pipermail/gcc/2021-July/236943.html>.  Add an
__builtin_unreachable call as suggested so that GCC can see the case
that would involve a buffer overflow is unreachable; because the
unreachability depends on valid conversion state being passed into the
function from previous conversion steps, it's not something the
compiler can reasonably deduce on its own.

Tested with build-many-glibcs.py that, together with
<https://sourceware.org/pipermail/libc-alpha/2021-August/130244.html>,
it restores the glibc build for powerpc-linux-gnu.
2021-08-23 16:18:42 +00:00
Paul Eggert 2b778ceb40 Update copyright dates with scripts/update-copyrights
I used these shell commands:

../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright
(cd ../glibc && git commit -am"[this commit message]")

and then ignored the output, which consisted lines saying "FOO: warning:
copyright statement not found" for each of 6694 files FOO.
I then removed trailing white space from benchtests/bench-pthread-locks.c
and iconvdata/tst-iconv-big5-hkscs-to-2ucs4.c, to work around this
diagnostic from Savannah:
remote: *** pre-commit check failed ...
remote: *** error: lines with trailing whitespace found
remote: error: hook declined to update refs/heads/master
2021-01-02 12:17:34 -08:00
Stefan Liebler 08538f360f Fix stringop-overflow errors from gcc 10 in iconv.
On s390x, I've recognize various -Werror=stringop-overflow messages
in iconv/loop.c and iconv/skeleton.c if build with gcc10 -O3.

With this commit gcc knows the size and do not raise those errors anymore.
2020-07-07 09:41:32 +02:00
Joseph Myers d614a75396 Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
Paul Eggert 5a82c74822 Prefer https to http for gnu.org and fsf.org URLs
Also, change sources.redhat.com to sourceware.org.
This patch was automatically generated by running the following shell
script, which uses GNU sed, and which avoids modifying files imported
from upstream:

sed -ri '
  s,(http|ftp)(://(.*\.)?(gnu|fsf|sourceware)\.org($|[^.]|\.[^a-z])),https\2,g
  s,(http|ftp)(://(.*\.)?)sources\.redhat\.com($|[^.]|\.[^a-z]),https\2sourceware.org\4,g
' \
  $(find $(git ls-files) -prune -type f \
      ! -name '*.po' \
      ! -name 'ChangeLog*' \
      ! -path COPYING ! -path COPYING.LIB \
      ! -path manual/fdl-1.3.texi ! -path manual/lgpl-2.1.texi \
      ! -path manual/texinfo.tex ! -path scripts/config.guess \
      ! -path scripts/config.sub ! -path scripts/install-sh \
      ! -path scripts/mkinstalldirs ! -path scripts/move-if-change \
      ! -path INSTALL ! -path  locale/programs/charmap-kw.h \
      ! -path po/libc.pot ! -path sysdeps/gnu/errlist.c \
      ! '(' -name configure \
            -execdir test -f configure.ac -o -f configure.in ';' ')' \
      ! '(' -name preconfigure \
            -execdir test -f preconfigure.ac ';' ')' \
      -print)

and then by running 'make dist-prepare' to regenerate files built
from the altered files, and then executing the following to cleanup:

  chmod a+x sysdeps/unix/sysv/linux/riscv/configure
  # Omit irrelevant whitespace and comment-only changes,
  # perhaps from a slightly-different Autoconf version.
  git checkout -f \
    sysdeps/csky/configure \
    sysdeps/hppa/configure \
    sysdeps/riscv/configure \
    sysdeps/unix/sysv/linux/csky/configure
  # Omit changes that caused a pre-commit check to fail like this:
  # remote: *** error: sysdeps/powerpc/powerpc64/ppc-mcount.S: trailing lines
  git checkout -f \
    sysdeps/powerpc/powerpc64/ppc-mcount.S \
    sysdeps/unix/sysv/linux/s390/s390-64/syscall.S
  # Omit change that caused a pre-commit check to fail like this:
  # remote: *** error: sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: last line does not end in newline
  git checkout -f sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
2019-09-07 02:43:31 -07:00
Florian Weimer 7ac6fad987 iconv: Remove public declaration of __gconv_transliterate
Commit ba7b4d294b ("Complete the
removal of __gconv_translit_find") added a declaration of the
GLIBC_PRIVATE function, __gconv_transliterate, to the installed
header <gconv.h>.  It should have been added to the internal
<gconv_int.h> header.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2019-05-15 07:16:47 +02:00
Joseph Myers 04277e02d7 Update copyright dates with scripts/update-copyrights.
* All files with FSF copyright notices: Update copyright dates
	using scripts/update-copyrights.
	* locale/programs/charmap-kw.h: Regenerated.
	* locale/programs/locfile-kw.h: Likewise.
2019-01-01 00:11:28 +00:00
Joseph Myers 6900d2ca74 Fix s390 -Os iconv build.
Building glibc for s390 with -Os (32-bit only, with GCC 7) fails with:

In file included from ../sysdeps/s390/multiarch/8bit-generic.c:370:0,
                 from ebcdic-at-de.c:28:
../iconv/loop.c: In function '__to_generic_vx':
../iconv/loop.c:264:22: error: 'ch' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     if (((Character) >> 7) == (0xe0000 >> 7))          \
                      ^~
In file included from ebcdic-at-de.c:28:0:
../sysdeps/s390/multiarch/8bit-generic.c:340:15: note: 'ch' was declared here
      uint32_t ch;      \
               ^
../iconv/loop.c:325:7: note: in expansion of macro 'BODY'
       BODY
       ^~~~

It's fairly easy to see, looking at the (long) expansion of the BODY
macro, that this is a false positive and the relevant variable 'ch' is
always initialized before use, in one of two possible places.  As
such, disabling the warning for -Os with the DIAG_* macros is the
natural approach to fix this build failure.  However, because of the
location at which the warning is reported, the disabling needs to go
in iconv/loop.c, around the definition of UNICODE_TAG_HANDLER (not
inside the definition), as that macro definition is where the
uninitialized use is reported, whereas the code that needs to be
reasoned about to see that the warning is a false positive is in the
definition of BODY elsewhere.

Thus, the patch adds such disabling in iconv/loop.c, with a comment
pointing to the s390-specific code and a comment in the s390-specific
code pointing to the generic file to alert people to the possible need
to update one place when changing the other.  It would be possible if
desired to use #ifdef __s390__ around the disabling, though in general
we try to avoid that sort of thing in generic files.  (Or some
extremely specialized macros for "disable -Wmaybe-uninitialized in
this particular place" could be specified, defined to 0 in a lot of
different files that include iconv/loop.c and to 1 in that particular
s390 file.)

Tested that this fixed -Os compilation for s390-linux-gnu with
build-many-glibcs.py.

	* iconv/loop.c (UNICODE_TAG_HANDLER): Disable
	-Wmaybe-uninitialized for -Os.
	* sysdeps/s390/multiarch/8bit-generic.c (BODY): Add comment about
	this disabling.
2018-03-05 21:46:55 +00:00
Joseph Myers 688903eb3e Update copyright dates with scripts/update-copyrights.
* All files with FSF copyright notices: Update copyright dates
	using scripts/update-copyrights.
	* locale/programs/charmap-kw.h: Regenerated.
	* locale/programs/locfile-kw.h: Likewise.
2018-01-01 00:32:25 +00:00
Zack Weinberg 9090848d06 Narrowing the visibility of libc-internal.h even further.
posix/wordexp-test.c used libc-internal.h for PTR_ALIGN_DOWN; similar
to what was done with libc-diag.h, I have split the definitions of
cast_to_integer, ALIGN_UP, ALIGN_DOWN, PTR_ALIGN_UP, and PTR_ALIGN_DOWN
to a new header, libc-pointer-arith.h.

It then occurred to me that the remaining declarations in libc-internal.h
are mostly to do with early initialization, and probably most of the
files including it, even in the core code, don't need it anymore.  Indeed,
only 19 files actually need what remains of libc-internal.h.  23 others
need libc-diag.h instead, and 12 need libc-pointer-arith.h instead.
No file needs more than one of them, and 16 don't need any of them!

So, with this patch, libc-internal.h stops including libc-diag.h as
well as losing the pointer arithmetic macros, and all including files
are adjusted.

        * include/libc-pointer-arith.h: New file.  Define
	cast_to_integer, ALIGN_UP, ALIGN_DOWN, PTR_ALIGN_UP, and
        PTR_ALIGN_DOWN here.
        * include/libc-internal.h: Definitions of above macros
	moved from here.  Don't include libc-diag.h anymore either.
	* posix/wordexp-test.c: Include stdint.h and libc-pointer-arith.h.
        Don't include libc-internal.h.

	* debug/pcprofile.c, elf/dl-tunables.c, elf/soinit.c, io/openat.c
	* io/openat64.c, misc/ptrace.c, nptl/pthread_clock_gettime.c
	* nptl/pthread_clock_settime.c, nptl/pthread_cond_common.c
	* string/strcoll_l.c, sysdeps/nacl/brk.c
	* sysdeps/unix/clock_settime.c
	* sysdeps/unix/sysv/linux/i386/get_clockfreq.c
	* sysdeps/unix/sysv/linux/ia64/get_clockfreq.c
	* sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c
	* sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c:
	Don't include libc-internal.h.

	* elf/get-dynamic-info.h, iconv/loop.c
	* iconvdata/iso-2022-cn-ext.c, locale/weight.h, locale/weightwc.h
	* misc/reboot.c, nis/nis_table.c, nptl_db/thread_dbP.h
	* nscd/connections.c, resolv/res_send.c, soft-fp/fmadf4.c
	* soft-fp/fmasf4.c, soft-fp/fmatf4.c, stdio-common/vfscanf.c
	* sysdeps/ieee754/dbl-64/e_lgamma_r.c
	* sysdeps/ieee754/dbl-64/k_rem_pio2.c
	* sysdeps/ieee754/flt-32/e_lgammaf_r.c
	* sysdeps/ieee754/flt-32/k_rem_pio2f.c
	* sysdeps/ieee754/ldbl-128/k_tanl.c
	* sysdeps/ieee754/ldbl-128ibm/k_tanl.c
	* sysdeps/ieee754/ldbl-96/e_lgammal_r.c
	* sysdeps/ieee754/ldbl-96/k_tanl.c, sysdeps/nptl/futex-internal.h:
	Include libc-diag.h instead of libc-internal.h.

        * elf/dl-load.c, elf/dl-reloc.c, locale/programs/locarchive.c
        * nptl/nptl-init.c, string/strcspn.c, string/strspn.c
	* malloc/malloc.c, sysdeps/i386/nptl/tls.h
	* sysdeps/nacl/dl-map-segments.h, sysdeps/x86_64/atomic-machine.h
	* sysdeps/unix/sysv/linux/spawni.c
        * sysdeps/x86_64/nptl/tls.h:
        Include libc-pointer-arith.h instead of libc-internal.h.

	* elf/get-dynamic-info.h, sysdeps/nacl/dl-map-segments.h
	* sysdeps/x86_64/atomic-machine.h:
        Add multiple include guard.
2017-03-01 20:33:46 -05:00
Joseph Myers bfff8b1bec Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
Joseph Myers f7a9f785e5 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
Andreas Krebbel 5fe8e35975 iconv: Suppress array out of bounds warning. 2015-01-27 09:37:04 +01:00
Joseph Myers b168057aaa Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
Florian Weimer ba7b4d294b Complete the removal of __gconv_translit_find
Prior to the 2.20 release, the function was just changed to fail
unconditionally, in commit a1a6a401ab.
This commit removes the function completely, including gconv bits
which depend on it.

This changes the gconv ABI, which is not a public interface.
2014-09-12 09:17:32 +02:00
Will Newton 32bead5b6d iconv/loop.c: Fix -Wundef warning with !_STRING_ARCH_unaligned
If code is required to handle the unaligned case then loop.c includes
itself and relies on the #undefs at the end of the file to avoid
outputting two copies of LOOPFCT and gconv_btowc. However
MAX_NEEDED_INPUT is tested with #if so this causes a warning.
Reorder the code so that the function definitions are in an #else
block to make the behaviour clearer and fix the warning.

Verified that code is unchanged on x86_64 and arm.

ChangeLog:

2014-07-17  Will Newton  <will.newton@linaro.org>

	* iconv/loop.c: Move definition of LOOPFCT and gconv_btowc
	into an #else block.
2014-07-17 10:16:09 +01:00
Adhemerval Zanella 27822ce67f Define _STRING_ARCH_unaligned unconditionally
This patch defines _STRING_ARCH_unaligned to 0 on default bits/string.h
header to avoid undefined compiler warnings on platforms that do not
define it.  It also make adjustments in code where tests checked if macro
existed or not.
2014-04-09 15:05:36 -05:00
Ondřej Bílka a1ffb40e32 Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
Allan McRae d4697bc93d Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
Ondřej Bílka 382466e04e Fix typos. 2013-08-30 18:08:59 +02:00
Joseph Myers 568035b787 Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
Paul Eggert 59ba27a63a Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
Ulrich Drepper a784e50247 Remove pre-ISO C support
No more __const.
2012-01-07 23:57:22 -05:00
Ulrich Drepper 5e0d030065 Fix assertion in gconv's loop.c 2012-01-03 10:37:59 -05:00
Ulrich Drepper 0656e90edc Optimize conversion of single character in gconv 2011-05-14 01:03:08 -04:00
Ulrich Drepper 1af4e29837 Fix handling of incomplete character storage in state
If iconv is called more than once in a row for adding bytes to the sequence
while still remain under the minimum size of a character and if STORE_REST
is defined, we didn't consume any input.  Fix that.
2011-05-14 00:53:21 -04:00
Ulrich Drepper 4b1b449d1d 008-01-08 Jakub Jelinek <jakub@redhat.com>
* iconv/loop.c (UPDATE_PARAMS): Define to empty statement if not
	defined.
	(REINIT_PARAMS): Likewise.  Undefine before end of file.
	(STANDARD_TO_LOOP_ERR_HANDLER): Use UPDATE_PARAMS before calling
	transliteration hooks and REINIT_PARAMS afterwards.
	* iconvdata/iso-2022-jp.c (BODY): Use a separate variable for
	status.
	(REINIT_PARAMS): Define.
	* iconvdata/ibm1364.c (REINIT_PARAMS): Likewise.
	* iconvdata/ibm930.c (REINIT_PARAMS): Likewise.
	* iconvdata/ibm933.c (REINIT_PARAMS): Likewise.
	* iconvdata/ibm935.c (REINIT_PARAMS): Likewise.
	* iconvdata/ibm937.c (REINIT_PARAMS): Likewise.
	* iconvdata/ibm939.c (REINIT_PARAMS): Likewise.
	* iconvdata/iso-2022-cn.c (REINIT_PARAMS): Likewise.
	* iconvdata/iso-2022-cn-ext.c (REINIT_PARAMS): Likewise.
	* iconvdata/iso-2022-jp-3.c (REINIT_PARAMS): Likewise.
	* iconvdata/iso-2022-kr.c (REINIT_PARAMS): Likewise.
	* iconvdata/Makefile: Add rules to build and run tst-iconv7.c.
	* iconvdata/tst-iconv7.c: New test.
2008-01-09 20:03:58 +00:00
Ulrich Drepper f2a8406a4f [BZ #5277]
2007-11-07  Ulrich Drepper  <drepper@redhat.com>
	[BZ #5277]
	* iconv/loop.c (STANDARD_TO_LOOP_ERR_HANDLER): If conversion failed
	because output buffer is too small break, don't loop.
	* iconvdata/Makefile (tests): Add bug-iconv6.
	* iconvdata/bug-iconv6.c: New file.
2007-11-08 00:04:24 +00:00
Ulrich Drepper 5512d89be3 [!STORE_REST] (SINGLE): Correctly record number of left-over bytes and store them correctly. 2005-09-25 16:42:36 +00:00
Ulrich Drepper a334319f65 (CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4. 2004-12-22 20:10:10 +00:00
Jakub Jelinek 0ecb606cb6 2.5-18.1 2007-07-12 18:26:36 +00:00
Ulrich Drepper dd9423a67a Update.
2003-06-11  Ulrich Drepper  <drepper@redhat.com>

	* allocatestack.c (queue_stack): Always inline.
	* ptreadhP.h (__do_cancel): Likewise.
2003-06-11 21:57:23 +00:00
Ulrich Drepper 41f112ad22 Update.
* iconv/loop.c: Use CLEAR_STATE if defined to clear __state element.
2003-01-16 07:21:24 +00:00
Ulrich Drepper f9ad060c7a Update.
2002-11-30  Bruno Haible  <bruno@clisp.org>

	* iconv/gconv.h (__gconv_btowc_fct): New typedef.
	(struct __gconv_step): New field __btowc_fct.
	* wcsmbs/btowc.c (__btowc): Use the __btowc_fct shortcut if possible.
	* iconv/gconv_int.h (__BUILTIN_TRANSFORM): Renamed from
	__BUILTIN_TRANS.
	(__gconv_btwoc_ascii): New declaration.
	* iconv/gconv_simple.c (BUILTIN_TRANSFORMATION): Add BtowcFct argument.
	(__gconv_btwoc_ascii): New function.
	* iconv/gconv_builtin.h: Add BtowcFct argument to all
	BUILTIN_TRANSFORMATION invocations.
	* iconv/gconv_conf.c (BUILTIN_TRANSFORMATION): Add BtowcFct argument.
	* iconv/iconvconfig.c (BUILTIN_TRANSFORMATION): Likewise.
	* iconv/gconv_builtin.c (map): New field btowc_fct.
	(BUILTIN_TRANSFORMATION): Add BtowcFct argument. Use it to initialize
	btowc_fct field.
	(__gconv_get_builtin_trans): Initialize __btowc_fct field.
	* iconv/gconv_cache.c (find_module): Initialize __btowc_fct field.
	* iconv/gconv_db.c (gen_steps, increment_counter): Likewise.
	* wcsmbs/wcsmbsload.c (to_wc, to_mb): Likewise.
	* iconv/skeleton.c: Document STORE_REST and FROM_ONEBYTE.
	(gconv_init): Initialize __btowc_fct field.
	Undefine EXTRA_LOOP_ARGS and FROM_ONEBYTE at the end.
	* iconv/loop.c: Document ONEBYTE_BODY.
	(gconv_btowc, FROM_ONEBYTE): Define if ONEBYTE_BODY is defined.
	Undefine ONEBYTE_BODY at the end.
	* iconvdata/8bit-generic.c (ONEBYTE_BODY): New macro.
	* iconvdata/8bit-gap.c (NONNUL): New macro.
	(BODY for FROM_LOOP): Use it.
	(ONEBYTE_BODY): New macro.
	* iconvdata/isiri-3342.c (HAS_HOLES): Set to 1.
	(NONNUL): New macro.
	* iconvdata/ansi_x3.110.c (ONEBYTE_BODY): New macro.
	* iconvdata/armscii-8.c (ONEBYTE_BODY): New macro.
	* iconvdata/cp1255.c (ONEBYTE_BODY): New macro.
	* iconvdata/cp1258.c (ONEBYTE_BODY): New macro.
	* iconvdata/tcvn5712-1.c (ONEBYTE_BODY): New macro.
	* iconvdata/big5.c (ONEBYTE_BODY): New macro.
	* iconvdata/big5hkscs.c (ONEBYTE_BODY): New macro.
	* iconvdata/euc-cn.c (ONEBYTE_BODY): New macro.
	* iconvdata/euc-jp.c (ONEBYTE_BODY): New macro.
	* iconvdata/euc-jisx0213.c (ONEBYTE_BODY): New macro.
	* iconvdata/euc-kr.c (ONEBYTE_BODY): New macro.
	* iconvdata/euc-tw.c (ONEBYTE_BODY): New macro.
	* iconvdata/gbk.c (ONEBYTE_BODY): New macro.
	* iconvdata/gb18030.c (ONEBYTE_BODY): New macro.
	* iconvdata/ibm932.c: Include <stdbool.h>.
	(TRUE, FALSE): Remove macros.
	(BODY for FROM_LOOP): Remove unused variable rp1.
	(ONEBYTE_BODY): New macro.
	(BODY for TO_LOOP): Use bool.
	* iconvdata/ibm932.h (__ibm932sb_to_ucs4_idx): Remove array.
	* iconvdata/ibm943.c: Include <stdbool.h>.
	(TRUE, FALSE): Remove macros.
	(BODY for FROM_LOOP): Remove unused variable rp1.
	(ONEBYTE_BODY): New macro.
	(BODY for TO_LOOP): Use bool.
	* iconvdata/ibm943.h (__ibm943sb_to_ucs4_idx): Remove array.
	* iconvdata/iso8859-1.c (ONEBYTE_BODY): New macro.
	* iconvdata/iso_6937-2.c (ONEBYTE_BODY): New macro.
	* iconvdata/iso_6937.c (ONEBYTE_BODY): New macro.
	* iconvdata/johab.c (ONEBYTE_BODY): New macro.
	* iconvdata/sjis.c (ONEBYTE_BODY): New macro.
	* iconvdata/shift_jisx0213.c (ONEBYTE_BODY): New macro.
	* iconvdata/t.61.c (ONEBYTE_BODY): New macro.
	* iconvdata/uhc.c (ONEBYTE_BODY): New macro.
	* iconvdata/gbbig5.c: Tweak comment.
2002-12-02 22:39:58 +00:00
Ulrich Drepper eb9dc2a22d Update.
* iconv/gconv_simple.c (internal_ucs4le_loop_unaligned): Return
	__GCONV_EMPTY_INPUT only if input is really empty.  Otherwise
	__GCONV_INCOMPLETE_INPUT.
	(ucs4le_internal_loop): Likewise.
	(ucs4le_internal_loop_unaligned): Likewise.
	* iconvdata/unicode.c (PREPARE_LOOP): Likewise.
	* iconvdata/utf-16.c (PREPARE_LOOP): Likewise.
	* iconvdata/utf-32.c (PREPARE_LOOP): Likewise.

	* iconv/loop.c (LOOPFCT): First test for empty input then for full
	output buffer.
2002-11-20 23:42:04 +00:00
Ulrich Drepper e438a46845 Update.
2002-05-26  Bruno Haible  <bruno@clisp.org>
	* iconv/loop.c (STANDARD_FROM_LOOP_ERR_HANDLER): New macro.
	(STANDARD_TO_LOOP_ERR_HANDLER): Renamed from STANDARD_ERR_HANDLER.
	All callers changed.
	* iconv/gconv_simple.c (ascii_internal_loop): For error handling use
	STANDARD_FROM_LOOP_ERR_HANDLER.
	(utf8_internal_loop): Likewise.
	(ucs2_internal_loop): Likewise.
	(internal_ucs2_loop): Perform error handling like in
	STANDARD_FROM_LOOP_ERR_HANDLER.
	* iconvdata/unicode.c (BODY for TO_LOOP): Perform error handling like
	in STANDARD_FROM_LOOP_ERR_HANDLER.
	(BODY for FROM_LOOP): Use STANDARD_FROM_LOOP_ERR_HANDLER for error
	handling.
	* iconvdata/utf-16.c (BODY for TO_LOOP): Perform error handling like
	in STANDARD_FROM_LOOP_ERR_HANDLER.
	(BODY for FROM_LOOP): Use STANDARD_FROM_LOOP_ERR_HANDLER for error
	handling.
	* iconvdata/utf-32.c (BODY for TO_LOOP): Perform error handling like
	in STANDARD_FROM_LOOP_ERR_HANDLER.
	(BODY for FROM_LOOP): Use STANDARD_FROM_LOOP_ERR_HANDLER for error
	handling.
	* iconvdata/big5.c (BODY for FROM_LOOP): For error handling use
	STANDARD_FROM_LOOP_ERR_HANDLER.
	* iconvdata/iso-2022-jp.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/8bit-gap.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/8bit-generic.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/ansi_x3.110.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/armscii-8.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/cp1255.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/cp1258.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/euc-cn.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/euc-jisx0213.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/euc-jp.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/euc-kr.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/euc-tw.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/big5hkscs.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/gb18030.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/gbk.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/iso-2022-cn-ext.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/iso-2022-cn.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/iso-2022-jp-3.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/iso-2022-kr.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/iso646.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/iso_6937-2.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/iso_6937.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/johab.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/shift_jisx0213.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/sjis.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/t.61.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/uhc.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/utf-7.c (BODY for FROM_LOOP): Likewise.
	* iconvdata/gbbig5.c (BODY for FROM_LOOP): Likewise.  When ignoring
	an error, still set result = __GCONV_ILLEGAL_INPUT.
	(BODY for TO_LOOP): Likewise.
	* iconvdata/ibm930.c (BODY for FROM_LOOP): For error handling use
	STANDARD_FROM_LOOP_ERR_HANDLER.
	(BODY for TO_LOOP): Here use STANDARD_TO_LOOP_ERR_HANDLER.
	* iconvdata/ibm932.c: Include <dlfcn.h> and <stdint.h>.
	(BODY for FROM_LOOP): Use STANDARD_FROM_LOOP_ERR_HANDLER for error
	handling.
	(BODY for TO_LOOP): Here use STANDARD_TO_LOOP_ERR_HANDLER.
	* iconvdata/ibm933.c (BODY for FROM_LOOP): For error handling use
	STANDARD_FROM_LOOP_ERR_HANDLER.
	(BODY for TO_LOOP): Here use STANDARD_TO_LOOP_ERR_HANDLER.
	* iconvdata/ibm935.c (BODY for FROM_LOOP): For error handling use
	STANDARD_FROM_LOOP_ERR_HANDLER.
	(BODY for TO_LOOP): Here use STANDARD_TO_LOOP_ERR_HANDLER.
	* iconvdata/ibm937.c (BODY for FROM_LOOP): For error handling use
	STANDARD_FROM_LOOP_ERR_HANDLER.
	(BODY for TO_LOOP): Here use STANDARD_TO_LOOP_ERR_HANDLER.
	* iconvdata/ibm939.c (BODY for FROM_LOOP): For error handling use
	STANDARD_FROM_LOOP_ERR_HANDLER.
	(BODY for TO_LOOP): Here use STANDARD_TO_LOOP_ERR_HANDLER.
	* iconvdata/ibm943.c: Include <dlfcn.h> and <stdint.h>.
	(BODY for FROM_LOOP): Use STANDARD_FROM_LOOP_ERR_HANDLER for error
	handling.
	(BODY for TO_LOOP): Here use STANDARD_TO_LOOP_ERR_HANDLER.
	* iconvdata/gbgbk.c (BODY for FROM_LOOP): Update.
	* iconvdata/iso8859-1.c (BODY for TO_LOOP): Update.
	* iconvdata/tcvn5712-1.c (BODY for TO_LOOP): Update.

2002-06-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>

	* sysdeps/sh/dl-machine.h (elf_machine_load_address): Use local
	labels in assembler instructions.
2002-06-28 21:23:06 +00:00
Ulrich Drepper c0a0f9a32c Update.
2002-05-21  Isamu Hasegawa  <isamu@yamato.ibm.com>

	* posix/regex.c: Define `inline' as a macro into nothing for the
	compilers which lack the keyword.
	* posix/regex.h: (RE_SYNTAX_GNU_AWK): Remove RE_CONTEXT_INVALID_OPS
	for the compatibility of gawk.
	* posix/regcomp.c: Add fake implementation of isblank() for the
	environments which lack the function.
	Don't use free_charset() in case of non-i18n envs.
	(build_range_exp): Don't use i18n related code in case of non-i18n
	envs.
	(build_collating_symbol): Likewise.
	(build_equiv_class): Likewise.
	(build_charclass): Likewise.
	(re_compile_fastmap_iter): Likewise.
	(parse_bracket_exp): Likewise.
	(build_word_op): Likewise.
	(regfree): Don't use free_charset() in case of non-i18n envs.
	* posix/regex_internal.h: Remove COMPLEX_BRACKET from
	re_token_type_t in case of non-i18n envs.
	Don't define re_charset_t in case of non-i18n envs.
	Change the type of wcs of re_string_t from wchar_t to wint_t,
	since we store also WEOF.
	* posix/regex_internal.c: (re_string_realloc_buffers): Change
	the type of wcs of re_string_t from wchar_t to wint_t.
	(re_string_reconstruct): Likewise.
	(create_ci_newstate): Don't use i18n related code in case of
	non-i18n envs.
	(create_cd_newstate): Likewise.

2002-05-24  Ulrich Drepper  <drepper@redhat.com>

	* iconv/loop.c: Fix typo.

2002-05-23  Jakub Jelinek  <jakub@redhat.com>

	* inet/ether_line.c (ether_line): Fix a typo causing only
	lower 4 bits of each ethernet address byte being assigned.
	Don't modify what line points to.
	* inet/tst-ether_aton.c (main): Add ether_line tests.

2002-05-23  Marcus Brinkmann  <marcus@gnu.org>

	* manual/filesys.texi: Don't make readlink example leak memory
	when readlink fails.
2002-05-24 08:49:00 +00:00
Ulrich Drepper 4a0de63bbe Update.
2002-05-20  Ulrich Drepper  <drepper@redhat.com>

	* iconv/loop.c: Fix condition for defining unaligned loop.  Add
	some more security checks.
2002-05-21 06:01:28 +00:00
Andreas Schwab f7ccf2fcaf (put16) [!_STRING_ARCH_unaligned && BIG_ENDIAN]: Fix index. 2001-07-15 15:18:22 +00:00
Andreas Jaeger 41bdb6e20c Update to LGPL v2.1.
2001-07-06  Paul Eggert  <eggert@twinsun.com>

	* manual/argp.texi: Remove ignored LGPL copyright notice; it's
	not appropriate for documentation anyway.
	* manual/libc-texinfo.sh: "Library General Public License" ->
	"Lesser General Public License".

2001-07-06  Andreas Jaeger  <aj@suse.de>

	* All files under GPL/LGPL version 2: Place under LGPL version
	2.1.
2001-07-06 04:58:11 +00:00
Ulrich Drepper 9a1f675436 (UNICODE_TAG_HANDLER): New macro. 2001-06-06 12:25:29 +00:00
Ulrich Drepper b91d5eda6e (get16): Add const to cast. (get32): Likewise. 2000-11-27 17:46:49 +00:00
Ulrich Drepper 17427edd1f Update.
2000-11-20  Ulrich Drepper  <drepper@redhat.com>

	* 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.
2000-11-20 09:16:41 +00:00
Ulrich Drepper b572c2da31 Update.
2000-08-25  Ulrich Drepper  <drepper@redhat.com>

	* locales/i18n (default_missing): Change back to only U003F.
2000-08-25 22:13:09 +00:00
Ulrich Drepper 7888313d3c Update.
2000-07-14  Ulrich Drepper  <drepper@redhat.com>

	* iconv/loop.c (STANDARD_ERR_HANDLER): If one of the
	transliteration function did its job, continue, don't stop.

	* iconvdata/iso646.c: Little optimizations in body for conversion
	from UCS4.
2000-07-15 06:14:56 +00:00
Ulrich Drepper ca3c013564 Update.
* elf/Versions (ld): Export _dl_out_of_memory for GLIBC_2.2.
	* dlfcn/dlerror.c (dlerror): Don't free the error string if it is the
	report that we are out of memory.
	* elf/dl-deps.c (_dl_map_object_deps): Likewise.
	* elf/dl-libc.c (dlerror_run): Likewise.
	* elf/dl-open.c (_dl_open): Likewise.
	* elf/rtld.c (dl_main): Likewise.
	* elf/dl-error.c: Define _dl_out_of_memory.
	(_dl_signal_error): Return _dl_signal_error if we cannot duplicate
	the error string.
	* sysdeps/generic/ldsodefs.h: Declare _dl_out_of_memory.

	* dlfcn/dlerror.c (free_key_mem): Also free error string.

	* iconv/loop.c: Fix comment.
2000-07-13 19:46:27 +00:00
Ulrich Drepper d620426811 Update.
2000-06-19  Ulrich Drepper  <drepper@redhat.com>

	* iconv/gconv.h (__gconv_trans_fct): Add new parameter.
	General namespace cleanup.
	(struct __gconv_trans_data): Add next field.
	(struct __gconv_step_data): Make __trans a pointer.
	* iconv/gconv_conf.c: Split out code to find gconv directories from
	__gconv_read_conf in new functions.
	* iconv/gconv_int.h: Define new data structure and declare new
	functions for handling of gconv directory list.
	* iconv/gconv_open.c: Allow more than one error handling step being
	used.  Call function to load error handling module if it is none
	of the builtin transformations.
	* iconv/gconv_close.c: Add code to free transliteration data.
	* iconv/gconv_trans.c: Add functions to load and unload modules
	implementing transliteration etc.
	* iconv/skeleton.c: Call all context functions now that more than
	one module is allowed.
	* iconv/loop.c (STANDARD_ERR_HANDLING): New macro.
	* iconv/gconv_simple.c: Use STANDARD_ERR_HANDLING macro for places
	where the full error handling using transliteration is needed.
	* iconvdata/8bit-gap.c: Likewise.
	* iconvdata/8bit-generic.c: Likewise.
	* iconvdata/ansi_x3.110.c: Likewise.
	* iconvdata/big5.c: Likewise.
	* iconvdata/big5hkscs.c: Likewise.
	* iconvdata/euc-cn.c: Likewise.
	* iconvdata/euc-jp.c: Likewise.
	* iconvdata/euc-kr.c: Likewise.
	* iconvdata/euc-tw.c: Likewise.
	* iconvdata/gbgbk.c: Likewise.
	* iconvdata/gbk.c: Likewise.
	* iconvdata/iso-2022-cn.c: Likewise.
	* iconvdata/iso-2022-jp.c: Likewise.
	* iconvdata/iso-2022-kr.c: Likewise.
	* iconvdata/iso646.c: Likewise.
	* iconvdata/iso8859-1.c: Likewise.
	* iconvdata/iso_6937-2.c: Likewise.
	* iconvdata/iso_6937.c: Likewise.
	* iconvdata/johab.c: Likewise.
	* iconvdata/sjis.c: Likewise.
	* iconvdata/t.61.c: Likewise.
	* iconvdata/uhc.c: Likewise.
	* iconvdata/unicode.c: Likewise.
	* iconvdata/utf-16.c: Likewise.
	* libio/iofwide.c: Reset __trans member of __gconv_trans_data
	structure correctly after last change.
	* wcsmbs/btowc.c: Likewise.
	* wcsmbs/mbrtowc.c: Likewise.
	* wcsmbs/mbsnrtowcs.c: Likewise.
	* wcsmbs/mbsrtowcs.c: Likewise.
	* wcsmbs/wcrtomb.c: Likewise.
	* wcsmbs/wcsnrtombs.c: Likewise.
	* wcsmbs/wcsrtombs.c: Likewise.
	* wcsmbs/wctob.c: Likewise.

	* localedata/Makefile: Set -Wno-format for some files since gcc does
	not know all the format specifiers.

2000-06-18  Ulrich Drepper  <drepper@redhat.com>

	* locale/loadlocale.c (_nl_unload_locale): Remove a bit of
	unneeded code.
	* locale/lc-time.c (_nl_init_era_entries): Likewise.
2000-06-19 21:12:06 +00:00