about summary refs log tree commit diff
path: root/conform/data/wchar.h-data
Commit message (Collapse)AuthorAgeFilesLines
* Don’t rely on stddef.h or stdarg.h for individual type definitions.Zack Weinberg2020-01-081-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the course of developing earlier patches in this series I discovered that clang’s stddef.h does not implement the __need_* convention correctly: in C++, under some circumstances __need_NULL will also cause a definition of nullptr_t, and when the “modules” feature is enabled, all of the __need macros are ignored and all of stddef.h is exposed. (I’m not sure how to actually make either of these things happen, I discovered the problem by reading the file.) Worse, clang’s stdarg.h does not implement __need___va_list *at all*; including its stdarg.h will always expose all of its definitions. These are bugs in clang but it seems prudent to work around them, and the simplest way to do so is to have the bits/types/ headers introduced in the previous patch make definitions themselves, when possible. For size_t, ptrdiff_t, and wchar_t, we can use the predefined macros __SIZE_TYPE__, __PTRDIFF_TYPE__, and __WCHAR_TYPE__, when available, falling back to the old approach. For __gnuc_va_list, we have a whitelist of compilers known to provide __builtin_va_list, falling back to the old approach. NULL and va_list are defined ab initio. An additional complication is that we must be able to tell stddef.h and stdarg.h _not_ to define again things we have already defined. It appears to me, based on inspection of clang, GCC, and icc stddef.h and stdarg.h, that we can use the macros _SIZE_T, _PTRDIFF_T, _WCHAR_T, _VA_LIST, and __GNUC_VA_LIST to accomplish this. Since we are no longer relying on stdarg.h to define an implementation-namespace alias for us, I thought it would make sense also to stop calling it __gnuc_va_list. The bulk of this patch is a mechanical substitution of __va_list for __gnuc_va_list throughout our headers. Copyright boilerplate is added to stdlib/bits/NULL.h and stdlib/bits/types/*.h because they now contain enough commentary and code that they could plausibly be copyrightable. * stdlib/bits/NULL.h: Do not use stddef.h to define NULL. Define NULL ab initio if not already defined, as `((void *)0)` for C, and either `__null` or 0 for C++, depending on compiler support. * stdlib/bits/types/__va_list.h: If __builtin_va_list is known to be available, use it to define __va_list without including stdarg.h. Otherwise use __need___va_list to request a definition of __gnuc_va_list and nothing else from stdarg.h, then use that to define __va_list. * stdlib/bits/types/va_list.h: Use __va_list, not __gnuc_va_list, to define va_list. Improve commentary. * stdlib/bits/types/ptrdiff_t.h: If __PTRDIFF_TYPE__ is defined, use it to define ptrdiff_t without including stddef.h. Otherwise use __need_ptrdiff_t to request a definition of ptrdiff_t and nothing else from stddef.h. Use _PTRDIFF_T as guard macro to match behavior of common stddef.h implementations. * stdlib/bits/types/size_t.h: Similarly for size_t, with __SIZE_TYPE__, __need_size_t, and _SIZE_T. * stdlib/bits/types/wchar_t.h: Similarly for wchar_t, with __WCHAR_TYPE__, __need_wchar_t, and _WCHAR_T. If __cplusplus is defined, do nothing; wchar_t is built-in in C++. * conform/data/stdio.h-data, conform/data/wchar.h-data * include/err.h, include/stdio.h, include/syslog.h, include/wchar.h * libio/bits/stdio.h, libio/bits/stdio2.h, libio/iolibio.h * libio/libio.h, libio/stdio.h, libio/vwprintf.c, misc/bits/syslog.h * misc/err.c, misc/err.h, misc/syslog.h, stdio-common/printf.h * sysdeps/ieee754/ldbl-opt/nldbl-compat.c * sysdeps/ieee754/ldbl-opt/nldbl-compat.h * wcsmbs/bits/wchar2.h, wcsmbs/wchar.h: Replace all uses of __gnuc_va_list with __va_list. * scripts/check-obsolete-constructs.py (HEADER_ALLOWED_INCLUDES): bits/NULL.h is no longer allowed to include stddef.h.
* Replace conformtest.pl with conformtest.py.Joseph Myers2018-11-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing the consolidation on Python for various miscellaneous build and test scripts, this patch moves conformtest from Perl to Python. The substance of the tests run is intended to be the same as before, except that the previous test for tags did not actually achieve the intended purpose of verifying whether a tag was already declared, so is changed to one that would actually fail for a tag that wasn't declared, and a typo in the old test for variables being available ($xyzzy instead of xyzzy) would have made that test not use the correct type (but it would have passed anyway with warnings). No attempt is made to keep the details of what the test output looks like; instead, tests are given names which are made to follow PASS: / FAIL: / XFAIL: / SKIP: / MISSING: as appropriate. In the new version, there is more consistent parsing of test lines (into a series of words, either surrounded by {} or separated by spaces) that applies for all kinds of test lines, rather than the old approach of different regular expressions for every kind of test. A few of the conform/data/ files are adjusted so their syntax works with the new script (which now requires spaces in certain cases where the old script tolerated them being missing, and does not allow stray semicolons at the end of "function" lines). Similarly, common logic is used around what happens with a second subtest if a first one fails (e.g., a test for a symbol's type if the test for availability fails), rather than such logic being replicated separately for each kind of test. Common parsing also applies for test lines both when they are lines for the header under test and when they are lines for another header specified with allow-header, again unlike the old script. Tested for x86_64, and with build-many-glibcs.py. * conform/conformtest.py: New file. * conform/conformtest.pl: Remove. * conform/GlibcConform.pm: Likewise. * conform/glibcconform.py (KEYWORDS_C90): New constant. (KEYWORDS_C99): Likewise. (KEYWORDS): Likewise. * conform/Makefile ($(conformtest-header-tests)): Use conformtest.py instead of conformtest.pl. Do not pass --tmpdir option. Use --header instead of --headers. * conform/data/arpa/inet.h-data: Remove trailing semicolons on function entries. * conform/data/spawn.h-data: Likewise. * conform/data/fcntl.h-data (openat): Add space after function name. * conform/data/wchar.h-data (wcscasecmp): Likewise. (wcscasecmp_l): Likewise. * conform/data/termios.h-data (c_cc): Add space after element name.
* conformtest: Fix XPG standard naming.Joseph Myers2017-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The conform/ tests test -D_XOPEN_SOURCE under the name "XPG3", and -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED under the name "XPG4". That naming is misleading. _XOPEN_SOURCE_EXTENDED actually means XPG4.2, including UX-shaded interfaces. _XOPEN_SOURCE actually means XPG4, or XPG4.2 without UX-shaded interfaces. (Prior XPG versions also used _XOPEN_SOURCE, but without any versioning of the values of the macro, so XPG4.2 without UX-shaded interfaces is the only sensible set of interfaces for glibc to expose given _XOPEN_SOURCE=1 without _XOPEN_SOURCE_EXTENDED defined.) This patch fixes the naming in the conform/ tests, so that what is now called XPG4 is changed to XPG42, and what is now called XPG3 is changed to XPG4. Tested for x86_64 (and verified the complete set of expectations is unchanged by the patch beyond the intended renaming). * conform/GlibcConform.pm (XPG4): Rename standard to XPG42. (XPG3): Rename standard to XPG4. * conform/Makefile: Likewise. * conform/list-header-symbols.pl: Likewise. * conform/data/aio.h-data: Likewise. * conform/data/arpa/inet.h-data: Likewise. * conform/data/complex.h-data: Likewise. * conform/data/ctype.h-data: Likewise. * conform/data/dlfcn.h-data: Likewise. * conform/data/fcntl.h-data: Likewise. * conform/data/fenv.h-data: Likewise. * conform/data/float.h-data: Likewise. * conform/data/fmtmsg.h-data: Likewise. * conform/data/ftw.h-data: Likewise. * conform/data/grp.h-data: Likewise. * conform/data/inttypes.h-data: Likewise. * conform/data/iso646.h-data: Likewise. * conform/data/langinfo.h-data: Likewise. * conform/data/libgen.h-data: Likewise. * conform/data/limits.h-data: Likewise. * conform/data/locale.h-data: Likewise. * conform/data/math.h-data: Likewise. * conform/data/mqueue.h-data: Likewise. * conform/data/ndbm.h-data: Likewise. * conform/data/net/if.h-data: Likewise. * conform/data/netdb.h-data: Likewise. * conform/data/netinet/in.h-data: Likewise. * conform/data/poll.h-data: Likewise. * conform/data/pthread.h-data: Likewise. * conform/data/pwd.h-data: Likewise. * conform/data/sched.h-data: Likewise. * conform/data/search.h-data: Likewise. * conform/data/semaphore.h-data: Likewise. * conform/data/signal.h-data: Likewise. * conform/data/spawn.h-data: Likewise. * conform/data/stdbool.h-data: Likewise. * conform/data/stdint.h-data: Likewise. * conform/data/stdio.h-data: Likewise. * conform/data/stdlib.h-data: Likewise. * conform/data/string.h-data: Likewise. * conform/data/strings.h-data: Likewise. * conform/data/stropts.h-data: Likewise. * conform/data/sys/mman.h-data: Likewise. * conform/data/sys/resource.h-data: Likewise. * conform/data/sys/select.h-data: Likewise. * conform/data/sys/socket.h-data: Likewise. * conform/data/sys/stat.h-data: Likewise. * conform/data/sys/statvfs.h-data: Likewise. * conform/data/sys/time.h-data: Likewise. * conform/data/sys/timeb.h-data: Likewise. * conform/data/sys/types.h-data: Likewise. * conform/data/sys/uio.h-data: Likewise. * conform/data/sys/un.h-data: Likewise. * conform/data/sys/wait.h-data: Likewise. * conform/data/syslog.h-data: Likewise. * conform/data/termios.h-data: Likewise. * conform/data/tgmath.h-data: Likewise. * conform/data/time.h-data: Likewise. * conform/data/ucontext.h-data: Likewise. * conform/data/unistd.h-data: Likewise. * conform/data/utmpx.h-data: Likewise. * conform/data/varargs.h-data: Likewise. * conform/data/wchar.h-data: Likewise. * conform/data/wctype.h-data: Likewise.
* conformtest: Fix miscellaneous UNIX98 expectations.Joseph Myers2012-11-101-0/+6
|
* conformtest: Clean up / correct / expand C99 and C11 expectations.Joseph Myers2012-11-071-5/+20
|
* First steps to get conformtest fully workingUlrich Drepper2012-02-251-32/+38
|
* Fix up wchar.h for XPG7.Ulrich Drepper2010-01-111-6/+8
|
* Add support for XPG7 testing.Ulrich Drepper2010-01-091-1/+43
| | | | | The header conformance testing code needed extending for XPG7. This exposed a few bugs in the headers. There are more changes to come.
* Update.Ulrich Drepper2001-01-281-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | * conform/data/time.h-data: CLK_TCK is not in XPG6. Fix tzname entry. * sysdeps/mach/hurd/bits/time.h: Don't define CLK_TCK for XPG6. * sysdeps/mach/hurd/i386/bits/time.h: Likewise. * sysdeps/unix/sysv/linux/bits/time.h: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/time.h: Likewise. * sysdeps/unix/sysv/linux/i386/bits/time.h: Likewise. * sysdeps/unix/sysv/linux/ia64/bits/time.h: Likewise. * time/time.h: Likewise. * conform/conformtest.pl (@headers): Add complex.h and tgmath.h. * conform/data/complex.h-data: New file. * conform/data/tgmath.h-data: New file. * conform/data/wchar.h-data: Add missing functions. * sysdeps/gnu/bits/utmpx.h: Define RUN_LVL only if __USE_GNU. * conform/data/termios.h-data: Add missing const in tcsetattr() prototype. * posix/sys/wait.h: Include <signal.h> and <sys/resource.h>. Don't define pid_t here. * conform/data/sys/utsname.h-data: Don't provide fixed array sizes.
* Update.Ulrich Drepper2000-02-281-0/+95
2000-02-27 Ulrich Drepper <drepper@redhat.com> * conform/conformtest.pl (@headers): Add wordexp.h, wctype.h, wchar.h, varargs.h, utmpx.h, utime.h, unistd.h, ulimit.h, ucontext.h, time.h, termios.h, tar.h, sys/wait.h, sys/uio.h, sys/types.h, sys/times.h, sys/timeb.h, sys/time.h, sys/statvfs.h, sys/stat.h, sys/shm.h, sys/sem.h, and sys/resource.h. Implement handling of allow-header. * conform/data/fcntl.h-data: Correct various bugs. * conform/data/fnmatch.h-data: Likewise. * conform/data/math.h-data: Likewise. * conform/data/ndbm.h-data: Likewise. * conform/data/nl_types.h-data: Likewise. * conform/data/poll.h-data: Likewise. * conform/data/pthread.h-data: Likewise. * conform/data/semaphore.h-data: Likewise. * conform/data/setjmp.h-data: Likewise. * conform/data/signal.h-data: Likewise. * conform/data/stdarg.h-data: Likewise. * conform/data/stddef.h-data: Likewise. * conform/data/stdio.h-data: Likewise. * conform/data/stdlib.h-data: Likewise. * conform/data/string.h-data: Likewise. * conform/data/strings.h-data: Likewise. * conform/data/stropts.h-data: Likewise. * conform/data/syslog.h-data: Likewise. * conform/data/sys/ipc.h-data: Likewise. * conform/data/sys/mman.h-data: Likewise. * conform/data/sys/msg.h-data: Likewise. * conform/data/tar.h-data: New file. * conform/data/termios.h-data: New file. * conform/data/time.h-data: New file. * conform/data/ucontext.h-data: New file. * conform/data/ulimit.h-data: New file. * conform/data/unistd.h-data: New file. * conform/data/utime.h-data: New file. * conform/data/utmpx.h-data: New file. * conform/data/varargs.h-data: New file. * conform/data/wchar.h-data: New file. * conform/data/wctype.h-data: New file. * conform/data/wordexp.h-data: New file. * conform/data/sys/resource.h-data: New file. * conform/data/sys/sem.h-data: New file. * conform/data/sys/shm.h-data: New file. * conform/data/sys/stat.h-data: New file. * conform/data/sys/statvfs.h-data: New file. * conform/data/sys/time.h-data: New file. * conform/data/sys/timeb.h-data: New file. * conform/data/sys/times.h-data: New file. * conform/data/sys/types.h-data: New file. * conform/data/sys/uio.h-data: New file. * conform/data/sys/wait.h-data: New file. * grp/grp.h (getgrent_r): Declare only if __USE_GNU. * include/sys/time.h (__itimes): Fix type of second parameter. * io/sys/stat.h (S_IFLNK): Define also if __USE_XOPEN. (S_ISVTX): Likewise. * io/sys/statvfs.h: Define fsblkcnt_t and fsfilcnt_t. * locale/langindo.h: Make ERA_YEAR, INT_CURR_SYMBOL, CURRENCY_SYMBOL, MON_DECIMAL_POINT, MON_THOUSANDS_SEP, MON_GROUPING, POSITIVE_SIGN, NEGATIVE_SIGN, INT_FRAC_DIGITS, FRAC_DIGITS, P_CS_PRECEDES, P_SEP_BY_SPACE, N_CS_PRECEDES, N_SEP_BY_SPACE, P_SIGN_POSN, N_SIGN_POSN, DECIMAL_POINT, THOUSANDS_SEP, GROUPING, YESEXPR, NOEXPR, YESSTR, and NOSTR only available if __USE_GNU. * math/bits/mathcalls.h: Don't declare tgamma and scalbn if only __USE_XOPEN. * posix/unistd.h: Don't define ptrdiff_t. (sbrk): Correct type of parameter. * sysdeps/generic/sbrk.c: Likewise. * sysdeps/mach/hurd/sbrk.c: Likewise. * posix/sys/types.h: Allow id_t, suseconds_t, fsblkcnt_t, and fsfilcnt_t being defined elsewhere. * resource/sys/resource.h: Define id_t. If __USE_XOPEN use int for type of first parameter if getrlimit, getrlimit64, setrlimit, setrlimit64, getrusage, getpriority, and setpriority. * sysdeps/generic/getpriority.c: Fix type of second parameter. * sysdeps/generic/setpriority.c: Likewise. * sysdeps/mach/hurd/getpriority.c: Likewise. * sysdeps/mach/hurd/setpriority.c: Likewise. * sysdeps/unix/sysv/irix4/getpriority.c: Likewise. * sysdeps/unix/sysv/irix4/setpriority.c: Likewise. * sysdeps/unix/sysv/linux/getpriority.c: Likewise. * sysdeps/generic/utimes.c: Fix parameter of third parameter. * sysdeps/mach/hurd/utimes.c: Likewise. * sysdeps/posix/utimes.c: Likewise. * sysdeps/generic/bits/shm.h: Define shmatt_t type and use it in struct shmid_ds definition. * sysdeps/gnu/bits/shm.h: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/shm.h: Likewise. * sysdeps/unix/sysv/linux/bits/shm.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/shm.h: Likewise. * sysvipc/sys/shm.h: Define time_t. * sysvipc/sys/sem.h (struct sembuf): Make sem_num field unsigned. * sysdeps/gnu/bits/sem.h: Rename anonymous type struct sem_queue and struct sem_undo to struct __sem_queue and struct __sem_undo resp. * time/time.h: Define suseconds_t if not already done. * sysdeps/unix/sysv/linux/bits/statvfs.h: Rename f_spare to __f_spare. * sysdeps/unix/sysv/linux/fstatvfs64.c: Likewise. * sysdeps/unix/sysv/linux/statvfs64.c: Likewise. * sysdeps/unix/sysv/linux/internal_statvfs.c: Likewise. * intl/bindtextdom.c: Use rwlock to avoid surprising results in multithreaded applications. * intl/dcigettext.c: Likewise. * intl/textdomain.c: Likewise. * intl/*.c: Update copyright. * sysdeps/generic/bits/libc-lock.h: Define __libc_rwlock_* stubs. 2000-02-27 Andreas Jaeger <aj@suse.de> * sysdeps/unix/sysv/linux/configure.in: Treat also "/usr/" as prefix especially. 2000-02-27 Ulrich Drepper <drepper@redhat.com> * po/de.po: Update from translation team. * po/ko.po: Likewise.