aboutsummaryrefslogtreecommitdiff
path: root/string
AgeCommit message (Collapse)AuthorFilesLines
2014-03-03PowerPC: strrchr optimization for POWER7/PPC64Rajalakshmi Srinivasaraghavan1-1/+5
This patch optimizes strrchr() for ppc64. It uses aligned memory access along with cmpb instruction and CPU prefetch to avoid cache misses for speed improvement.
2014-02-28Make strtok benchmark competive.Ondřej Bílka1-1/+5
We include a generic version of strtok to result which could be faster when underlying primitives are better optimized than current version.
2014-02-26Consistently include Makeconfig after defining subdir.Joseph Myers1-0/+2
In <https://sourceware.org/ml/libc-alpha/2014-01/msg00196.html> I noted it was necessary to add includes of Makeconfig early in various subdirectory makefiles for the tests-special variable settings added by that patch to be conditional on configuration information. No-one commented on the general question there of whether Makeconfig should always be included immediately after the definition of subdir. This patch implements that early inclusion of Makeconfig in each directory (which is a lot easier than consistent placement of includes of Rules). Includes are added if needed, or moved up if already present. Subdirectory "all:" targets are removed, since Makeconfig provides one. There is potential for further cleanups I haven't done. Rules and Makerules have code such as ifneq "$(findstring env,$(origin headers))" "" headers := endif to override to empty any value of various variables that came from the environment. I think there is a case for Makeconfig setting all the subdirectory variables (other than subdir) to empty to ensure no outside value is going to take effect if a subdirectory fails to define a variable. (A list of such variables, possibly out of date and incomplete, is in manual/maint.texi.) Rules and Makerules would give errors if Makeconfig hadn't already been included, instead of including it themselves. The special code to override values coming from the environment would then be obsolete and could be removed. Tested x86_64, including that installed binaries are identical before and after the patch. * argp/Makefile: Include Makeconfig immediately after defining subdir. * assert/Makefile: Likewise. * benchtests/Makefile: Likewise. * catgets/Makefile: Likewise. * conform/Makefile: Likewise. * crypt/Makefile: Likewise. * csu/Makefile: Likewise. (all): Remove target. * ctype/Makefile: Include Makeconfig immediately after defining subdir. * debug/Makefile: Likewise. * dirent/Makefile: Likewise. * dlfcn/Makefile: Likewise. * gmon/Makefile: Likewise. * gnulib/Makefile: Likewise. * grp/Makefile: Likewise. * gshadow/Makefile: Likewise. * hesiod/Makefile: Likewise. * hurd/Makefile: Likewise. (all): Remove target. * iconvdata/Makefile: Include Makeconfig immediately after defining subdir. * inet/Makefile: Likewise. * intl/Makefile: Likewise. * io/Makefile: Likewise. * libio/Makefile: Likewise. (all): Remove target. * locale/Makefile: Include Makeconfig immediately after defining subdir. * login/Makefile: Likewise. * mach/Makefile: Likewise. (all): Remove target. * malloc/Makefile: Include Makeconfig immediately after defining subdir. (all): Remove target. * manual/Makefile: Include Makeconfig immediately after defining subdir. * math/Makefile: Likewise. * misc/Makefile: Likewise. * nis/Makefile: Likewise. * nss/Makefile: Likewise. * po/Makefile: Likewise. (all): Remove target. * posix/Makefile: Include Makeconfig immediately after defining subdir. * pwd/Makefile: Likewise. * resolv/Makefile: Likewise. * resource/Makefile: Likewise. * rt/Makefile: Likewise. * setjmp/Makefile: Likewise. * shadow/Makefile: Likewise. * signal/Makefile: Likewise. * socket/Makefile: Likewise. * soft-fp/Makefile: Likewise. * stdio-common/Makefile: Likewise. * stdlib/Makefile: Likewise. * streams/Makefile: Likewise. * string/Makefile: Likewise. * sunrpc/Makefile: Likewise. (all): Remove target. * sysvipc/Makefile: Include Makeconfig immediately after defining subdir. * termios/Makefile: Likewise. * time/Makefile: Likewise. * timezone/Makefile: Likewise. (all): Remove target. * wcsmbs/Makefile: Include Makeconfig immediately after defining subdir. * wctype/Makefile: Likewise. libidn/ChangeLog: * Makefile: Include Makeconfig immediately after defining subdir. localedata/ChangeLog: * Makefile: Include Makeconfig immediately after defining subdir. (all): Remove target. nptl/ChangeLog: * Makefile: Include Makeconfig immediately after defining subdir. nptl_db/ChangeLog: * Makefile: Include Makeconfig immediately after defining subdir.
2014-02-21Generate .test-result files for tests with special rules.Joseph Myers1-1/+2
This patch, an updated version of <https://sourceware.org/ml/libc-alpha/2014-01/msg00194.html> now proposed for inclusion in glibc, extends the generation of PASS and FAIL status in .test-result files for individual tests to cover tests with their own custom makefile rules. This is just adding $(evaluate-test) calls to all such rules, since tests with multiple commands were previously split into separate tests. Note that the tests the makefiles expect to fail (posix/annexc and conformtest) currently get FAIL listed in the .test-result file, rather than XFAIL; a subsequent patch will introduce a better XFAIL mechanism. Tested x86_64. * Makefile ($(objpfx)c++-types-check.out): Use $(evaluate-test). ($(objpfx)check-local-headers.out): Likewise. ($(objpfx)begin-end-check.out): Likewise. * Makerules (check-abi-%.out): Likewise. * catgets/Makefile ($(objpfx)test1.cat): Likewise. ($(objpfx)test2.cat): Likewise. ($(objpfx)de/libc.cat): Likewise. ($(objpfx)test-gencat.out): Likewise. * conform/Makefile ($(objpfx)run-conformtest.out): Likewise. * elf/Makefile ($(objpfx)order-cmp.out): Likewise. ($(objpfx)noload-mem): Likewise. ($(objpfx)tst-pathopt.out): Likewise. ($(objpfx)tst-rtld-load-self.out): Likewise. ($(objpfx)tst-array1-cmp.out): Likewise. ($(objpfx)tst-array1-static-cmp.out): Likewise. ($(objpfx)tst-array2-cmp.out): Likewise. ($(objpfx)tst-array3-cmp.out): Likewise. ($(objpfx)tst-array4-cmp.out): Likewise. ($(objpfx)tst-array5-cmp.out): Likewise. ($(objpfx)tst-array5-static-cmp.out): Likewise. ($(objpfx)check-textrel.out): Likewise. ($(objpfx)check-execstack.out): Likewise. ($(objpfx)check-localplt.out): Likewise. ($(objpfx)order2-cmp.out): Likewise. ($(objpfx)tst-leaks1-mem): Likewise. ($(objpfx)tst-leaks1-static-mem): Likewise. ($(objpfx)tst-initorder-cmp.out): Likewise. ($(objpfx)tst-initorder2-cmp.out): Likewise. ($(objpfx)tst-unused-dep.out): Likewise. ($(objpfx)tst-unused-dep-cmp.out): Likewise. * grp/Makefile ($(objpfx)tst_fgetgrent.out): Likewise. * iconv/Makefile (test-iconvconfig): Likewise. * iconvdata/Makefile ($(objpfx)mtrace-tst-loading): Likewise. ($(objpfx)iconv-test.out): Likewise. ($(objpfx)tst-tables.out): Likewise. * intl/Makefile ($(objpfx)mtrace-tst-gettext): Likewise. ($(objpfx)tst-gettext.out): Likewise. ($(objpfx)tst-translit.out): Likewise. ($(objpfx)tst-gettext2.out): Likewise. ($(objpfx)tst-gettext4.out): Likewise. ($(objpfx)tst-gettext6.out): Likewise. * io/Makefile ($(objpfx)ftwtest.out): Likewise. * libio/Makefile ($(objpfx)test-freopen.out): Likewise. ($(objpfx)tst-fopenloc-cmp.out): Likewise. ($(objpfx)tst-fopenloc-mem.out): Likewise. * malloc/Makefile ($(objpfx)tst-mtrace.out): Likewise. * misc/Makefile ($(objpfx)tst-error1-mem): Likewise. * posix/Makefile ($(objpfx)globtest.out): Likewise. ($(objpfx)wordexp-tst.out): Likewise. ($(objpfx)annexc.out): Likewise. ($(objpfx)tst-fnmatch-mem): Likewise. ($(objpfx)bug-regex2-mem): Likewise. ($(objpfx)bug-regex14-mem): Likewise. ($(objpfx)bug-regex21-mem): Likewise. ($(objpfx)bug-regex31-mem): Likewise. ($(objpfx)tst-vfork3-mem): Likewise. ($(objpfx)tst-rxspencer-no-utf8-mem): Likewise. ($(objpfx)tst-pcre-mem): Likewise. ($(objpfx)tst-boost-mem): Likewise. ($(objpfx)tst-getconf.out): Likewise. ($(objpfx)bug-ga2-mem): Likewise. ($(objpfx)bug-glob2-mem): Likewise. * resolv/Makefile ($(objpfx)mtrace-tst-leaks): Likewise. ($(objpfx)mtrace-tst-leaks2): Likewise. * stdio-common/Makefile ($(objpfx)tst-unbputc.out): Likewise. ($(objpfx)tst-printf.out): Likewise. ($(objpfx)tst-setvbuf1.out): Likewise. ($(objpfx)tst-setvbuf1-cmp.out): Likewise. * stdlib/Makefile ($(objpfx)isomac.out): Likewise. ($(objpfx)tst-fmtmsg.out): Likewise. * string/Makefile ($(objpfx)tst-svc-cmp.out): Likewise. * sysdeps/x86/Makefile ($(objpfx)tst-xmmymm.out): Likewise. localedata: * Makefile ($(objpfx)sort-test.out): Use $(evaluate-test). ($(objpfx)tst-fmon.out): Likewise. ($(objpfx)tst-numeric.out): Likewise. ($(objpfx)tst-locale.out): Likewise. ($(objpfx)tst-rpmatch.out): Likewise. ($(objpfx)tst-trans.out): Likewise. ($(objpfx)tst-mbswcs.out): Likewise. ($(objpfx)tst-ctype.out): Likewise. ($(objpfx)tst-wctype.out): Likewise. ($(objpfx)tst-langinfo.out): Likewise. ($(objpfx)mtrace-tst-leaks): Likewise. nptl: * Makefile ($(objpfx)tst-stack3-mem): Use $(evaluate-test). ($(objpfx)tst-tls6.out): Likewise. ($(objpfx)tst-cleanup0.out): Likewise. ($(objpfx)tst-cleanup0-cmp.out): Likewise. ($(objpfx)tst-cancel-wrappers.out): Likewise. ($(objpfx)tst-oddstacklimit.out): Likewise. nptl_db: * Makefile ($(objpfx)db-symbols.out): Use $(evaluate-test).
2014-02-21Complete _BSD_SOURCE / _SVID_source followup cleanup.Joseph Myers2-7/+6
This patch completes the headers cleanup consequent on removal of _BSD_SOURCE and _SVID_SOURCE (apart from any subsequent deprecations): * #endif conditionals that referred to BSD or SVID are updated. * Redundant __USE_* tests in cases involving __USE_MISC are removed. This includes cases such as __USE_MISC || __USE_ISOC99, where __USE_MISC is redundant (because __USE_MISC is only ever defined in the default / _DEFAULT_SOURCE / _GNU_SOURCE case, when __USE_ISOC99 is also defined; the same applies to the non-XSI-extended POSIX versions), and cases involving __USE_GNU, where __USE_GNU is redundant (because if __USE_GNU is defined, so are the other __USE_* macros). There may well be other cases of __USE_FOO || __USE_BAR tests that could be simplified because one macro implies the other; this patch only addresses cases involving __USE_MISC. Tested x86_64. * bits/fcntl.h [__USE_MISC]: Remove redundant conditionals. * bits/sigaction.h [__USE_MISC]: Likewise. * bits/waitstatus.h: Update #endif comments. * ctype/ctype.h: Likewise. * dirent/dirent.h: Likewise. [__USE_MISC]: Remove redundant conditionals. * grp/grp.h: Update #endif comments. [__USE_GNU]: Remove redundant conditionals. [__USE_MISC]: Likewise. * inet/netinet/in.h [__USE_GNU]: Likewise. * io/sys/stat.h [__USE_MISC]: Likewise. * libio/bits/stdio-ldbl.h [__USE_MISC]: Likewise. * libio/bits/stdio.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * libio/bits/stdio2.h [__USE_MISC]: Likewise. * libio/stdio.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * math/bits/math-finite.h [__USE_MISC]: Likewise. * math/bits/mathcalls.h [__USE_MISC]: Likewise. * math/math.h: Update #else and #endif comments. [__USE_MISC]: Remove redundant conditionals. * misc/sys/uio.h: Update #endif comments. * posix/bits/unistd.h [__USE_MISC]: Remove redundant conditionals. * posix/glob.h [__USE_MISC]: Likewise. * posix/sys/types.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * posix/sys/wait.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * posix/unistd.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * pwd/pwd.h [__USE_GNU]: Likewise. [__USE_MISC]: Likewise. * resolv/netdb.h [__USE_GNU]: Likewise. * signal/signal.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * stdlib/stdlib.h: Update #else and #endif comments. [__USE_MISC]: Remove redundant conditionals. [__USE_GNU]: Likewise. * string/bits/string2.h [__USE_MISC]: Likewise. * string/string.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * sysdeps/m68k/m680x0/fpu/bits/mathinline.h [__USE_MISC]: Likewise. * sysdeps/mach/hurd/bits/fcntl.h [__USE_MISC]: Likewise. * sysdeps/mach/hurd/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/sigaction.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/bits/fcntl-linux.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * sysdeps/unix/sysv/linux/bits/in.h [__USE_GNU]: Likewise. * sysdeps/unix/sysv/linux/bits/sigaction.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/bits/socket.h [__USE_GNU]: Likewise. * sysdeps/unix/sysv/linux/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/ia64/bits/sigaction.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/m68k/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/mips/bits/sigaction.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/mips/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/s390/bits/sigaction.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/s390/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/sigaction.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/x86/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/x86/bits/string.h: Update #endif comments. * sysdeps/x86/fpu/bits/mathinline.h [__USE_MISC]: Remove redundant conditionals. * time/sys/time.h: Update #endif comments. * time/time.h: Likewise. [__USE_MISC]: Remove redundant conditionals.
2014-02-14Split up rules for tests that compare output with baselines.Joseph Myers1-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.
2014-02-13Clean up trivially redundant __USE_MISC conditionals.Joseph Myers2-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.
2014-02-12Combine __USE_BSD and __USE_SVID into __USE_MISC.Joseph Myers5-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].
2014-02-10Use glibc_likely instead __builtin_expect.Ondřej Bílka4-4/+4
2014-01-01Update copyright notices with scripts/update-copyrightsAllan McRae121-121/+121
2013-12-23Define __CORRECT_ISO_CPP_STRING_H_PROTO correctly for Clang.Brooks Moses2-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.
2013-12-13PowerPC: multiarch wordcopy for PowerPC64Adhemerval Zanella1-16/+20
2013-12-13PowerPC: multirach memcmp for PowerPC64Adhemerval Zanella1-1/+5
2013-12-06PowerPC: multiarch strchrnul for PowerPC32Adhemerval Zanella1-1/+5
2013-12-06PowerPC: multiarch rawmemchr for PowerPC32Adhemerval Zanella1-1/+4
2013-12-06PowerPC: multiarch memchr for PowerPC32Adhemerval Zanella1-1/+5
2013-12-06PowerPC: multiarch mempcpy for PowerPC32Adhemerval Zanella1-1/+5
2013-11-26Remove duplicate ifunc tests.Ondřej Bílka34-645/+1
2013-11-10Fix build on hurdSamuel Thibault1-0/+1
* string/strcoll_l.c: Include <sys/param.h> for MIN/MAX macros.
2013-10-04string/tester memrchr testAlan Modra1-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.
2013-10-04string/test-memcpy error reportingAlan Modra1-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.
2013-09-23Check for integer overflow in cache size computation in strcollSiddhesh Poyarekar3-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.
2013-09-23Fall back to non-cached sequence traversal and comparison on malloc failSiddhesh Poyarekar1-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.
2013-09-20Make __ffs hiddenAndreas Schwab1-0/+1
2013-09-05Add memrchr testcaseAdhemerval Zanella3-1/+190
2013-08-27Fix missing declaration of LC_CTYPE nonascii-case elementAndreas Schwab3-8/+48
2013-08-20Simplify strcoll implementationSiddhesh Poyarekar1-406/+295
Break up strcoll into simpler functions so that the logic is easier to follow and maintain.
2013-06-26Add a test for BZ #15674H.J. Lu1-0/+24
2013-06-20Fix loop construction to functions callsAdhemerval Zanella4-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.
2013-06-11Remove performance-related bits from string testsSiddhesh Poyarekar25-620/+0
2013-06-07Avoid use of "register" as optimization hint.Joseph Myers5-22/+22
2013-06-04Add copyright header to test-strchrnul.cSiddhesh Poyarekar1-0/+19
2013-05-16Add #include <stdint.h> for uint[32|64]_t usage (except installed headers).Ryan S. Arnold1-1/+1
2013-05-01Remove duplicate __strcmp_cgOndrej Bilka1-24/+1
The __strcmp_cg code was duplicate of of __strcmp_gc. This patch unifies these two cases into one.
2013-02-17Sort Versions filesAndreas Jaeger1-2/+2
2013-02-15Remove bounded-pointers build system support.Joseph Myers1-4/+0
2013-02-15Remove miscellaneous bounded-pointers relics in C code.Joseph Myers1-1/+1
2013-02-14Remove bp-sym.h and BP_SYM uses from C code.Joseph Myers1-6/+1
2013-02-13Remove __ptrvalue, __bounded and __unbounded.Joseph Myers1-1/+1
2013-02-13Call memcpy in generic mempcpyOndrej Bilka1-36/+2
2013-02-12Fix typo, improve comment, remove superfluous #undefs, add missing #undef.Tom de Vries1-5/+7
2013-02-11Remove dead CFLAGS lines from string/MakefileTom de Vries1-2/+0
2013-02-08Remove dead variable in generic strcpy.Roland McGrath1-3/+0
2013-02-08Remove CHECK_BOUNDS_LOW and CHECK_BOUNDS_HIGH for C code.Joseph Myers1-5/+2
2013-02-07Remove lots of inline keywords.Roland McGrath1-3/+0
2013-01-11Remove __GLIBC_HAVE_LONG_LONG.Joseph Myers2-15/+9
2013-01-11Add --enable-hardcoded-path-in-tests configure optionH.J. Lu1-1/+1
2013-01-10Remove __GNUC__ conditions for "long long" from string.h and wchar.h.Joseph Myers1-2/+0
2013-01-02Update copyright notices with scripts/update-copyrights.Joseph Myers149-158/+149
2012-12-27BZ#14317: Optimze __xpg_strerror_r2012-12-27 Bruno Haible1-9/+15
[BZ #14317] * string/xpg-strerror.c (__xpg_strerror_r): Optimize, call strlen only if needed.