glibc/stdlib
Joseph Myers a292f45acd Add <limits.h> integer width macros.
TS 18661-1 defines macros for the width of integer types, intended for
use with the fromfp functions to convert from floating-point types to
integer types of any width, in any rounding mode and with control over
whether "inexact" is raised.  Such macros are, of course, more
generally useful than just with those functions.

Those macros are added to <limits.h> and <stdint.h>.  This patch adds
the <limits.h> macros to glibc's header, with the <stdint.h> ones
intended to be added in a separate patch (which would add to the NEWS
entry created by this patch).  I've also added these macros to GCC's
headers for GCC 7, but definitions in glibc's <limits.h> are still
useful for older GCC, for non-GNU compilers and for when it's
_GNU_SOURCE rather than __STDC_WANT_IEC_60559_BFP_EXT__ that implies
the macros should be defined since the GCC header only considers
__STDC_WANT_IEC_60559_BFP_EXT__ (and for glibc systems, the
definitions in GCC's <stdint.h> will only be used with
-ffreestanding).

Tested for x86_64 and x86.

	* include/limits.h: Define
	__GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION and include
	<bits/libc-header-start.h> instead of including <features.h>.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (CHAR_WIDTH): New macro.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (SCHAR_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (UCHAR_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (SHRT_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (USHRT_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (LONG_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (ULONG_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (LLONG_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (ULLONG_WIDTH): Likewise.
	* manual/lang.texi (Width of Type): Document these macros.
	* stdlib/tst-width.c: New file.
	* stdlib/Makefile (tests): Add tst-width.
2016-09-19 12:25:36 +00:00
..
bits Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
sys
a64l.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
abort.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
abs.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
add_n.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
addmul_1.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
alloca.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
at_quick_exit.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
atexit.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
atof.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
atoi.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
atol.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
atoll.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
bsearch.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
bug-fmtmsg1.c Fix locking problem in fmtmsg 2012-01-16 09:03:20 -05:00
bug-getcontext.c Fix bug-getcontext test 2012-07-16 18:46:40 +02:00
bug-strtod2.c Refactor bug-strtod2.c to be type generic 2016-05-23 14:13:11 -05:00
bug-strtod.c Refactor bug-strtod.c to better test new types. 2016-05-23 14:13:11 -05:00
canonicalize.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
cmp.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
cxa_at_quick_exit.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
cxa_atexit.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
cxa_finalize.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
cxa_thread_atexit_impl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dbl2mpn.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
Depend
div.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
divmod_1.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
divrem.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
drand48_r.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
drand48-iter.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
drand48.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
erand48_r.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
erand48.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
errno.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
exit.c Bug 20198: quick_exit should not call destructors. 2016-06-06 21:40:25 -04:00
exit.h Bug 20198: quick_exit should not call destructors. 2016-06-06 21:40:25 -04:00
fmtmsg.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
fmtmsg.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
fpioconst.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
fpioconst.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
gen-fpioconst.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
gen-tst-strtod-round.c Refactor tst-strtod-round.c for type-generic-ness 2016-05-25 13:33:36 -05:00
getcontext.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
getenv.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
getsubopt.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
gmp-impl.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
gmp.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
grouping.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
grouping.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
groupingwc.c
inlines.c
isomac.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
jrand48_r.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
jrand48.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
l64a.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
labs.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
lcong48_r.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
lcong48.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ldbl2mpn.c
ldiv.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
llabs.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
lldiv.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
longlong.h longlong: fix sh -Wundef builds 2016-01-07 17:29:17 -05:00
lrand48_r.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
lrand48.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
lshift.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
makecontext.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
Makefile Add <limits.h> integer width macros. 2016-09-19 12:25:36 +00:00
mblen.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
mbstowcs.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
mbtowc.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
mod_1.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
monetary.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
mp_clz_tab.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
mpn2dbl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
mpn2flt.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
mpn2ldbl.c
mrand48_r.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
mrand48.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
msort.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
mul_1.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
mul_n.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
mul.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
nrand48_r.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
nrand48.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
old_atexit.c
on_exit.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
putenv.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
qsort.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
quick_exit.c Bug 20198: quick_exit should not call destructors. 2016-06-06 21:40:25 -04:00
rand_r.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
rand.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
random_r.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
random.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
rpmatch.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
rshift.c Fix build failures with -DDEBUG. 2016-01-15 11:07:41 -07:00
secure-getenv.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
seed48_r.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
seed48.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
setcontext.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
setenv.c Suppress GCC 6 warning about ambiguous 'else' with -Wparentheses 2016-04-15 13:30:55 +02:00
srand48_r.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
srand48.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
stdlib.h Do not declare grantpt, ptsname, unlockpt in stdlib.h for XPG3 (bug 20094). 2016-05-17 15:51:55 +00:00
strfmon_l.c libio: Implement vtable verification [BZ #20191] 2016-06-23 20:01:52 +02:00
strfmon.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtod_l.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtod_nan_double.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtod_nan_float.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtod_nan_main.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtod_nan_narrow.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtod_nan_wide.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtod_nan.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtod.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtof_l.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtof_nan.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtof.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtoimax.c
strtol_l.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtol.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtold_l.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtold_nan.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtold.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtoll_l.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtoll.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtoul_l.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtoul.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtoull_l.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtoull.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtoumax.c
sub_n.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
submul_1.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
swapcontext.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
system.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tens_in_limb.c
test-a64l.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-canon2.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-canon.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
testdiv.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
testdiv.input
testmb2.c
testmb.c
testrand.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
testsort.c
tst-atof1.c
tst-atof2.c
tst-bsearch.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-environ.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-fmtmsg.c Modify several tests to use test-skeleton.c 2014-11-05 15:24:08 +05:30
tst-fmtmsg.sh Make shebang interpreter directives consistent 2016-01-07 04:03:21 -05:00
tst-limits.c Fix a couple of -Wundef warnings. 2014-12-29 23:14:38 -05:00
tst-makecontext2.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-makecontext3.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-makecontext.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-putenv.c
tst-putenvmod.c
tst-qsort2.c stdlib/tst-qsort2.c: Fix off-by-one argc interpretation error 2014-06-20 21:29:33 +01:00
tst-qsort.c
tst-quick_exit.cc quick_exit tests: Do not use C++ headers 2016-06-09 12:09:43 +02:00
tst-rand48-2.c Modify several tests to use test-skeleton.c 2014-11-05 15:24:08 +05:30
tst-rand48.c Modify several tests to use test-skeleton.c 2014-11-05 15:24:08 +05:30
tst-random2.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-random.c Modify several tests to use test-skeleton.c 2014-11-05 15:24:08 +05:30
tst-secure-getenv.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-setcontext2.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-setcontext3.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-setcontext3.sh Make shebang interpreter directives consistent 2016-01-07 04:03:21 -05:00
tst-setcontext.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-strfmon_l.c strfmon_l: Use specified locale for number formatting [BZ #19633] 2016-04-04 15:18:13 +02:00
tst-strtod2.c
tst-strtod3.c
tst-strtod4.c
tst-strtod5.c
tst-strtod6.c Refactor tst-strtod6.c 2016-05-23 14:13:11 -05:00
tst-strtod-nan-locale-main.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-strtod-nan-locale.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-strtod-overflow.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-strtod-round-data Fix strtof decimal rounding close to half least subnormal (bug 18247). 2015-04-10 20:45:30 +00:00
tst-strtod-round-data.h Refactor tst-strtod-round.c for type-generic-ness 2016-05-25 13:33:36 -05:00
tst-strtod-round-skeleton.c Add tst-wcstod-round 2016-08-19 11:17:07 -05:00
tst-strtod-round.c Add tst-wcstod-round 2016-08-19 11:17:07 -05:00
tst-strtod-underflow.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-strtod.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-strtod.h Refactor tst-strtod-round.c for type-generic-ness 2016-05-25 13:33:36 -05:00
tst-strtol-locale-main.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-strtol-locale.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-strtol.c Convert 703 function definitions to prototype style. 2015-10-16 20:21:49 +00:00
tst-strtoll.c Convert 703 function definitions to prototype style. 2015-10-16 20:21:49 +00:00
tst-system.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-thread-quick_exit.cc quick_exit tests: Do not use C++ headers 2016-06-09 12:09:43 +02:00
tst-tininess.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-tls-atexit-lib.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-tls-atexit-nodelete.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-tls-atexit.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-unsetenv1.c * stdlib/Makefile (tests): Add tst-unsetenv1. 2008-12-02 02:27:43 +00:00
tst-width.c Add <limits.h> integer width macros. 2016-09-19 12:25:36 +00:00
tst-xpg-basename.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ucontext.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
udiv_qrnnd.c
Versions Bug 20198: quick_exit should not call destructors. 2016-06-06 21:40:25 -04:00
wcstoimax.c
wcstombs.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
wcstoumax.c
wctomb.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
xpg_basename.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00