Commit Graph

32 Commits

Author SHA1 Message Date
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
Joseph Myers 309548bec3 Support C2X printf %b, %B
C2X adds a printf %b format (see
<http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2630.pdf>, accepted
for C2X), for outputting integers in binary.  It also has recommended
practice for a corresponding %B format (like %b, but %#B starts the
output with 0B instead of 0b).  Add support for these formats to
glibc.

One existing test uses %b as an example of an unknown format, to test
how glibc printf handles unknown formats; change that to %v.  Use of
%b and %B as user-registered format specifiers continues to work (and
we already have a test that covers that, tst-printfsz.c).

Note that C2X also has scanf %b support, plus support for binary
constants starting 0b in strtol (base 0 and 2) and scanf %i (strtol
base 0 and scanf %i coming from a previous paper that added binary
integer literals).  I intend to implement those features in a separate
patch or patches; as discussed in the thread starting at
<https://sourceware.org/pipermail/libc-alpha/2020-December/120414.html>,
they will be more complicated because they involve adding extra public
symbols to ensure compatibility with existing code that might not
expect 0b constants to be handled by strtol base 0 and 2 and scanf %i,
whereas simply adding a new format specifier poses no such
compatibility concerns.

Note that the actual conversion from integer to string uses existing
code in _itoa.c.  That code has special cases for bases 8, 10 and 16,
probably so that the compiler can optimize division by an integer
constant in the code for those bases.  If desired such special cases
could easily be added for base 2 as well, but that would be an
optimization, not actually needed for these printf formats to work.

