diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2021-09-04 09:45:06 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2021-09-04 09:45:18 -0700 |
commit | 298f08077b41078d5a5d9a2460bbb40f40512997 (patch) | |
tree | a92da1e039bd0453cef13d67f5e03d7d17739796 | |
parent | b50c6442e43d79471a31a2a202d3e50c0557446f (diff) | |
download | gnulib-298f08077b41078d5a5d9a2460bbb40f40512997.tar.gz |
idx: break copying from glibc
* config/srclist.txt: Comment out idx.h, and bring back recent change.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | config/srclist.txt | 2 | ||||
-rw-r--r-- | lib/idx.h | 20 |
3 files changed, 26 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2021-09-04 Paul Eggert <eggert@cs.ucla.edu> + + idx: break copying from glibc + * config/srclist.txt: Comment out idx.h, and bring back recent change. + 2021-09-04 Sun Haiyong <youbest@sina.com> (tiny change) sigsegv: Improve cross-compilation support for LoongArch CPU. diff --git a/config/srclist.txt b/config/srclist.txt index e118ede049..da906571ce 100644 --- a/config/srclist.txt +++ b/config/srclist.txt @@ -50,7 +50,7 @@ $GNUORG Copyright/request-assign.program doc/Copyright $GNUORG Copyright/request-disclaim.changes doc/Copyright $LIBCSRC include/filename.h lib -$LIBCSRC include/idx.h lib +#$LIBCSRC include/idx.h lib #$LIBCSRC malloc/dynarray-skeleton.c lib/malloc #$LIBCSRC malloc/dynarray.h lib/malloc #$LIBCSRC malloc/dynarray_at_failure.c lib/malloc @@ -56,6 +56,26 @@ * Because 'size_t' is an unsigned type, and a signed type is better. See above. + Why not use 'ssize_t'? + + * 'ptrdiff_t' is more portable; it is standardized by ISO C + whereas 'ssize_t' is standardized only by POSIX. + + * 'ssize_t' is not required to be as wide as 'size_t', and some + now-obsolete POSIX platforms had 'size_t' wider than 'ssize_t'. + + * Conversely, some now-obsolete platforms had 'ptrdiff_t' wider + than 'size_t', which can be a win and conforms to POSIX. + + Won't this cause a problem with objects larger than PTRDIFF_MAX? + + * Typical modern or large platforms do not allocate such objects, + so this is not much of a problem in practice; for example, you + can safely write 'idx_t len = strlen (s);'. To port to older + small platforms where allocations larger than PTRDIFF_MAX could + in theory be a problem, you can use Gnulib's ialloc module, or + functions like ximalloc in Gnulib's xalloc module. + Why not use 'ptrdiff_t' directly? * Maintainability: When reading and modifying code, it helps to know that |