about summary refs log tree commit diff
path: root/string
Commit message (Collapse)AuthorAgeFilesLines
* Split up rules for tests that compare output with baselines.Joseph Myers2014-02-141-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch splits makefile rules that generate a file then run cmp to check the contents of that file into separate rules to generate and compare the file. This simplifies making those tests generate PASS / FAIL results, by removing the need to insert && between commands in the test so that a $(evaluate-test) call is reached. It also avoids the oddity of the .out file being an intermediate file rather than the final result generated, as noted for some of these tests in <https://sourceware.org/ml/libc-alpha/2012-10/msg00894.html>. In many cases, the rule to run the program was no longer needed because the default rules for running test programs on the host to generate a .out file sufficed. (I'm not asserting the commands run after this patch are *exactly* the same as before, simply that the rules did nothing special that appeared deliberate or relevant to anything about what the tests were testing. In cases where the rules redirected stderr as well as stdout, I left the existing rule's redirection in place to avoid changing what gets compared with the expected results.) It's clear there is a lot in common between the various -cmp.out rules and it might be possible in future to refactor them into more generic support for the case of comparing test output against a baseline. (Some baselines are *.exp, some *.expect, some directly embedded in the makefiles, and nptl/tst-cleanupx0.expect appears unused.) Tested x86_64. * elf/Makefile ($(objpfx)order.out): Remove rule. [$(run-built-tests) = yes] (tests): Depend on $(objpfx)order-cmp.out. ($(objpfx)order-cmp.out): New rule. [$(run-built-tests) = yes] (tests): Depend on $(objpfx)tst-array1-cmp.out, $(objpfx)tst-array1-static-cmp.out, $(objpfx)tst-array2-cmp.out, $(objpfx)tst-array3-cmp.out, $(objpfx)tst-array4-cmp.out, $(objpfx)tst-array5-cmp.out and $(objpfx)tst-array5-static-cmp.out. ($(objpfx)tst-array1.out): Remove rule. ($(objpfx)tst-array1-cmp.out): New rule. ($(objpfx)tst-array1-static.out): Remove rule. ($(objpfx)tst-array1-static-cmp.out): New rule. ($(objpfx)tst-array2.out): Remove rule. ($(objpfx)tst-array2-cmp.out): New rule. ($(objpfx)tst-array3.out): Remove rule. ($(objpfx)tst-array3-cmp.out): New rule. ($(objpfx)tst-array4.out): Remove rule. ($(objpfx)tst-array4-cmp.out): New rule. ($(objpfx)tst-array5.out): Remove rule. ($(objpfx)tst-array5-cmp.out): New rule. ($(objpfx)tst-array5-static.out): Remove rule. ($(objpfx)tst-array5-static-cmp.out): New rule. [$(run-built-tests) = yes] (tests): Depend on $(objpfx)order2-cmp.out. ($(objpfx)order2.out): Remove rule. ($(objpfx)order2-cmp.out): New rule. ($(objpfx)tst-initorder.out): Remove rule. [$(run-built-tests) = yes] (tests): Depend on $(objpfx)tst-initorder-cmp.out. ($(objpfx)tst-initorder-cmp.out): New rule. ($(objpfx)tst-initorder2.out): Remove rule. [$(run-built-tests) = yes] (tests): Depend on $(objpfx)tst-initorder2-cmp.out. ($(objpfx)tst-initorder2-cmp.out): New rule. [$(run-built-tests) = yes] (tests): Depend on $(objpfx)tst-unused-dep-cmp.out. ($(objpfx)tst-unused-dep-cmp.out): Do not run cmp. ($(objpfx)tst-unused-dep-cmp.out): New rule. * stdio-common/Makefile [$(run-built-tests) = yes] (tests): Depend on $(objpfx)tst-setvbuf1-cmp.out. ($(objpfx)tst-setvbuf1.out): Do not run cmp. ($(objpfx)tst-setvbuf1-cmp.out): New rule. * string/Makefile [$(run-built-tests) = yes] (tests): Depend $(objpfx)tst-svc-cmp.out instead of $(objpfx)tst-svc.out. ($(objpfx)tst-svc.out): Remove rule. ($(objpfx)tst-svc-cmp.out): New rule. nptl: * Makefile ($(objpfx)tst-cleanup0.out): Do not run cmp. [$(run-built-tests) = yes] (tests): Depend on $(objpfx)tst-cleanup0-cmp.out. ($(objpfx)tst-cleanup0-cmp.out): New rule.
* Clean up trivially redundant __USE_MISC conditionals.Joseph Myers2014-02-132-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch cleans up cases of __USE_MISC that are trivially redundant after the recent substitution of __USE_MISC for __USE_BSD and __USE_SVID: either in constructs such as "defined __USE_MISC || defined __USE_MISC", or else (in the bits/mman.h case) a conditional on __USE_MISC nested inside another __USE_MISC conditional. (The cleanups remaining after this patch are still quite large, but it seems a reasonable piece to separate out.) Tested x86_64. * bits/mman.h [__USE_MISC]: Remove redundant conditionals. * ctype/ctype.h [__USE_MISC]: Likewise. * dirent/dirent.h [__USE_MISC]: Likewise. * grp/grp.h [__USE_MISC]: Likewise. * io/fcntl.h [__USE_MISC]: Likewise. * io/sys/stat.h [__USE_MISC]: Likewise. * libio/stdio.h [__USE_MISC]: Likewise. * posix/unistd.h [__USE_MISC]: Likewise. * pwd/pwd.h [__USE_MISC]: Likewise. * stdlib.h [__USE_MISC]: Likewise. * string/bits/string2.h [__USE_MISC]: Likewise. * string/string.h [__USE_MISC]: Likewise. * time/time.h [__USE_MISC]: Likewise.
* Combine __USE_BSD and __USE_SVID into __USE_MISC.Joseph Myers2014-02-125-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch cleans up following the obsoletion of _BSD_SOURCE and _SVID_SOURCE by combining __USE_BSD and __USE_SVID into __USE_MISC. The only non-mechanical part of this patch is the changes to features.h; everything else is simple substitution of __USE_MISC for the old macros. Thus, this patch leaves obviously redundant conditionals such as "defined __USE_MISC || defined __USE_MISC", and does not update #endif comments where they referred to BSD or SVID in words instead of the literal macro name. This is intended to facilitate patch review by separating the less mechanical changes from these purely mechanical changes into a separate patch. (I do intend to integrate all the changes from <https://sourceware.org/ml/libc-alpha/2013-12/msg00226.html>, which I believe includes all the trailing comment updates, in subsequent patches.) Tested x86_64. * include/features.h (__USE_BSD): Remove macro definitions. (__USE_SVID): Likewise. (_BSD_SOURCE): Likewise. (_SVID_SOURCE): Likewise. [!defined _BSD_SOURCE && !defined _SVID_SOURCE]: Remove condition from definition of _DEFAULT_SOURCE. [_BSD_SOURCE || _SVID_SOURCE]: Change condition to [_DEFAULT_SOURCE]. * bits/fcntl.h [__USE_BSD]: Change condition to [__USE_MISC]. * bits/mman.h [__USE_BSD]: Likewise. * bits/termios.h [__USE_BSD]: Likewise. * bits/waitstatus.h [__USE_BSD]: Likewise. * ctype/ctype.h [__USE_SVID]: Likewise. * dirent/dirent.h [__USE_BSD]: Likewise. * grp/grp.h [__USE_SVID]: Likewise. [__USE_BSD]: Likewise. * inet/netinet/igmp.h [__USE_BSD]: Likewise. * io/fcntl.h [__USE_BSD]: Likewise. * io/ftw.h [__USE_BSD]: Likewise. * io/sys/stat.h [__USE_BSD]: Likewise. * libio/bits/stdio-ldbl.h [__USE_BSD]: Likewise. * libio/bits/stdio2.h [__USE_BSD]: Likewise. * libio/stdio.h [__USE_SVID]: Likewise. [__USE_BSD]: Likewise. * math/math.h [__USE_SVID]: Likewise. [__USE_BSD]: Likewise. * misc/bits/syslog-ldbl.h [__USE_BSD]: Likewise. * misc/bits/syslog.h [__USE_BSD]: Likewise. * misc/search.h [__USE_SVID]: Likewise. * misc/sys/mman.h [__USE_BSD]: Likewise. * misc/sys/syslog.h [__USE_BSD]: Likewise. * misc/sys/uio.h [__USE_BSD]: Likewise. * posix/bits/unistd.h [__USE_BSD]: Likewise. * posix/glob.h [__USE_BSD]: Likewise. * posix/regex.h [__USE_BSD]: Likewise. * posix/sys/types.h [__USE_BSD]: Likewise. [__USE_SVID]: Likewise. * posix/sys/utsname.h [__USE_SVID]: Likewise. * posix/sys/wait.h [__USE_BSD]: Likewise. [__USE_SVID]: Likewise. * posix/unistd.h [__USE_BSD]: Likewise. [__USE_SVID]: Likewise. * pwd/pwd.h [__USE_SVID]: Likewise. * resolv/netdb.h [__USE_BSD]: Likewise. * setjmp/setjmp.h [__USE_BSD]: Likewise. * signal/signal.h [__USE_BSD]: Likewise. [__USE_SVID]: Likewise. * socket/sys/socket.h [__USE_BSD]: Likewise. * stdlib/fmtmsg.h [__USE_SVID]: Likewise. * stdlib/stdlib.h [__USE_BSD]: Likewise. [__USE_SVID]: Likewise. * string/bits/string2.h [__USE_BSD]: Likewise. [__USE_SVID]: Likewise. * string/bits/string3.h [__USE_BSD]: Likewise. * string/endian.h [__USE_BSD]: Likewise. * string/string.h [__USE_SVID]: Likewise. [__USE_BSD]: Likewise. * string/strings.h [__USE_BSD]: Likewise. * sysdeps/generic/netinet/ip.h [__USE_BSD]: Likewise. * sysdeps/gnu/netinet/ip_icmp.h [__USE_BSD]: Likewise. * sysdeps/mach/hurd/bits/fcntl.h [__USE_BSD]: Likewise. * sysdeps/mach/hurd/bits/stat.h [__USE_BSD]: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/mman.h [__USE_BSD]: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/termios.h [__USE_BSD]: Likewise. * sysdeps/unix/sysv/linux/bits/fcntl-linux.h [__USE_BSD]: Likewise. * sysdeps/unix/sysv/linux/bits/mman-linux.h [__USE_BSD]: Likewise. * sysdeps/unix/sysv/linux/bits/sys_errlist.h [__USE_BSD]: Likewise. * sysdeps/unix/sysv/linux/bits/termios.h [__USE_BSD]: Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios.h [__USE_BSD]: Likewise. * sysdeps/unix/sysv/linux/netinet/if_ether.h [__USE_BSD]: Likewise. * sysdeps/unix/sysv/linux/netinet/if_fddi.h [__USE_BSD]: Likewise. * sysdeps/unix/sysv/linux/netinet/if_tr.h [__USE_BSD]: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h [__USE_BSD]: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h [__USE_BSD]: Likewise. * sysdeps/x86/bits/string.h [__USE_BSD]: Likewise. * sysvipc/sys/ipc.h [__USE_SVID]: Likewise. * termios/termios.h [__USE_BSD]: Likewise. * time/sys/time.h [__USE_BSD]: Likewise. * time/time.h [__USE_BSD]: Likewise. [__USE_SVID]: Likewise. * sysdeps/unix/sysv/linux/hppa/bits/mman.h [__USE_BSD]: Change condition to [__USE_MISC].
* Use glibc_likely instead __builtin_expect.Ondřej Bílka2014-02-104-4/+4
|
* Update copyright notices with scripts/update-copyrightsAllan McRae2014-01-01121-121/+121
|
* Define __CORRECT_ISO_CPP_STRING_H_PROTO correctly for Clang.Brooks Moses2013-12-232-4/+12
| | | | | | | | | | | | | | | | | | | | | In the string/string.h and string/strings.h headers, we have a couple of macros that "tell the caller that we provide correct C++ prototypes" according to the comment; they are used to determine whether to wrap some prototypes in "extern "C++"" (and provide multiple overloads of them, and some other magic) when __cplusplus is defined. The macros are set to check for sufficiently-recent GCC versions (4.4 and later), but this is not the right check for non-GCC compilers. In particular, these macros should also be set when using Clang -- if they are not set, then Clang will be unable to correctly diagnose a number of subtle bugs that will be errors in GCC compilations. As per discussion on earlier versions of this patch, rather than restrict the fix to Clang per se, we assume that all C++ compilers that claim to fully support C++98 are using a standard-conforming C++ standard library, which seems pretty reasonable. Clang has been providing an appropriate value of __cplusplus since May 2012.
* PowerPC: multiarch wordcopy for PowerPC64Adhemerval Zanella2013-12-131-16/+20
|
* PowerPC: multirach memcmp for PowerPC64Adhemerval Zanella2013-12-131-1/+5
|
* PowerPC: multiarch strchrnul for PowerPC32Adhemerval Zanella2013-12-061-1/+5
|
* PowerPC: multiarch rawmemchr for PowerPC32Adhemerval Zanella2013-12-061-1/+4
|
* PowerPC: multiarch memchr for PowerPC32Adhemerval Zanella2013-12-061-1/+5
|
* PowerPC: multiarch mempcpy for PowerPC32Adhemerval Zanella2013-12-061-1/+5
|
* Remove duplicate ifunc tests.Ondřej Bílka2013-11-2634-645/+1
|
* Fix build on hurdSamuel Thibault2013-11-101-0/+1
| | | | * string/strcoll_l.c: Include <sys/param.h> for MIN/MAX macros.
* string/tester memrchr testAlan Modra2013-10-041-3/+3
| | | | | | | | | http://sourceware.org/ml/libc-alpha/2013-08/msg00095.html I found this useful at one stage when I was seeing a huge number of memrchr failures all of test number 10. * string/tester.c (test_memrchr): Increment reported test cycle.
* string/test-memcpy error reportingAlan Modra2013-10-041-2/+2
| | | | | | | | | | http://sourceware.org/ml/libc-alpha/2013-08/msg00094.html Using plain %s here runs the risk of segfaulting when displaying the string. src and dst aren't zero terminated strings. * string/test-memcpy.c (do_one_test): When reporting errors, print string address and don't overrun end of string.
* Check for integer overflow in cache size computation in strcollSiddhesh Poyarekar2013-09-233-1/+72
| | | | | | | | | | | strcoll is implemented using a cache for indices and weights of collation sequences in the strings so that subsequent passes do not have to search through collation data again. For very large string inputs, the cache size computation could overflow. In such a case, use the fallback function that does not cache indices and weights of collation sequences. Fixes CVE-2012-4412.
* Fall back to non-cached sequence traversal and comparison on malloc failSiddhesh Poyarekar2013-09-231-31/+234
| | | | | | | | strcoll currently falls back to alloca if malloc fails, resulting in a possible stack overflow. This patch implements sequence traversal and comparison without caching indices and rules. Fixes CVE-2012-4424.
* Make __ffs hiddenAndreas Schwab2013-09-201-0/+1
|
* Add memrchr testcaseAdhemerval Zanella2013-09-053-1/+190
|
* Fix missing declaration of LC_CTYPE nonascii-case elementAndreas Schwab2013-08-273-8/+48
|
* Simplify strcoll implementationSiddhesh Poyarekar2013-08-201-406/+295
| | | | | Break up strcoll into simpler functions so that the logic is easier to follow and maintain.
* Add a test for BZ #15674H.J. Lu2013-06-261-0/+24
|
* Fix loop construction to functions callsAdhemerval Zanella2013-06-204-0/+4
| | | | | | Check wheter the compiler has the option -fno-tree-loop-distribute-patterns to inhibit loop transformation to library calls and uses it on memset and memmove default implementation to avoid recursive calls.
* Remove performance-related bits from string testsSiddhesh Poyarekar2013-06-1125-620/+0
|
* Avoid use of "register" as optimization hint.Joseph Myers2013-06-075-22/+22
|
* Add copyright header to test-strchrnul.cSiddhesh Poyarekar2013-06-041-0/+19
|
* Add #include <stdint.h> for uint[32|64]_t usage (except installed headers).Ryan S. Arnold2013-05-161-1/+1
|
* Remove duplicate __strcmp_cgOndrej Bilka2013-05-011-24/+1
| | | | | The __strcmp_cg code was duplicate of of __strcmp_gc. This patch unifies these two cases into one.
* Sort Versions filesAndreas Jaeger2013-02-171-2/+2
|
* Remove bounded-pointers build system support.Joseph Myers2013-02-151-4/+0
|
* Remove miscellaneous bounded-pointers relics in C code.Joseph Myers2013-02-151-1/+1
|
* Remove bp-sym.h and BP_SYM uses from C code.Joseph Myers2013-02-141-6/+1
|
* Remove __ptrvalue, __bounded and __unbounded.Joseph Myers2013-02-131-1/+1
|
* Call memcpy in generic mempcpyOndrej Bilka2013-02-131-36/+2
|
* Fix typo, improve comment, remove superfluous #undefs, add missing #undef.Tom de Vries2013-02-121-5/+7
|
* Remove dead CFLAGS lines from string/MakefileTom de Vries2013-02-111-2/+0
|
* Remove dead variable in generic strcpy.Roland McGrath2013-02-081-3/+0
|
* Remove CHECK_BOUNDS_LOW and CHECK_BOUNDS_HIGH for C code.Joseph Myers2013-02-081-5/+2
|
* Remove lots of inline keywords.Roland McGrath2013-02-071-3/+0
|
* Remove __GLIBC_HAVE_LONG_LONG.Joseph Myers2013-01-112-15/+9
|
* Add --enable-hardcoded-path-in-tests configure optionH.J. Lu2013-01-111-1/+1
|
* Remove __GNUC__ conditions for "long long" from string.h and wchar.h.Joseph Myers2013-01-101-2/+0
|
* Update copyright notices with scripts/update-copyrights.Joseph Myers2013-01-02149-158/+149
|
* BZ#14317: Optimze __xpg_strerror_r2012-12-27 Bruno Haible2012-12-271-9/+15
| | | | | | [BZ #14317] * string/xpg-strerror.c (__xpg_strerror_r): Optimize, call strlen only if needed.
* Use memcpy in memmove when possibleMaxim Kuvyrkov2012-11-061-1/+5
|
* Define and use $(run-built-tests).Joseph Myers2012-10-241-1/+1
|
* Add string IFUNC testsH.J. Lu2012-10-1960-23/+709
|
* Add a testcase for BZ #14716H.J. Lu2012-10-191-3/+32
|
* Fix BZ #14716: memmem crashMaxim Kuvyrkov2012-10-151-2/+2
|