2024-01-01 18:12:26 +00:00
|
|
|
# Copyright (C) 1995-2024 Free Software Foundation, Inc.
|
1996-02-08 10:00:34 +00:00
|
|
|
# This file is part of the GNU C Library.
|
|
|
|
|
|
|
|
# The GNU C Library is free software; you can redistribute it and/or
|
2001-07-06 04:58:11 +00:00
|
|
|
# modify it under the terms of the GNU Lesser General Public
|
|
|
|
# License as published by the Free Software Foundation; either
|
|
|
|
# version 2.1 of the License, or (at your option) any later version.
|
1996-02-08 10:00:34 +00:00
|
|
|
|
|
|
|
# The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2001-07-06 04:58:11 +00:00
|
|
|
# Lesser General Public License for more details.
|
1996-02-08 10:00:34 +00:00
|
|
|
|
2001-07-06 04:58:11 +00:00
|
|
|
# You should have received a copy of the GNU Lesser General Public
|
2012-02-09 23:18:22 +00:00
|
|
|
# License along with the GNU C Library; if not, see
|
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 05:40:42 +00:00
|
|
|
# <https://www.gnu.org/licenses/>.
|
1996-02-08 10:00:34 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Sub-makefile for wcsmbs portion of the library.
|
|
|
|
#
|
|
|
|
subdir := wcsmbs
|
|
|
|
|
2014-02-26 23:12:03 +00:00
|
|
|
include ../Makeconfig
|
|
|
|
|
2023-05-12 00:45:35 +00:00
|
|
|
headers := \
|
|
|
|
bits/types/__mbstate_t.h \
|
|
|
|
bits/types/mbstate_t.h \
|
|
|
|
bits/types/wint_t.h \
|
|
|
|
bits/wchar-ldbl.h \
|
|
|
|
bits/wchar.h \
|
|
|
|
bits/wchar2-decl.h \
|
|
|
|
bits/wchar2.h \
|
|
|
|
uchar.h \
|
|
|
|
wchar.h \
|
|
|
|
# headers
|
1996-02-08 10:00:34 +00:00
|
|
|
|
2023-04-17 13:41:08 +00:00
|
|
|
routines := \
|
|
|
|
btowc \
|
|
|
|
c16rtomb \
|
|
|
|
c32rtomb \
|
|
|
|
c8rtomb \
|
|
|
|
isoc23_fwscanf \
|
|
|
|
isoc23_swscanf \
|
|
|
|
isoc23_vfwscanf \
|
|
|
|
isoc23_vswscanf \
|
|
|
|
isoc23_vwscanf \
|
|
|
|
isoc23_wscanf \
|
|
|
|
isoc99_fwscanf \
|
|
|
|
isoc99_swscanf \
|
|
|
|
isoc99_vfwscanf \
|
|
|
|
isoc99_vswscanf \
|
|
|
|
isoc99_vwscanf \
|
|
|
|
isoc99_wscanf \
|
|
|
|
mbrlen \
|
2023-05-17 13:34:53 +00:00
|
|
|
mbrtoc8 \
|
2023-04-17 13:41:08 +00:00
|
|
|
mbrtoc16 \
|
|
|
|
mbrtoc32 \
|
|
|
|
mbrtowc \
|
|
|
|
mbsinit \
|
|
|
|
mbsnrtowcs \
|
|
|
|
mbsrtowcs \
|
|
|
|
mbsrtowcs_l \
|
|
|
|
wcpcpy \
|
|
|
|
wcpncpy \
|
|
|
|
wcrtomb \
|
|
|
|
wcscasecmp \
|
|
|
|
wcscasecmp_l \
|
|
|
|
wcscat \
|
|
|
|
wcschr \
|
|
|
|
wcschrnul \
|
|
|
|
wcscmp \
|
|
|
|
wcscoll \
|
|
|
|
wcscoll_l \
|
|
|
|
wcscpy \
|
|
|
|
wcscspn \
|
|
|
|
wcsdup \
|
2023-06-14 16:10:24 +00:00
|
|
|
wcslcat \
|
|
|
|
wcslcpy \
|
2023-04-17 13:41:08 +00:00
|
|
|
wcslen \
|
|
|
|
wcsmbsload \
|
|
|
|
wcsncase \
|
|
|
|
wcsncase_l \
|
|
|
|
wcsncat \
|
|
|
|
wcsncmp \
|
|
|
|
wcsncpy \
|
|
|
|
wcsnlen \
|
|
|
|
wcsnrtombs \
|
|
|
|
wcspbrk \
|
|
|
|
wcsrchr \
|
|
|
|
wcsrtombs \
|
|
|
|
wcsspn \
|
|
|
|
wcsstr \
|
|
|
|
wcstod \
|
|
|
|
wcstod_l \
|
|
|
|
wcstod_nan \
|
|
|
|
wcstof \
|
|
|
|
wcstof_l \
|
|
|
|
wcstof_nan \
|
|
|
|
wcstok \
|
|
|
|
wcstol \
|
|
|
|
wcstol_l \
|
|
|
|
wcstold \
|
|
|
|
wcstold_l \
|
|
|
|
wcstold_nan \
|
|
|
|
wcstoll \
|
|
|
|
wcstoll_l \
|
|
|
|
wcstoul \
|
|
|
|
wcstoul_l \
|
|
|
|
wcstoull \
|
|
|
|
wcstoull_l \
|
|
|
|
wcswidth \
|
|
|
|
wcsxfrm \
|
|
|
|
wcsxfrm_l \
|
|
|
|
wctob \
|
|
|
|
wcwidth \
|
|
|
|
wmemchr \
|
|
|
|
wmemcmp \
|
|
|
|
wmemcpy \
|
|
|
|
wmemmove \
|
|
|
|
wmempcpy \
|
|
|
|
wmemset \
|
|
|
|
# routines
|
1996-02-08 10:00:34 +00:00
|
|
|
|
2023-03-17 09:17:28 +00:00
|
|
|
# Exclude fortified routines from being built with _FORTIFY_SOURCE
|
|
|
|
routines_no_fortify += \
|
|
|
|
mbsnrtowcs \
|
|
|
|
mbsrtowcs \
|
|
|
|
wcpcpy \
|
|
|
|
wcpncpy \
|
|
|
|
wcrtomb \
|
|
|
|
wcscat \
|
|
|
|
wcscpy \
|
|
|
|
wcslcat \
|
|
|
|
wcslcpy \
|
|
|
|
wcsncat \
|
|
|
|
wcsncpy \
|
|
|
|
wcsnrtombs \
|
|
|
|
wcsrtombs \
|
|
|
|
wmemcpy \
|
|
|
|
wmemmove \
|
|
|
|
wmempcpy \
|
|
|
|
wmemset \
|
|
|
|
# routines_no_fortify
|
|
|
|
|
2023-04-17 13:41:08 +00:00
|
|
|
tests := \
|
|
|
|
test-c8rtomb \
|
|
|
|
test-char-types \
|
|
|
|
test-mbrtoc8 \
|
|
|
|
test-wcpcpy \
|
|
|
|
test-wcpncpy \
|
|
|
|
test-wcscat \
|
|
|
|
test-wcschr \
|
|
|
|
test-wcschrnul \
|
|
|
|
test-wcscmp \
|
|
|
|
test-wcscpy \
|
|
|
|
test-wcscspn \
|
2023-05-12 00:45:35 +00:00
|
|
|
test-wcsdup \
|
2023-04-17 13:41:08 +00:00
|
|
|
test-wcslen \
|
|
|
|
test-wcsncat \
|
|
|
|
test-wcsncmp \
|
|
|
|
test-wcsncpy \
|
|
|
|
test-wcsnlen \
|
|
|
|
test-wcspbrk \
|
|
|
|
test-wcsrchr \
|
|
|
|
test-wcsspn \
|
2024-03-19 13:15:27 +00:00
|
|
|
test-wcsstr \
|
2023-04-17 13:41:08 +00:00
|
|
|
test-wmemchr \
|
|
|
|
test-wmemcmp \
|
|
|
|
test-wmemset \
|
|
|
|
tst-btowc \
|
|
|
|
tst-c16-surrogate \
|
|
|
|
tst-c16c32-1 \
|
|
|
|
tst-c32-state \
|
|
|
|
tst-fgetwc-after-eof \
|
|
|
|
tst-mbrtowc \
|
|
|
|
tst-mbrtowc2 \
|
|
|
|
tst-mbsrtowcs \
|
|
|
|
tst-mbstowcs \
|
|
|
|
tst-wchar-h \
|
|
|
|
tst-wcpncpy \
|
|
|
|
tst-wcrtomb \
|
2023-06-14 16:10:24 +00:00
|
|
|
tst-wcslcat \
|
2023-07-27 23:20:49 +00:00
|
|
|
tst-wcslcat2 \
|
2023-06-14 16:10:24 +00:00
|
|
|
tst-wcslcpy \
|
2023-07-27 23:20:37 +00:00
|
|
|
tst-wcslcpy2 \
|
2023-04-17 13:41:08 +00:00
|
|
|
tst-wcsnlen \
|
|
|
|
tst-wcstod-nan-locale \
|
|
|
|
tst-wcstod-nan-sign \
|
|
|
|
tst-wcstod-round \
|
|
|
|
tst-wcstof \
|
|
|
|
tst-wcstol-binary-c11 \
|
2024-02-01 17:55:57 +00:00
|
|
|
tst-wcstol-binary-c23 \
|
2023-04-17 13:41:08 +00:00
|
|
|
tst-wcstol-binary-gnu11 \
|
2024-02-01 17:55:57 +00:00
|
|
|
tst-wcstol-binary-gnu23 \
|
2023-04-17 13:41:08 +00:00
|
|
|
tst-wcstol-locale \
|
|
|
|
tst-wprintf-binary \
|
2023-06-19 18:52:12 +00:00
|
|
|
tst-wprintf-intn \
|
2023-04-17 13:41:08 +00:00
|
|
|
tst-wscanf-binary-c11 \
|
2024-02-01 17:55:57 +00:00
|
|
|
tst-wscanf-binary-c23 \
|
2023-04-17 13:41:08 +00:00
|
|
|
tst-wscanf-binary-gnu11 \
|
|
|
|
tst-wscanf-binary-gnu89 \
|
2023-09-28 17:27:58 +00:00
|
|
|
tst-wscanf-intn \
|
2023-06-27 18:05:56 +00:00
|
|
|
tst-wscanf-to_inpunct \
|
2023-04-17 13:41:08 +00:00
|
|
|
wcsatcliff \
|
|
|
|
wcsmbs-tst1 \
|
|
|
|
# tests
|
Update.
1997-08-04 15:29 Ulrich Drepper <drepper@cygnus.com>
* locale/programs/localedef.c (main): Set bit in avail for those
categories which are successfully read.
* locale/programs/locfile.c (check_all_categories): Don't check
categories if they are not available.
(write_all_categories): Don't write categories if they are not
available.
* login/setutent_r.c (setutent_unknown): Change return type to
int and return result of called function.
* manual/arith.texi: Mark floating-point test macro from ISO C 9X
as macros (not functions).
* manual/libc.texinfo (UPDATED): Update.
* manual/math.texi: Document exceptions, functions to handle
exceptions, mathematical constants, FP comparison functions
and several new functions from ISO C 9X.
Change parameter of drand48, lrand48, and mrand48 to void (not
empty).
* manual/pattern.texi: Remove paragraph which explained that wordexp
is executed by running a shell.
* manual/time.texi: Explain difficulties with strftime if the
functions returns 0 and no error occurred.
* math/math.h: Correct comment for some M_* constants.
(isgreater, isgreaterequal, isless, islessequal, islessgreater,
inunordered): Rewrite to make sure the arguments are evaluated
exactly once.
* nis/rpcsvc/nis.x: Undo last change.
* nis/rpcsvc/nis.h: Likewise.
* nis/rpcsvc/nislib.h: File moved back to here.
* posix/sys/types.h: Don't define socklen_t. Pretty print.
* socket/sys/socket.h (bind, getsockname, connect, sendto, recvfrom,
getsockopt, setsockopt, accept): Change size argument to type
socklen_t.
Pretty print.
* manual/socket.texi: Describe socklen_t and change prototypes of
socket functions to use socklen_t.
* sysdeps/generic/bits/socket.h: Define socklen_t.
(struct msghdr): Correct types to use socklen_t.
* sysdeps/unix/sysv/linux/bits/socket.h: Likewise.
* sysdeps/unix/sysv/linux/mips/bits/socket.h: Likewise.
* stdio-common/printf_fp.c (__printf_fp): Correct rouding of number
1.0 < x < 8.0.
* stdio-common/tfformat.c: Add new tests for above bug.
* stdlib/strtod.c: Fix typo.
* string/Makefile (headers): Add bits/string.h.
(CFLAGS-*): Add -D__NO_STRING_INLINES.
* string/string.h: Include <bits/string.h> if optimizing and
__NO_STRING_INLINES is not defined.
* sysdeps/stub/bits/string.h: New file.
* sysdeps/powerpc/bits/fenv.h: Fix typos.
* sysdeps/unix/sysv/linux/if_index.c: Let functions return ENOSYS
if SIOGIFINDEX is not defined.
* sysdeps/wordsize-32/inttypes.h: Pretty print.
* sysdeps/wordsize-64/inttypes.h: Pretty print.
* termios/cfsetspeed.c: Rewrite loop to do what it shall do.
* wcsmbs/Makefile (tests): Add tst-wcstof.
* wcsmbs/tst-wcstof.c: New file.
1997-08-01 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/m68k/__longjmp.c: Replace call to abort by infinite
loop, to avoid dragging stdio into the dynamic linker.
1997-08-02 19:44 H.J. Lu <hjl@gnu.ai.mit.edu>
* nis/nis_findserv.c (xid, xid_seed, xid_lookup): Make them
u_int32_t.
1997-08-03 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* posix/wordexp.c (parse_tilde): Fix calls to __getpwnam_r and
__getpwuid_r.
Include <stdio.h> to get prototypes of *printf.
(exec_comm): Remove unneeded variable *sh.
* libc.map: Add wordexp, wordfree.
* posix/Makefile (routines): Add wordexp.
1997-08-03 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* posix/wordexp.c: Correct typo in comment.
(wordexp): Likewise.
* manual/errno.texi (Error Codes): Fix typo.
1997-08-03 15:28 Ulrich Drepper <drepper@cygnus.com>
* csu/initfini.c (SECTION): Don't put quotes around section name
since this is not understood by all assemblers.
Patch by Klaus Espenlaub <kespenla@hydra.informatik.uni-ulm.de>.
1997-08-04 14:31:26 +00:00
|
|
|
|
1996-02-08 10:00:34 +00:00
|
|
|
include ../Rules
|
Wed May 1 09:10:04 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* time/strftime.c: Use canonical autoconf nugget for time.h+sys/time.h
include.
Mon Apr 29 02:48:26 1996 Ulrich Drepper <drepper@cygnus.com>
* ctype/ctype-info.c: (__ctype_width): New variable.
(__ctype_names): Initialize correctly without offset.
* locale/C-collate.c, locale/C-ctype.c,
locale/C-messages.c, locale/C-monetary.c,
locale/C-numeric.c, locale/C-time.c: Change copyright.
* locale/C-ctype.c (_nl_C_LC_CTYPE_class32): Correct
endianess for initialization value.
* locale/lc-ctype.c (current): Add parameter for offset.
(__ctype32_b, __ctype_width): Add initialization for these
variables.
* locale/programs/charmap.c: Finish support for WIDTH information.
(new_width): New function.
* locale/programs/charset.h (width_rule): new data structure.
(charset_t): Add elements for width information.
* locale/programs/ld-ctype.c (locale_ctype_t): Add element
for width information.
(allocate_arrays): Add new argument for charset.
(ctype_finish): Make sure all characters named in charset
width table are known to name table.
(ctype_output): Correct handling of class and map name
information and write out width information.
(find_idx): Prepare for being called with NULL pointer as
TABLE argument. This means only allocate name entry.
(allocate_arrays): Correct handling of array element -1.
Because EOF == -1 the value of element 127 must *not* be
mirrored here.
Fill width information from charset tables.
* locale/programs/localedef.c (main): Correct loop over all
categories after change of order from Thu Mar 28 14:22:51 1996.
Add new charset argument to call of `write_all_categories'.
* locale/programs/locales.h (ctype_finish, ctype_output): New
charset argument.
* locale/programs/locfile.c (write_all_categories): Call
`ctype_output' with additional argument charset.
* posix/getconf.c (vars): Add _POSIX_SYNC_IO, _POSIX_ASYNC_IO,
and _POSIX_PRIO_IO definitions.
* posix/posix2_lim.h: Add definition of _POSIX2_CHARCLASS_NAME_MAX
and CHARCLASS_NAME_MAX.
* posix/unistd.h: Document _POSIX_SYNC_IO, _POSIX_ASYNC_IO,
and _POSIX_PRIO_IO.
* stdlib/grouping.h: Prepare for use in wide string functions.
* stdlib/stdlib.h: Correct prototypes for __strto*_internal
functions.
* stdlib/strtod.c: Extend for use as `wcsto{f,d,ld}'.
* stdlib/strtol.c: Extend for use as `wcsto{l,ul,q,uq}'.
* string/strcoll.c: Extend for use as `wcscoll'.
* string/strxfrm.c: Extend for use as `wcsxfrm'.
* sysdeps/generic/confname.h: Add definition of _PC_SYNC_IO,
_PC_ASYNC_IO, _PC_PRIO_IO and _SC_CHARCLASS_NAME_MAX.
* sysdeps/generic/stpncpy.c: Correct return value.
* sysdeps/posix/fpathconf.c: Add handling of _PC_SYNC_IO,
_PC_ASYNC_IO, and _PC_PRIO_IO.
* sysdeps/posix/sysconf.c: Add handling of _SC_REALTIME_SIGNALS,
_SC_PRIORITY_SCHEDULING, _SC_TIMERS, _SC_ASYNCHRONOUS_IO,
_SC_PRIORITIZED_IO, _SC_SYNCHRONIZED_IO, _SC_FSYNC,
_SC_MAPPED_FILES, _SC_MEMLOCK, _SC_MEMLOCK_RANGE,
_SC_MEMORY_PROTECTION, _SC_MESSAGE_PASSING, _SC_SEMAPHORES,
_SC_SHARED_MEMORY_OBJECTS, and _SC_CHARCLASS_NAME_MAX.
* sysdeps/stub/sysconf.c: Ditto.
* sysdeps/unix/sysv/sysv4/sysconf.c: Ditto.
* sysdeps/unix/sysv/linux/Dist: Add sys/sysctl.h.
* sysdeps/unix/sysv/linux/Makefile [subdir == misc]
(sysdep_routines): Add s_sysctl and sysctl.
* sysdeps/unix/sysv/linux/sys/mman.h: Add declaration of mremap.
* sysdeps/unix/sysv/linux/sys/socket.h: New file. Wrapper
around kernel header.
* sysdeps/unix/sysv/linux/sys/sysctl.h: New file. Define
interface to `sysctl' function.
* sysdeps/unix/sysv/linux/syscalls.list: Add mremap and _sysctl.
* sysdeps/unix/sysv/linux/sysconf.c: Add handling of
_SC_CHARCLASS_NAME_MAX.
* sysdeps/unix/sysv/linux/sysctl.c: new file. Implement caller
of _sysctl system call.
* sysvipc/Makefile (routines): Add ftok.
* sysvipc/ftok.c: use variable `proj_id' not `id'. Patch by
David Mosberger-Tang.
* wcsmbs/Makefile (routines): Add wcpcpy, wcpncpy, wcstol,
wcstoul, wcstoq, wcstouq, wcstod, wcstold, wcstof, wcscoll,
wcsxfrm, wcwidth, and wcswidth.
* wcsmbs/wchar.h: Add declarations for wcpcpy, wcpncpy, wcstol,
wcstoul, wcstoq, wcstouq, wcstod, wcstold, wcstof, wcscoll,
wcsxfrm, wcwidth, and wcswidth.
Declare internal interfaces for wcsto* functions.
[OPTIMIZE]: Define inline functions for wcsto* functions to
call internal interface functions.
* wcsmbs/wcpcpy.c, wcsmbs/wcpncpy.c: New files. Implement non-
standard function equivalent to stpcpy/stpncpy.
* wcsmbs/wcscoll.c: Implement `wcscoll' function by using
`strcoll' implementation.
* wcsmbs/wcscpy.c, wcsmbs/wcsncpy.c: Use wint_t instead of
wchar_t.
* wcsmbs/wcstod.c: Implement `wcstod' function by using `strtod'
implementation.
* wcsmbs/wcstof.c: Same for `wcstof'.
* wcsmbs/wcstold.c: Same for `strtold'.
* wcsmbs/wcstol.c: Implement `wcstol' function by using `strtol'
implementation.
* wcsmbs/wcstoq.c: Same for `wcstoq'.
* wcsmbs/wcstoul.c: Same for `wcstoul'.
* wcsmbs/wcstouq.c: Same for `wcstouq'.
* wcsmbs/wcswidth.c: Implement `wcswidth' function from X/Open
CAE.
* wcsmbs/wcwidth.c: Ditto for `wcwidth'.
* wcsmbs/wcwidth.h: Common function for definitions of above two
functions.
* wcsmbs/wcsxfrm.c: Implement `wcsxfrm function by using
`strxfrm implementation.
* wctype/wctype.c: Remove case for `wctype_t' being 16 bit type.
* wctype/wctype.h (wint_t): Protect against multiple definition.
(wctype_t): Always define as `unsigned long int'.
* wctype.h: New file. Wrapper around wctype/wctype.h.
* hurd/hurdstartup.c (_hurd_split_args): Function removed.
(_hurd_startup): Use argz functions.
* hurd/hurdexec.c: Use argz functions.
1996-05-01 13:55:18 +00:00
|
|
|
|
2015-10-12 10:24:41 +00:00
|
|
|
ifeq ($(run-built-tests),yes)
|
2023-05-12 00:45:35 +00:00
|
|
|
LOCALES := \
|
|
|
|
de_DE.ISO-8859-1 \
|
|
|
|
de_DE.UTF-8 \
|
|
|
|
en_US.ANSI_X3.4-1968 \
|
2023-06-27 18:05:56 +00:00
|
|
|
fa_IR.UTF-8 \
|
2023-05-12 00:45:35 +00:00
|
|
|
hr_HR.ISO-8859-2 \
|
|
|
|
ja_JP.EUC-JP \
|
|
|
|
tr_TR.ISO-8859-9 \
|
|
|
|
tr_TR.UTF-8 \
|
|
|
|
zh_HK.BIG5-HKSCS \
|
|
|
|
zh_TW.EUC-TW \
|
|
|
|
# LOCALES
|
2015-10-12 10:24:41 +00:00
|
|
|
include ../gen-locales.mk
|
|
|
|
|
|
|
|
$(objpfx)tst-btowc.out: $(gen-locales)
|
|
|
|
$(objpfx)tst-c16c32-1.out: $(gen-locales)
|
|
|
|
$(objpfx)tst-mbrtowc.out: $(gen-locales)
|
|
|
|
$(objpfx)tst-mbrtowc2.out: $(gen-locales)
|
|
|
|
$(objpfx)tst-wcrtomb.out: $(gen-locales)
|
|
|
|
$(objpfx)wcsmbs-tst1.out: $(gen-locales)
|
2015-11-23 08:50:53 +00:00
|
|
|
$(objpfx)tst-wcstol-locale.out: $(gen-locales)
|
2015-11-24 22:21:59 +00:00
|
|
|
$(objpfx)tst-wcstod-nan-locale.out: $(gen-locales)
|
2018-10-19 16:31:29 +00:00
|
|
|
$(objpfx)tst-c16-surrogate.out: $(gen-locales)
|
2018-10-22 14:52:14 +00:00
|
|
|
$(objpfx)tst-c32-state.out: $(gen-locales)
|
2022-07-29 17:50:56 +00:00
|
|
|
$(objpfx)test-c8rtomb.out: $(gen-locales)
|
|
|
|
$(objpfx)test-mbrtoc8.out: $(gen-locales)
|
2023-06-27 18:05:56 +00:00
|
|
|
$(objpfx)tst-wscanf-to_inpunct.out: $(gen-locales)
|
2015-10-12 10:24:41 +00:00
|
|
|
endif
|
|
|
|
|
2016-07-28 16:14:11 +00:00
|
|
|
$(objpfx)tst-wcstod-round: $(libm)
|
|
|
|
|
2017-12-11 21:11:16 +00:00
|
|
|
CFLAGS-wcwidth.c += -I../wctype
|
|
|
|
CFLAGS-wcswidth.c += -I../wctype
|
Wed May 1 09:10:04 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* time/strftime.c: Use canonical autoconf nugget for time.h+sys/time.h
include.
Mon Apr 29 02:48:26 1996 Ulrich Drepper <drepper@cygnus.com>
* ctype/ctype-info.c: (__ctype_width): New variable.
(__ctype_names): Initialize correctly without offset.
* locale/C-collate.c, locale/C-ctype.c,
locale/C-messages.c, locale/C-monetary.c,
locale/C-numeric.c, locale/C-time.c: Change copyright.
* locale/C-ctype.c (_nl_C_LC_CTYPE_class32): Correct
endianess for initialization value.
* locale/lc-ctype.c (current): Add parameter for offset.
(__ctype32_b, __ctype_width): Add initialization for these
variables.
* locale/programs/charmap.c: Finish support for WIDTH information.
(new_width): New function.
* locale/programs/charset.h (width_rule): new data structure.
(charset_t): Add elements for width information.
* locale/programs/ld-ctype.c (locale_ctype_t): Add element
for width information.
(allocate_arrays): Add new argument for charset.
(ctype_finish): Make sure all characters named in charset
width table are known to name table.
(ctype_output): Correct handling of class and map name
information and write out width information.
(find_idx): Prepare for being called with NULL pointer as
TABLE argument. This means only allocate name entry.
(allocate_arrays): Correct handling of array element -1.
Because EOF == -1 the value of element 127 must *not* be
mirrored here.
Fill width information from charset tables.
* locale/programs/localedef.c (main): Correct loop over all
categories after change of order from Thu Mar 28 14:22:51 1996.
Add new charset argument to call of `write_all_categories'.
* locale/programs/locales.h (ctype_finish, ctype_output): New
charset argument.
* locale/programs/locfile.c (write_all_categories): Call
`ctype_output' with additional argument charset.
* posix/getconf.c (vars): Add _POSIX_SYNC_IO, _POSIX_ASYNC_IO,
and _POSIX_PRIO_IO definitions.
* posix/posix2_lim.h: Add definition of _POSIX2_CHARCLASS_NAME_MAX
and CHARCLASS_NAME_MAX.
* posix/unistd.h: Document _POSIX_SYNC_IO, _POSIX_ASYNC_IO,
and _POSIX_PRIO_IO.
* stdlib/grouping.h: Prepare for use in wide string functions.
* stdlib/stdlib.h: Correct prototypes for __strto*_internal
functions.
* stdlib/strtod.c: Extend for use as `wcsto{f,d,ld}'.
* stdlib/strtol.c: Extend for use as `wcsto{l,ul,q,uq}'.
* string/strcoll.c: Extend for use as `wcscoll'.
* string/strxfrm.c: Extend for use as `wcsxfrm'.
* sysdeps/generic/confname.h: Add definition of _PC_SYNC_IO,
_PC_ASYNC_IO, _PC_PRIO_IO and _SC_CHARCLASS_NAME_MAX.
* sysdeps/generic/stpncpy.c: Correct return value.
* sysdeps/posix/fpathconf.c: Add handling of _PC_SYNC_IO,
_PC_ASYNC_IO, and _PC_PRIO_IO.
* sysdeps/posix/sysconf.c: Add handling of _SC_REALTIME_SIGNALS,
_SC_PRIORITY_SCHEDULING, _SC_TIMERS, _SC_ASYNCHRONOUS_IO,
_SC_PRIORITIZED_IO, _SC_SYNCHRONIZED_IO, _SC_FSYNC,
_SC_MAPPED_FILES, _SC_MEMLOCK, _SC_MEMLOCK_RANGE,
_SC_MEMORY_PROTECTION, _SC_MESSAGE_PASSING, _SC_SEMAPHORES,
_SC_SHARED_MEMORY_OBJECTS, and _SC_CHARCLASS_NAME_MAX.
* sysdeps/stub/sysconf.c: Ditto.
* sysdeps/unix/sysv/sysv4/sysconf.c: Ditto.
* sysdeps/unix/sysv/linux/Dist: Add sys/sysctl.h.
* sysdeps/unix/sysv/linux/Makefile [subdir == misc]
(sysdep_routines): Add s_sysctl and sysctl.
* sysdeps/unix/sysv/linux/sys/mman.h: Add declaration of mremap.
* sysdeps/unix/sysv/linux/sys/socket.h: New file. Wrapper
around kernel header.
* sysdeps/unix/sysv/linux/sys/sysctl.h: New file. Define
interface to `sysctl' function.
* sysdeps/unix/sysv/linux/syscalls.list: Add mremap and _sysctl.
* sysdeps/unix/sysv/linux/sysconf.c: Add handling of
_SC_CHARCLASS_NAME_MAX.
* sysdeps/unix/sysv/linux/sysctl.c: new file. Implement caller
of _sysctl system call.
* sysvipc/Makefile (routines): Add ftok.
* sysvipc/ftok.c: use variable `proj_id' not `id'. Patch by
David Mosberger-Tang.
* wcsmbs/Makefile (routines): Add wcpcpy, wcpncpy, wcstol,
wcstoul, wcstoq, wcstouq, wcstod, wcstold, wcstof, wcscoll,
wcsxfrm, wcwidth, and wcswidth.
* wcsmbs/wchar.h: Add declarations for wcpcpy, wcpncpy, wcstol,
wcstoul, wcstoq, wcstouq, wcstod, wcstold, wcstof, wcscoll,
wcsxfrm, wcwidth, and wcswidth.
Declare internal interfaces for wcsto* functions.
[OPTIMIZE]: Define inline functions for wcsto* functions to
call internal interface functions.
* wcsmbs/wcpcpy.c, wcsmbs/wcpncpy.c: New files. Implement non-
standard function equivalent to stpcpy/stpncpy.
* wcsmbs/wcscoll.c: Implement `wcscoll' function by using
`strcoll' implementation.
* wcsmbs/wcscpy.c, wcsmbs/wcsncpy.c: Use wint_t instead of
wchar_t.
* wcsmbs/wcstod.c: Implement `wcstod' function by using `strtod'
implementation.
* wcsmbs/wcstof.c: Same for `wcstof'.
* wcsmbs/wcstold.c: Same for `strtold'.
* wcsmbs/wcstol.c: Implement `wcstol' function by using `strtol'
implementation.
* wcsmbs/wcstoq.c: Same for `wcstoq'.
* wcsmbs/wcstoul.c: Same for `wcstoul'.
* wcsmbs/wcstouq.c: Same for `wcstouq'.
* wcsmbs/wcswidth.c: Implement `wcswidth' function from X/Open
CAE.
* wcsmbs/wcwidth.c: Ditto for `wcwidth'.
* wcsmbs/wcwidth.h: Common function for definitions of above two
functions.
* wcsmbs/wcsxfrm.c: Implement `wcsxfrm function by using
`strxfrm implementation.
* wctype/wctype.c: Remove case for `wctype_t' being 16 bit type.
* wctype/wctype.h (wint_t): Protect against multiple definition.
(wctype_t): Always define as `unsigned long int'.
* wctype.h: New file. Wrapper around wctype/wctype.h.
* hurd/hurdstartup.c (_hurd_split_args): Function removed.
(_hurd_startup): Use argz functions.
* hurd/hurdexec.c: Use argz functions.
1996-05-01 13:55:18 +00:00
|
|
|
|
2005-12-14 08:43:25 +00:00
|
|
|
strtox-CFLAGS = -I../include
|
2022-03-11 13:40:44 +00:00
|
|
|
CFLAGS-wcstol.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes)
|
|
|
|
CFLAGS-wcstoul.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes)
|
2017-12-11 21:11:16 +00:00
|
|
|
CFLAGS-wcstoll.c += $(strtox-CFLAGS)
|
|
|
|
CFLAGS-wcstoull.c += $(strtox-CFLAGS)
|
2022-03-11 13:40:44 +00:00
|
|
|
CFLAGS-wcstod.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes)
|
|
|
|
CFLAGS-wcstold.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes)
|
2017-12-11 21:11:16 +00:00
|
|
|
CFLAGS-wcstof128.c += $(strtox-CFLAGS)
|
2022-03-11 13:40:44 +00:00
|
|
|
CFLAGS-wcstof.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes)
|
2017-12-11 21:11:16 +00:00
|
|
|
CFLAGS-wcstol_l.c += $(strtox-CFLAGS)
|
|
|
|
CFLAGS-wcstoul_l.c += $(strtox-CFLAGS)
|
|
|
|
CFLAGS-wcstoll_l.c += $(strtox-CFLAGS)
|
|
|
|
CFLAGS-wcstoull_l.c += $(strtox-CFLAGS)
|
2022-03-11 13:40:44 +00:00
|
|
|
CFLAGS-wcstod_l.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes)
|
|
|
|
CFLAGS-wcstold_l.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes)
|
2017-12-11 21:11:16 +00:00
|
|
|
CFLAGS-wcstof128_l.c += $(strtox-CFLAGS)
|
2022-03-11 13:40:44 +00:00
|
|
|
CFLAGS-wcstof_l.c += $(strtox-CFLAGS) $(config-cflags-wno-ignored-attributes)
|
2023-03-17 09:17:28 +00:00
|
|
|
CPPFLAGS-tst-wchar-h.c += $(no-fortify-source),-D_FORTIFY_SOURCE=2
|
2000-09-06 22:15:07 +00:00
|
|
|
|
2022-03-11 13:40:44 +00:00
|
|
|
CFLAGS-wcschr.c += $(config-cflags-wno-ignored-attributes)
|
|
|
|
CFLAGS-wmemchr.c += $(config-cflags-wno-ignored-attributes)
|
|
|
|
CFLAGS-wmemset.c += $(config-cflags-wno-ignored-attributes)
|
|
|
|
CFLAGS-mbrtowc.c += $(config-cflags-wno-ignored-attributes)
|
|
|
|
CFLAGS-wcrtomb.c += $(config-cflags-wno-ignored-attributes)
|
|
|
|
CFLAGS-wcstoll.c += $(config-cflags-wno-ignored-attributes)
|
|
|
|
CFLAGS-wcstoull.c += $(config-cflags-wno-ignored-attributes)
|
|
|
|
|
2015-10-15 22:35:13 +00:00
|
|
|
CFLAGS-isoc99_wscanf.c += -fexceptions
|
|
|
|
CFLAGS-isoc99_fwscanf.c += -fexceptions
|
|
|
|
CFLAGS-isoc99_vwscanf.c += -fexceptions
|
|
|
|
CFLAGS-isoc99_vfwscanf.c += -fexceptions
|
2023-03-02 19:10:37 +00:00
|
|
|
CFLAGS-isoc23_wscanf.c += -fexceptions
|
|
|
|
CFLAGS-isoc23_fwscanf.c += -fexceptions
|
|
|
|
CFLAGS-isoc23_vwscanf.c += -fexceptions
|
|
|
|
CFLAGS-isoc23_vfwscanf.c += -fexceptions
|
2012-08-17 16:35:15 +00:00
|
|
|
|
|
|
|
CPPFLAGS += $(libio-mtsafe)
|
* include/stdio.h (__isoc99_fscanf, __isoc99_scanf,
__isoc99_sscanf, __isoc99_vscanf): New prototypes.
(__isoc99_vsscanf, __isoc99_vfscanf): New prototypes, add
libc_hidden_proto.
* include/wchar.h (__isoc99_fwscanf, __isoc99_wscanf,
__isoc99_swscanf, __isoc99_vwscanf): New prototypes.
(__isoc99_vswscanf, __isoc99_vfwscanf): New prototypes,
add libc_hidden_proto.
* libio/stdio.h (fscanf, scanf, sscanf, vfscanf, vscanf,
vsscanf): Redirect to __isoc99_* if strict ISO C99 or POSIX
conformance requested.
* wcsmbs/wchar.h (fwscanf, wscanf, swscanf, vfwscanf, vwscanf,
vswscanf): Redirect to __isoc99_* if strict ISO C99 or POSIX
conformance requested.
* libio/bits/stdio-ldbl.h (fscanf, scanf, sscanf, vfscanf, vscanf,
vsscanf): Redirect to __nldbl___isoc99_* if strict ISO C99 or POSIX
conformance requested.
* wcsmbs/bits/wchar-ldbl.h (fwscanf, wscanf, swscanf, vfwscanf,
vwscanf, vswscanf): Redirect to __nldbl___isoc99_* if strict
ISO C99 or POSIX conformance requested.
* stdio-common/Versions (libc): Export __isoc99_scanf@@GLIBC_2.7,
__isoc99_vscanf@@GLIBC_2.7, __isoc99_fscanf@@GLIBC_2.7,
__isoc99_vfscanf@@GLIBC_2.7, __isoc99_sscanf@@GLIBC_2.7
and __isoc99_vsscanf@@GLIBC_2.7.
* stdio-common/Makefile (routines): Add isoc99_scanf, isoc99_vscanf,
isoc99_fscanf, isoc99_vfscanf, isoc99_sscanf and isoc99_vsscanf.
(tests): Add scanf14.
(CFLAGS-vfprintf.c, CFLAGS-fprintf.c, CFLAGS-printf.c,
CFLAGS-vfwprintf.c, CFLAGS-vfscanf.c, CFLAGS-vfwscanf.c,
CFLAGS-fscanf.c, CFLAGS-scanf.c, CFLAGS-isoc99_vfscanf.c,
CFLAGS-isoc99_vscanf.c, CFLAGS-isoc99_fscanf.c,
CFLAGS-isoc99_scanf.c): Add $(exceptions).
(CFLAGS-scanf15.c): Add various -I paths to prevent the compiler
from using internal headers.
* wcsmbs/Versions (libc): Export __isoc99_wscanf@@GLIBC_2.7,
__isoc99_vwscanf@@GLIBC_2.7, __isoc99_fwscanf@@GLIBC_2.7,
__isoc99_vfwscanf@@GLIBC_2.7, __isoc99_swscanf@@GLIBC_2.7
and __isoc99_vswscanf@@GLIBC_2.7.
* wcsmbs/Makefile (routines): Add isoc99_wscanf, isoc99_vwscanf,
isoc99_fwscanf, isoc99_vfwscanf, isoc99_swscanf and isoc99_vswscanf.
(CFLAGS-isoc99_wscanf.c, CFLAGS-isoc99_fwscanf.c,
CFLAGS-isoc99_vwscanf.c, CFLAGS-isoc99_vfwscanf.c): Add $(exceptions).
(CPPFLAGS): Add -D_IO_MTSAFE_IO if needed.
* stdio-common/isoc99_scanf.c: New file.
* stdio-common/isoc99_vsscanf.c: New file.
* stdio-common/isoc99_vscanf.c: New file.
* stdio-common/isoc99_vfscanf.c: New file.
* stdio-common/isoc99_fscanf.c: New file.
* stdio-common/isoc99_sscanf.c: New file.
* wcsmbs/isoc99_fwscanf.c: New file.
* wcsmbs/isoc99_vswscanf.c: New file.
* wcsmbs/isoc99_swscanf.c: New file.
* wcsmbs/isoc99_wscanf.c: New file.
* wcsmbs/isoc99_vwscanf.c: New file.
* wcsmbs/isoc99_vfwscanf.c: New file.
* libio/libio.h (_IO_FLAGS2_SCANF_STD): Define.
* libio/libioP.h (_IO_acquire_lock_clear_flags2_fct): Also
clear _IO_FLAGS2_SCANF_STD bit from _flags2.
* stdio-common/vfscanf.c (_IO_vfscanf_internal): Don't
handle %as, %aS and %a[ if _IO_FLAGS2_SCANF_STD is set in _flags2.
* stdio-common/scanf14.c: New test.
* stdio-common/scanf15.c: New test.
* sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add
isoc99_scanf, isoc99_fscanf, isoc99_sscanf,
isoc99_vscanf, isoc99_vfscanf, isoc99_vsscanf,
isoc99_wscanf, isoc99_fwscanf, isoc99_swscanf,
isoc99_vwscanf, isoc99_vfwscanf and isoc99_vswscanf.
* sysdeps/ieee754/ldbl-opt/Versions (libc): Export
__nldbl___isoc99_scanf@@GLIBC_2.7,
__nldbl___isoc99_fscanf@@GLIBC_2.7,
__nldbl___isoc99_sscanf@@GLIBC_2.7,
__nldbl___isoc99_vscanf@@GLIBC_2.7,
__nldbl___isoc99_vfscanf@@GLIBC_2.7,
__nldbl___isoc99_vsscanf@@GLIBC_2.7,
__nldbl___isoc99_wscanf@@GLIBC_2.7,
__nldbl___isoc99_fwscanf@@GLIBC_2.7,
__nldbl___isoc99_swscanf@@GLIBC_2.7,
__nldbl___isoc99_vwscanf@@GLIBC_2.7,
__nldbl___isoc99_vfwscanf@@GLIBC_2.7
and __nldbl___isoc99_vswscanf@@GLIBC_2.7.
* sysdeps/ieee754/ldbl-opt/nldbl-compat.h (__isoc99_scanf,
__isoc99_fscanf, __isoc99_sscanf, __isoc99_vscanf,
__isoc99_vfscanf, __isoc99_vsscanf, __isoc99_wscanf,
__isoc99_fwscanf, __isoc99_swscanf, __isoc99_vwscanf,
__isoc99_vfwscanf, __isoc99_vswscanf): Add NLDBL_DECL.
* sysdeps/ieee754/ldbl-opt/nldbl-compat.c
(__nldbl___isoc99_scanf, __nldbl___isoc99_fscanf,
__nldbl___isoc99_sscanf, __nldbl___isoc99_vscanf,
__nldbl___isoc99_vfscanf, __nldbl___isoc99_vsscanf,
__nldbl___isoc99_wscanf, __nldbl___isoc99_fwscanf,
__nldbl___isoc99_swscanf, __nldbl___isoc99_vwscanf,
__nldbl___isoc99_vfwscanf, __nldbl___isoc99_vswscanf): New
functions.
* sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vfscanf.c: New file.
* sysdeps/ieee754/ldbl-opt/nldbl-isoc99_swscanf.c: New file.
* sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vwscanf.c: New file.
* sysdeps/ieee754/ldbl-opt/nldbl-isoc99_wscanf.c: New file.
* sysdeps/ieee754/ldbl-opt/nldbl-isoc99_scanf.c: New file.
* sysdeps/ieee754/ldbl-opt/nldbl-isoc99_sscanf.c: New file.
* sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vsscanf.c: New file.
* sysdeps/ieee754/ldbl-opt/nldbl-isoc99_fwscanf.c: New file.
* sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vfwscanf.c: New file.
* sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vswscanf.c: New file.
* sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vscanf.c: New file.
* sysdeps/ieee754/ldbl-opt/nldbl-isoc99_fscanf.c: New file.
* stdio-common/Makefile (tests): Add scanf13.
(scanf13-ENV): New.
* stdio-common/vfscanf.c (_IO_vfscanf_internal): Handle
m modifier followed by l.
(STRING_ARG): Add width argument.
(_IO_vfscanf_internal) <case L_('c')>: Handle %mc.
<case L_('C')>: Handle %mlc and %mC.
<case L_('s'), case L_('S'), case L_('[')>: Adjust STRING_ARG
arguments.
* stdio-common/scanf13.c: New test.
* libio/libioP.h (_IO_acquire_lock_clear_flags2_fct): Clear
the _IO_FLAGS2_FORTIFY bit from _flags2 rather than _flags.
type and __THROW marker of splice, vmsplice, and tee.
2007-09-18 19:04:01 +00:00
|
|
|
|
2005-12-14 08:43:25 +00:00
|
|
|
# We need to find the default version of strtold_l in stdlib.
|
2017-12-11 21:11:16 +00:00
|
|
|
CPPFLAGS-wcstold_l.c += -I../stdlib
|
2015-11-24 22:21:59 +00:00
|
|
|
|
|
|
|
$(objpfx)tst-wcstod-nan-locale: $(libm)
|
2018-06-15 17:36:21 +00:00
|
|
|
$(objpfx)tst-wcstod-nan-sign: $(libm)
|
C2x strtol binary constant handling
C2x adds binary integer constants starting with 0b or 0B, and supports
those constants in strtol-family functions when the base passed is 0
or 2. Implement that strtol support for glibc.
As discussed at
<https://sourceware.org/pipermail/libc-alpha/2020-December/120414.html>,
this is incompatible with previous C standard versions, in that such
an input string starting with 0b or 0B was previously required to be
parsed as 0 (with the rest of the string unprocessed). Thus, as
proposed there, this patch adds 20 new __isoc23_* functions with
appropriate header redirection support. This patch does *not* do
anything about scanf %i (which will need 12 new functions per long
double variant, so 12, 24 or 36 depending on the glibc configuration),
instead leaving that for a future patch. The function names would
remain as __isoc23_* even if C2x ends up published in 2024 rather than
2023.
Making this change leads to the question of what should happen to
internal uses of these functions in glibc and its tests. The header
redirection (which applies for _GNU_SOURCE or any other feature test
macros enabling C2x features) has the effect of redirecting internal
uses but without those uses then ending up at a hidden alias (see the
comment in include/stdio.h about interaction with libc_hidden_proto).
It seems desirable for the default for internal uses to be the same
versions used by normal code using _GNU_SOURCE, so rather than doing
anything to disable that redirection, similar macro definitions to
those in include/stdio.h are added to the include/ headers for the new
functions.
Given that the default for uses in glibc is for the redirections to
apply, the next question is whether the C2x semantics are correct for
all those uses. Uses with the base fixed to 10, 16 or any other value
other than 0 or 2 can be ignored. I think this leaves the following
internal uses to consider (an important consideration for review of
this patch will be both whether this list is complete and whether my
conclusions on all entries in it are correct):
benchtests/bench-malloc-simple.c
benchtests/bench-string.h
elf/sotruss-lib.c
math/libm-test-support.c
nptl/perf.c
nscd/nscd_conf.c
nss/nss_files/files-parse.c
posix/tst-fnmatch.c
posix/wordexp.c
resolv/inet_addr.c
rt/tst-mqueue7.c
soft-fp/testit.c
stdlib/fmtmsg.c
support/support_test_main.c
support/test-container.c
sysdeps/pthread/tst-mutex10.c
I think all of these places are OK with the new semantics, except for
resolv/inet_addr.c, where the POSIX semantics of inet_addr do not
allow for binary constants; thus, I changed that file (to use
__strtoul_internal, whose semantics are unchanged) and added a test
for this case. In the case of posix/wordexp.c I think accepting
binary constants is OK since POSIX explicitly allows additional forms
of shell arithmetic expressions, and in stdlib/fmtmsg.c SEV_LEVEL is
not in POSIX so again I think accepting binary constants is OK.
Functions such as __strtol_internal, which are only exported for
compatibility with old binaries from when those were used in inline
functions in headers, have unchanged semantics; the __*_l_internal
versions (purely internal to libc and not exported) have a new
argument to specify whether to accept binary constants.
As well as for the standard functions, the header redirection also
applies to the *_l versions (GNU extensions), and to legacy functions
such as strtoq, to avoid confusing inconsistency (the *q functions
redirect to __isoc23_*ll rather than needing their own __isoc23_*
entry points). For the functions that are only declared with
_GNU_SOURCE, this means the old versions are no longer available for
normal user programs at all. An internal __GLIBC_USE_C2X_STRTOL macro
is used to control the redirections in the headers, and cases in glibc
that wish to avoid the redirections - the function implementations
themselves and the tests of the old versions of the GNU functions -
then undefine and redefine that macro to allow the old versions to be
accessed. (There would of course be greater complexity should we wish
to make any of the old versions into compat symbols / avoid them being
defined at all for new glibc ABIs.)
strtol_l.c has some similarity to strtol.c in gnulib, but has already
diverged some way (and isn't listed at all at
https://sourceware.org/glibc/wiki/SharedSourceFiles unlike strtoll.c
and strtoul.c); I haven't made any attempts at gnulib compatibility in
the changes to that file.
I note incidentally that inttypes.h and wchar.h are missing the
__nonnull present on declarations of this family of functions in
stdlib.h; I didn't make any changes in that regard for the new
declarations added.
2023-02-16 23:02:40 +00:00
|
|
|
|
2024-02-01 11:02:01 +00:00
|
|
|
# Some versions of GCC supported for building glibc do not support -std=c23
|
|
|
|
# or -std=gnu23 (added in GCC 14), or the older names -std=c2x or -std=gnu2x
|
|
|
|
# (added in GCC 9), so the tests for those versions use -std=c11 and -std=gnu11
|
|
|
|
# and then _ISOC23_SOURCE is defined in the test as needed.
|
C2x strtol binary constant handling
C2x adds binary integer constants starting with 0b or 0B, and supports
those constants in strtol-family functions when the base passed is 0
or 2. Implement that strtol support for glibc.
As discussed at
<https://sourceware.org/pipermail/libc-alpha/2020-December/120414.html>,
this is incompatible with previous C standard versions, in that such
an input string starting with 0b or 0B was previously required to be
parsed as 0 (with the rest of the string unprocessed). Thus, as
proposed there, this patch adds 20 new __isoc23_* functions with
appropriate header redirection support. This patch does *not* do
anything about scanf %i (which will need 12 new functions per long
double variant, so 12, 24 or 36 depending on the glibc configuration),
instead leaving that for a future patch. The function names would
remain as __isoc23_* even if C2x ends up published in 2024 rather than
2023.
Making this change leads to the question of what should happen to
internal uses of these functions in glibc and its tests. The header
redirection (which applies for _GNU_SOURCE or any other feature test
macros enabling C2x features) has the effect of redirecting internal
uses but without those uses then ending up at a hidden alias (see the
comment in include/stdio.h about interaction with libc_hidden_proto).
It seems desirable for the default for internal uses to be the same
versions used by normal code using _GNU_SOURCE, so rather than doing
anything to disable that redirection, similar macro definitions to
those in include/stdio.h are added to the include/ headers for the new
functions.
Given that the default for uses in glibc is for the redirections to
apply, the next question is whether the C2x semantics are correct for
all those uses. Uses with the base fixed to 10, 16 or any other value
other than 0 or 2 can be ignored. I think this leaves the following
internal uses to consider (an important consideration for review of
this patch will be both whether this list is complete and whether my
conclusions on all entries in it are correct):
benchtests/bench-malloc-simple.c
benchtests/bench-string.h
elf/sotruss-lib.c
math/libm-test-support.c
nptl/perf.c
nscd/nscd_conf.c
nss/nss_files/files-parse.c
posix/tst-fnmatch.c
posix/wordexp.c
resolv/inet_addr.c
rt/tst-mqueue7.c
soft-fp/testit.c
stdlib/fmtmsg.c
support/support_test_main.c
support/test-container.c
sysdeps/pthread/tst-mutex10.c
I think all of these places are OK with the new semantics, except for
resolv/inet_addr.c, where the POSIX semantics of inet_addr do not
allow for binary constants; thus, I changed that file (to use
__strtoul_internal, whose semantics are unchanged) and added a test
for this case. In the case of posix/wordexp.c I think accepting
binary constants is OK since POSIX explicitly allows additional forms
of shell arithmetic expressions, and in stdlib/fmtmsg.c SEV_LEVEL is
not in POSIX so again I think accepting binary constants is OK.
Functions such as __strtol_internal, which are only exported for
compatibility with old binaries from when those were used in inline
functions in headers, have unchanged semantics; the __*_l_internal
versions (purely internal to libc and not exported) have a new
argument to specify whether to accept binary constants.
As well as for the standard functions, the header redirection also
applies to the *_l versions (GNU extensions), and to legacy functions
such as strtoq, to avoid confusing inconsistency (the *q functions
redirect to __isoc23_*ll rather than needing their own __isoc23_*
entry points). For the functions that are only declared with
_GNU_SOURCE, this means the old versions are no longer available for
normal user programs at all. An internal __GLIBC_USE_C2X_STRTOL macro
is used to control the redirections in the headers, and cases in glibc
that wish to avoid the redirections - the function implementations
themselves and the tests of the old versions of the GNU functions -
then undefine and redefine that macro to allow the old versions to be
accessed. (There would of course be greater complexity should we wish
to make any of the old versions into compat symbols / avoid them being
defined at all for new glibc ABIs.)
strtol_l.c has some similarity to strtol.c in gnulib, but has already
diverged some way (and isn't listed at all at
https://sourceware.org/glibc/wiki/SharedSourceFiles unlike strtoll.c
and strtoul.c); I haven't made any attempts at gnulib compatibility in
the changes to that file.
I note incidentally that inttypes.h and wchar.h are missing the
__nonnull present on declarations of this family of functions in
stdlib.h; I didn't make any changes in that regard for the new
declarations added.
2023-02-16 23:02:40 +00:00
|
|
|
CFLAGS-tst-wcstol-binary-c11.c += -std=c11
|
2024-02-01 17:55:57 +00:00
|
|
|
CFLAGS-tst-wcstol-binary-c23.c += -std=c11
|
C2x strtol binary constant handling
C2x adds binary integer constants starting with 0b or 0B, and supports
those constants in strtol-family functions when the base passed is 0
or 2. Implement that strtol support for glibc.
As discussed at
<https://sourceware.org/pipermail/libc-alpha/2020-December/120414.html>,
this is incompatible with previous C standard versions, in that such
an input string starting with 0b or 0B was previously required to be
parsed as 0 (with the rest of the string unprocessed). Thus, as
proposed there, this patch adds 20 new __isoc23_* functions with
appropriate header redirection support. This patch does *not* do
anything about scanf %i (which will need 12 new functions per long
double variant, so 12, 24 or 36 depending on the glibc configuration),
instead leaving that for a future patch. The function names would
remain as __isoc23_* even if C2x ends up published in 2024 rather than
2023.
Making this change leads to the question of what should happen to
internal uses of these functions in glibc and its tests. The header
redirection (which applies for _GNU_SOURCE or any other feature test
macros enabling C2x features) has the effect of redirecting internal
uses but without those uses then ending up at a hidden alias (see the
comment in include/stdio.h about interaction with libc_hidden_proto).
It seems desirable for the default for internal uses to be the same
versions used by normal code using _GNU_SOURCE, so rather than doing
anything to disable that redirection, similar macro definitions to
those in include/stdio.h are added to the include/ headers for the new
functions.
Given that the default for uses in glibc is for the redirections to
apply, the next question is whether the C2x semantics are correct for
all those uses. Uses with the base fixed to 10, 16 or any other value
other than 0 or 2 can be ignored. I think this leaves the following
internal uses to consider (an important consideration for review of
this patch will be both whether this list is complete and whether my
conclusions on all entries in it are correct):
benchtests/bench-malloc-simple.c
benchtests/bench-string.h
elf/sotruss-lib.c
math/libm-test-support.c
nptl/perf.c
nscd/nscd_conf.c
nss/nss_files/files-parse.c
posix/tst-fnmatch.c
posix/wordexp.c
resolv/inet_addr.c
rt/tst-mqueue7.c
soft-fp/testit.c
stdlib/fmtmsg.c
support/support_test_main.c
support/test-container.c
sysdeps/pthread/tst-mutex10.c
I think all of these places are OK with the new semantics, except for
resolv/inet_addr.c, where the POSIX semantics of inet_addr do not
allow for binary constants; thus, I changed that file (to use
__strtoul_internal, whose semantics are unchanged) and added a test
for this case. In the case of posix/wordexp.c I think accepting
binary constants is OK since POSIX explicitly allows additional forms
of shell arithmetic expressions, and in stdlib/fmtmsg.c SEV_LEVEL is
not in POSIX so again I think accepting binary constants is OK.
Functions such as __strtol_internal, which are only exported for
compatibility with old binaries from when those were used in inline
functions in headers, have unchanged semantics; the __*_l_internal
versions (purely internal to libc and not exported) have a new
argument to specify whether to accept binary constants.
As well as for the standard functions, the header redirection also
applies to the *_l versions (GNU extensions), and to legacy functions
such as strtoq, to avoid confusing inconsistency (the *q functions
redirect to __isoc23_*ll rather than needing their own __isoc23_*
entry points). For the functions that are only declared with
_GNU_SOURCE, this means the old versions are no longer available for
normal user programs at all. An internal __GLIBC_USE_C2X_STRTOL macro
is used to control the redirections in the headers, and cases in glibc
that wish to avoid the redirections - the function implementations
themselves and the tests of the old versions of the GNU functions -
then undefine and redefine that macro to allow the old versions to be
accessed. (There would of course be greater complexity should we wish
to make any of the old versions into compat symbols / avoid them being
defined at all for new glibc ABIs.)
strtol_l.c has some similarity to strtol.c in gnulib, but has already
diverged some way (and isn't listed at all at
https://sourceware.org/glibc/wiki/SharedSourceFiles unlike strtoll.c
and strtoul.c); I haven't made any attempts at gnulib compatibility in
the changes to that file.
I note incidentally that inttypes.h and wchar.h are missing the
__nonnull present on declarations of this family of functions in
stdlib.h; I didn't make any changes in that regard for the new
declarations added.
2023-02-16 23:02:40 +00:00
|
|
|
CFLAGS-tst-wcstol-binary-gnu11.c += -std=gnu11
|
2024-02-01 17:55:57 +00:00
|
|
|
CFLAGS-tst-wcstol-binary-gnu23.c += -std=gnu11
|
2023-03-02 19:10:37 +00:00
|
|
|
CFLAGS-tst-wscanf-binary-c11.c += -std=c11 -DOBJPFX=\"$(objpfx)\"
|
2024-02-01 17:55:57 +00:00
|
|
|
CFLAGS-tst-wscanf-binary-c23.c += -std=c11 -DOBJPFX=\"$(objpfx)\"
|
2023-03-02 19:10:37 +00:00
|
|
|
CFLAGS-tst-wscanf-binary-gnu11.c += -std=gnu11 -DOBJPFX=\"$(objpfx)\"
|
|
|
|
CFLAGS-tst-wscanf-binary-gnu89.c += -std=gnu89 -DOBJPFX=\"$(objpfx)\"
|