Re: restrict

2020-02-10 Thread Jeffrey Walton
On Sun, Feb 9, 2020 at 10:03 PM Bruno Haible wrote: > ... > Which function declarations could therefore profit from the 'restrict' > keyword? [SNIP ...] I think the case of interest is subobjects of arrays: char a[] = "Hello World"; char* b = a+5; memcpy(a,b,5) would get you in trouble

Re: restrict

2020-02-10 Thread Tim Rühsen
On 2/10/20 4:02 AM, Bruno Haible wrote: > Tim Rühsen wrote: >> gcc -Wall tells you so (gcc 8 and upwards): >> $ gcc -Wall msg.c -o msg >> msg.c: In function ‘main’: >> msg.c:11:13: warning: passing argument 1 to restrict-qualified parameter >> aliases with argument 4 [-Wrestrict] >>11 | snpri

[PATCH 0/1] xnanosleep: Use pause for infinite duration.

2020-02-10 Thread Vladimir Panteleev
Users have discovered that the "sleep" command accepts "infinity" as its duration argument. However, specifying the "infinity" duration does not actually cause GNU sleep to sleep for an infinite duration. This is because the duration was being unconditionally converted to a timespec value, and infi

[PATCH] xnanosleep: Use pause for infinite duration.

2020-02-10 Thread Vladimir Panteleev
* lib/xnanosleep.c (xnanosleep): When the duration is the positive infinity, use pause instead of nanosleep. --- lib/xnanosleep.c | 42 -- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/lib/xnanosleep.c b/lib/xnanosleep.c index 5774f75f3..58

[PATCH] m4: fix --disable-rpath for AIX

2020-02-10 Thread CHIGOT, CLEMENT
Currently, --disable-rpath will add directly $found_so to the compilation line. However, on AIX, this will result on the path being hardcoded in the built binaries. The only way to avoid hardcoded paths without using linker flags (like -Wl,-bnoipath) is to add -l$name. --- m4/lib-link.m4 | 7 +

Re: [PATCH] test-canonicalize: avoid a build failure

2020-02-10 Thread Bruno Haible
> * tests/test-canonicalize.c: Protect the inclusion of null-ptr.h > with the same guard as that used to protect usage of the null_ptr > function The same thing is needed in test-ptsname_r.c: 2020-02-10 Bruno Haible ptsname_r-tests: Avoid unused function warning. * tests/test

pthread-mutex-tests, pthread-rwlock-tests: Fix link errors on HP-UX

2020-02-10 Thread Bruno Haible
On HP-UX 11.31 / ia64, I'm seeing these link errors: cc +DD64 -AC99 -D_HPUX_SOURCE -D_XOPEN_SOURCE=600 -g -L/home/haible/prefix-hpux113ia64-64-cc/lib -o test-pthread-mutex test-pthread-mutex.o libtests.a ../gllib/libgnu.a libtests.a -lpthread ld: Unsatisfied symbol "sem_trywait" in file test-

copysignf: fix link error on HP-UX with cc

2020-02-10 Thread Bruno Haible
On HP-UX 11.31/ia64 with cc, I'm seeing this link error: cc +DD64 -AC99 -D_HPUX_SOURCE -D_XOPEN_SOURCE=600 -g -L/home/haible/prefix-hpux113ia64-64-cc/lib -o test-copysignf test-copysignf.o libtests.a ../gllib/libgnu.a libtests.a ld: Unsatisfied symbol "_copysignf" in file test-copysignf.o 1 er