Tested for x86_64 and x86.  Also tested with build-many-glibcs.py for
aarch64-linux-gnu with GCC mainline to make sure that the test does
indeed build with GCC 12 (where format checking warnings are enabled
for most of the test).
2021-11-10 15:52:21 +00:00
Siddhesh Poyarekar 921e6f4198 printf: Add smoke tests for long double
The printf tests have no coverage for long double.  Duplicate the
double tests so that we have some basic coverage.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2021-02-05 09:52:52 +05:30
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
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
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
Florian Weimer 5a35750665 stdio-common/tst-printf.c: Remove part under a non-free license [BZ #23363]
The license does not allow modification.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2018-07-03 18:29:16 +02: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
Tulio Magno Quites Machado Filho 179dcdb7af [BZ #22142] powerpc: Fix the carry bit on mpn_[add|sub]_n on POWER7
Fix the ifdef clause that was being used in the opposite way, setting
a wrong value of the carry bit.

This is also correcting 2 memory accesses that were mistakenly referring
to r0 while they were supposed to mean the immediate value 0.

	[BZ #22142]
	* stdio-common/tst-printf.c (fp_test): Add tests for DBL_MAX and
	-DBL_MAX.
	(do_test): Likewise.
	* stdio-common/tst-printf.sh: Likewise.
	* sysdeps/powerpc/powerpc64/power7/add_n.S: Invert the initial
	ifdef clause in order to set the carry bit right.  Replace r0 by
	0 without changing the behavior.
2017-10-13 15:44:39 -03:00
Joseph Myers bfff8b1bec Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
Marko Myllynen 48d0341cdd Make shebang interpreter directives consistent 2016-01-07 04:03:21 -05:00
Joseph Myers f7a9f785e5 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
Joseph Myers b168057aaa Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
Joseph Myers 8540f6d2a7 Don't require test wrappers to preserve environment variables, use more consistent environment.
One wart in the original support for test wrappers for cross testing,
as noted in
<https://sourceware.org/ml/libc-alpha/2012-10/msg00722.html>, is the
requirement for test wrappers to pass a poorly-defined set of
environment variables from the build system to the system running the
glibc under test.  Although some variables are passed explicitly via
$(test-wrapper-env), including LD_* variables that simply can't be
passed implicitly because of the side effects they'd have on the build
system's dynamic linker, others are passed implicitly, including
variables such as GCONV_PATH and LOCPATH that could potentially affect
the build system's libc (so effectively relying on any such effects
not breaking the wrappers).  In addition, the code in
cross-test-ssh.sh for preserving environment variables is fragile (it
depends on how bash formats a list of exported variables, and could
well break for multi-line variable definitions where the contents
contain things looking like other variable definitions).

This patch moves to explicitly passing environment variables via
$(test-wrapper-env).  Makefile variables that previously used
$(test-wrapper) are split up into -before-env and -after-env parts
that can be passed separately to the various .sh files used in
testing, so those files can then insert environment settings between
the two parts.

The common default environment settings in make-test-out are made into
a separate makefile variable that can also be passed to scripts,
rather than many scripts duplicating those settings (for testing an
installed glibc, it is desirable to have the GCONV_PATH setting on
just one place, so just that one place needs to support it pointing to
an installed sysroot instead of the build tree).  The default settings
are included in the variables such as $(test-program-prefix), so that
if tests do not need any non-default settings they can continue to use
single variables rather than the split-up variables.

Although this patch cleans up LC_ALL=C settings (that being part of
the common defaults), various LANG=C and LANGUAGE=C settings remain.
Those are generally unnecessary and I propose a subsequent cleanup to
remove them.  LC_ALL takes precedence over LANG, and while LANGUAGE
takes precedence over LC_ALL, it only does so for settings other than
LC_ALL=C.  So LC_ALL=C on its own is sufficient to ensure the C
locale, and anything that gets LC_ALL=C does not need the other
settings.

While preparing this patch I noticed some tests with .sh files that
appeared to do nothing beyond what the generic makefile support for
tests can do (localedata/tst-wctype.sh - the makefiles support -ENV
variables and .input files - and localedata/tst-mbswcs.sh - just runs
five tests that could be run individually from the makefile).  So I
propose another subsequent cleanup to move those to using the generic
support instead of special .sh files.

Tested x86_64 (native) and powerpc32 (cross).

	* Makeconfig (run-program-env): New variable.
	(run-program-prefix-before-env): Likewise.
	(run-program-prefix-after-env): Likewise.
	(run-program-prefix): Define in terms of new variables.
	(built-program-cmd-before-env): New variable.
	(built-program-cmd-after-env): Likewise.
	(built-program-cmd): Define in terms of new variables.
	(test-program-prefix-before-env): New variable.
	(test-program-prefix-after-env): Likewise.
	(test-program-prefix): Define in terms of new variables.
	(test-program-cmd-before-env): New variable.
	(test-program-cmd-after-env): Likewise.
	(test-program-cmd): Define in terms of new variables.
	* Rules (make-test-out): Use $(run-program-env).
	* scripts/cross-test-ssh.sh (env_blacklist): Remove variable.
	(help): Do not mention environment variables.  Mention
	--timeoutfactor option.
	(timeoutfactor): New variable.
	(blacklist_exports): Remove function.
	(exports): Remove variable.
	(command): Do not include ${exports}.
	* manual/install.texi (Configuring and compiling): Do not mention
	test wrappers preserving environment variables.  Mention that last
	assignment to a variable must take precedence.
	* INSTALL: Regenerated.
	* benchtests/Makefile (run-bench): Use $(run-program-env).
	* catgets/Makefile ($(objpfx)test1.cat): Use
	$(built-program-cmd-before-env), $(run-program-env) and
	$(built-program-cmd-after-env).
	($(objpfx)test2.cat): Do not specify environment variables
	explicitly.
	($(objpfx)de/libc.cat): Use $(built-program-cmd-before-env),
	$(run-program-env) and $(built-program-cmd-after-env).
	($(objpfx)test-gencat.out): Use $(test-program-cmd-before-env),
	$(run-program-env) and $(test-program-cmd-after-env).
	($(objpfx)sample.SJIS.cat): Do not specify environment variables
	explicitly.
	* catgets/test-gencat.sh: Use test_program_cmd_before_env,
	run_program_env and test_program_cmd_after_env arguments.
	* elf/Makefile ($(objpfx)tst-pathopt.out): Use $(run-program-env).
	* elf/tst-pathopt.sh: Use run_program_env argument.
	* iconvdata/Makefile ($(objpfx)iconv-test.out): Use
	$(test-wrapper-env) and $(run-program-env).
	* iconvdata/run-iconv-test.sh: Use test_wrapper_env and
	run_program_env arguments.
	* iconvdata/tst-table.sh: Do not set GCONV_PATH explicitly.
	* intl/Makefile ($(objpfx)tst-gettext.out): Use
	$(test-program-prefix-before-env), $(run-program-env) and
	$(test-program-prefix-after-env).
	($(objpfx)tst-gettext2.out): Likewise.
	* intl/tst-gettext.sh: Use test_program_prefix_before_env,
	run_program_env and test_program_prefix_after_env arguments.
	* intl/tst-gettext2.sh: Likewise.
	* intl/tst-gettext4.sh: Do not set environment variables
	explicitly.
	* intl/tst-gettext6.sh: Likewise.
	* intl/tst-translit.sh: Likewise.
	* malloc/Makefile ($(objpfx)tst-mtrace.out): Use
	$(test-program-prefix-before-env), $(run-program-env) and
	$(test-program-prefix-after-env).
	* malloc/tst-mtrace.sh: Use test_program_prefix_before_env,
	run_program_env and test_program_prefix_after_env arguments.
	* math/Makefile (run-regen-ulps): Use $(run-program-env).
	* nptl/Makefile ($(objpfx)tst-tls6.out): Use $(run-program-env).
	* nptl/tst-tls6.sh: Use run_program_env argument.  Set LANG=C
	explicitly with each use of ${test_wrapper_env}.
	* posix/Makefile ($(objpfx)wordexp-tst.out): Use
	$(test-program-prefix-before-env), $(run-program-env) and
	$(test-program-prefix-after-env).
	* posix/tst-getconf.sh: Do not set environment variables
	explicitly.
	* posix/wordexp-tst.sh: Use test_program_prefix_before_env,
	run_program_env and test_program_prefix_after_env arguments.
	* stdio-common/tst-printf.sh: Do not set environment variables
	explicitly.
	* stdlib/Makefile ($(objpfx)tst-fmtmsg.out): Use
	$(test-program-prefix-before-env), $(run-program-env) and
	$(test-program-prefix-after-env).
	* stdlib/tst-fmtmsg.sh: Use test_program_prefix_before_env,
	run_program_env and test_program_prefix_after_env arguments.
	Split $test calls into $test_pre and $test.
	* timezone/Makefile (build-testdata): Use
	$(built-program-cmd-before-env), $(run-program-env) and
	$(built-program-cmd-after-env).

localedata/ChangeLog:
	* Makefile ($(addprefix $(objpfx),$(CTYPE_FILES))): Use
	$(built-program-cmd-before-env), $(run-program-env) and
	$(built-program-cmd-after-env).
	($(objpfx)sort-test.out): Use $(test-program-prefix-before-env),
	$(run-program-env) and $(test-program-prefix-after-env).
	($(objpfx)tst-fmon.out): Use $(run-program-prefix-before-env),
	$(run-program-env) and $(run-program-prefix-after-env).
	($(objpfx)tst-locale.out): Use $(built-program-cmd-before-env),
	$(run-program-env) and $(built-program-cmd-after-env).
	($(objpfx)tst-trans.out): Use $(run-program-prefix-before-env),
	$(run-program-env), $(run-program-prefix-after-env),
	$(test-program-prefix-before-env) and
	$(test-program-prefix-after-env).
	($(objpfx)tst-ctype.out): Use $(test-program-cmd-before-env),
	$(run-program-env) and $(test-program-cmd-after-env).
	($(objpfx)tst-wctype.out): Likewise.
	($(objpfx)tst-langinfo.out): Likewise.
	($(objpfx)tst-langinfo-static.out): Likewise.
	* gen-locale.sh: Use localedef_before_env, run_program_env and
	localedef_after_env arguments.
	* sort-test.sh: Use test_program_prefix_before_env,
	run_program_env and test_program_prefix_after_env arguments.
	* tst-ctype.sh: Use tst_ctype_before_env, run_program_env and
	tst_ctype_after_env arguments.
	* tst-fmon.sh: Use run_program_prefix_before_env, run_program_env
	and run_program_prefix_after_env arguments.
	* tst-langinfo.sh: Use tst_langinfo_before_env, run_program_env
	and tst_langinfo_after_env arguments.
	* tst-locale.sh: Use localedef_before_env, run_program_env and
	localedef_after_env arguments.
	* tst-mbswcs.sh: Do not set environment variables explicitly.
	* tst-numeric.sh: Likewise.
	* tst-rpmatch.sh: Likewise.
	* tst-trans.sh: Use run_program_prefix_before_env,
	run_program_env, run_program_prefix_after_env,
	test_program_prefix_before_env and test_program_prefix_after_env
	arguments.
	* tst-wctype.sh: Use tst_wctype_before_env, run_program_env and
	tst_wctype_after_env arguments.
2014-06-06 22:19:27 +00:00
Allan McRae d4697bc93d Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
H.J. Lu 740b3dbee8 Add --enable-hardcoded-path-in-tests configure option 2013-01-11 07:14:18 -08:00
Joseph Myers 568035b787 Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
Dmitry V. Levin 57c69bef13 Set "fail on error" mode directly in testsuite shell scripts 2012-09-25 02:48:31 +00:00
Paul Eggert 59ba27a63a Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
Ulrich Drepper fff04b32af [BZ #2509]
2006-05-05  Jakub Jelinek  <jakub@redhat.com>
	[BZ #2509]
	* stdio-common/tst-printf.sh: Adjust for tst-printf.c change even
	on 32-bit arches.

2006-05-05  Ulrich Drepper  <drepper@redhat.com>

	* locale/programs/ld-address.c (address_finish): Fix one more
	place where the iso639 array might be access beyond the limits.
2006-05-05 13:37:35 +00:00
Ulrich Drepper d2dc7b0816 [BZ #2509]
* stdio-common/vfprintf.c (process_arg): Fix reading of signed
	short and byte values from parameter list.
	* stdio-common/tst-printf.c (main): Add more tests.
	* stdio-common/tst-printf.sh: Adjust for tst-printf.c change.
2006-05-02 20:28:05 +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 c06b947ef1 Update.
* stdio-common/tst-printf.c (main): Comment out one test which
	checked the compiler's ability to fold floating-point constants
	but not really printf.
	(rfg3): Make s const.
	* stdio-common/tst-printf.sh: Adjust for removed test.
2002-03-15 22:08:18 +00:00
Ulrich Drepper 351f0765c7 Update.
2002-03-13  Ulrich Drepper  <drepper@redhat.com>

	* stdio-common/tst-printf.sh: Adjust for last change in tst-printf.c.
2002-03-13 23:44:36 +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 1746f2b0a1 Update.
2001-02-27  Philip Blundell  <pb@futuretv.com>

	* elf/elf.h: Add new ARM definitions from latest (B-01)
	specification.  Correct naming of EF_ARM_ALIGN8 et al.

2001-03-04  Ulrich Drepper  <drepper@redhat.com>

	* stdio-common/tst-printf.sh: Remove bashisms.
	Patch by Matthew Clarke <Matthew_Clarke@mindlink.bc.ca>.

	* shlib-versions: Add entry for libanl.
2001-03-04 08:47:11 +00:00
Ulrich Drepper 655de5fdf2 Update.
2000-09-24  Ulrich Drepper  <drepper@redhat.com>

	* libio/genops.c (_IO_doallocbuf): Don't use single byte buffer if
	stream is in wide mode.

	* stdio-common/vfprintf.c (buffered_vfprintf): Orient stream.

2000-09-21  Bruno Haible  <haible@clisp.cons.org>

	* iconvdata/iso-2022-cn-ext.c (EMIT_SHIFT_TO_INIT): Shift __count
	by 3, not 2.
	(INIT_PARAMS, UPDATE_PARAMS): Likewise.

	handling.
	* stdio/tst-printf.sh: Adjust expected results.
	Reported by Joseph S. Myers <jsm28@cam.ac.uk>.
2000-09-25 05:12:05 +00:00
Ulrich Drepper 2a82441b16 Update.
* stdio-common/tst-printf.sh: Also allow output from 64-bit machines.
2000-09-14 22:42:29 +00:00
Andreas Jaeger 5cb798252f * stdio-common/Makefile ($(objpfx)tst-unbputc.out): Change parameter
according to changes in test program, run also with static only 
builds. 
($(objpfx)tst-printf.out): Likewise.
	* stdio-common/tst-unbputc.sh: Likewise.
	* stdio-common/tst-printf.sh: Likewise.
2000-07-25 10:06:51 +00:00
Ulrich Drepper 0755050e6d Update.
2000-07-07  Ulrich Drepper  <drepper@redhat.com>

	* stdio-common/Makefile (tests): Remove tst-printf here...
	(tests-srcs): ...and add it here.
	(distribute): Add tst-unbputc.sh and tst-printf.sh.
	Add rules to run tst-printf.sh.
	* stdio-common/tst-printf.c: Move code around so that there is really
	no further output where it's stated.
	* stdio-common/tst-printf.sh: New file.
2000-07-07 21:06:48 +00:00