Re: stack module

2020-07-23 Thread Bruno Haible
Hi Marc, > The alternative with the same type safety would be a source file with > stack code procedures meant for inclusion (without include guards). > The source file would expect a preprocessor defines GL_STACK_NAME, > GL_STACK_TYPE, and GL_STACK_EXTERN. > > The file itself would contain code

Re: stack module

2020-07-23 Thread Marc Nieper-Wißkirchen
Hi Bruno, > This is perfectly acceptable for Gnulib. It has debuggability and type safety. Perfect. Then I will come up with a module in this form. > You have precedent e.g. in lib/diffseq.h and lib/aligned-malloc.h. Good to know; I hadn't taken a look at these sources yet. > You can even

Re: new module 'aligned-malloc'

2020-07-23 Thread Florian Weimer
* Paul Eggert: > On 7/22/20 12:13 AM, Florian Weimer wrote: >> I don't think it will work. Try to get an allocation of 4096 bytes with >> 4096 bytes alignment using glibc malloc this way. > > That's just a mental exercise since glibc malloc already has > aligned_alloc, but I took the challenge

Re: libgmp: link to the correct shared library

2020-07-23 Thread Bruno Haible
Hi Paul, > > Also, adding -Wl,-rpath=/PREFIX64/lib to LDFLAGS will have ill consequences > > when the package contains shared libraries and uses libtool to create them. > > See > > . > > That's OK too, since Emacs and

Re: [PATCH] fchmodat: Use /proc on Cygwin

2020-07-23 Thread Ken Brown
Hi Bruno, On 7/23/2020 6:36 PM, Bruno Haible wrote: I tested it by running rm -rf ../testdir ./gnulib-tool --create-testdir --dir=../testdir --single-configure lchmod fchmodat then transporting that testdir to my Cygwin machine, and building there (./configure && make && make check).

Re: Module with preprocessor utilities

2020-07-23 Thread Bruno Haible
[Adding back bug-gnulib in CC] Marc Nieper-Wißkirchen wrote: > > Marc Nieper-Wißkirchen wrote: > > > For example, do we want to encourage the writing of > > > sophisticated macros like the TRACE macros in chapter 16 of (the IMHO > > > opinionated) book Modern C ([1]). > > > > This TRACE macro is

Re: Minix

2020-07-23 Thread Bruno Haible
Paul Eggert wrote: > Minix is moribund (its last release was 2014) and is no longer a significant > porting target. Indeed. There was a conference around Minix in 2016 [1], but development apparently stopped more than 1½ years ago. [2][3] Bruno [1]

[PATCH] fchmodat: Use /proc on Cygwin

2020-07-23 Thread Ken Brown
* lib/fchmodat.c (fchmodat): Use /proc on Cygwin. --- ChangeLog | 4 lib/fchmodat.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8cac948ad..9d6051f76 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2020-07-23 Ken Brown + +

Optimize three-valued comparison between integers

2020-07-23 Thread Bruno Haible
A comment in Luca Saiu 'jitter' project [1] brought my attention to 3-valued comparison and the book "Hacker's Delight". === int sign1 (long n1, long n2) { return (n1 > n2 ? 1 : n1 < n2 ? -1 : 0); } int sign2 (long n1, long n2) { return (n1 < n2 ?

Re: libgmp: link to the correct shared library

2020-07-23 Thread Paul Eggert
On 7/23/20 3:30 PM, Bruno Haible wrote: If, say, we change the 'factor' program in GNU coreutils to use GMP, so that it can factor integers with more than 20 digits, anyone who wants to use their own installed GMP would get programs (from 'expr' to 'mkdir') that all spend time, during program

Re: libgmp: link to the correct shared library

2020-07-23 Thread Paul Eggert
On 7/12/20 2:48 PM, Bruno Haible wrote: This test fails when I build this gnulib module in my usual way: ./configure --prefix=/PREFIX64 \ CPPFLAGS="-I/PREFIX64/include -Wall" \ LDFLAGS="-L/PREFIX64/lib" I don't see why this should be expected to work. Instead,

Re: [PATCH] fchmodat: Use /proc on Cygwin

2020-07-23 Thread Ken Brown
On 7/23/2020 5:16 PM, Bruno Haible wrote: Ken Brown wrote: diff --git a/lib/fchmodat.c b/lib/fchmodat.c index 895016860..eee0a1c56 100644 --- a/lib/fchmodat.c +++ b/lib/fchmodat.c @@ -98,7 +98,7 @@ fchmodat (int dir, char const *file, mode_t mode, int flags) return -1; }

Re: libgmp: link to the correct shared library

2020-07-23 Thread Bruno Haible
Hi Paul, > > This test fails when I build this gnulib module in my usual way: > >./configure --prefix=/PREFIX64 \ > >CPPFLAGS="-I/PREFIX64/include -Wall" \ > >LDFLAGS="-L/PREFIX64/lib" > > I don't see why this should be expected to work. Instead, you can tell

Re: [PATCH] fchmodat: Use /proc on Cygwin

2020-07-23 Thread Bruno Haible
Hi Ken, > > 2020-07-23 Bruno Haible > > > > lchmod: Use /proc on Cygwin. > > * lib/lchmod.c (lchmod): Use /proc on Cygwin. > > > > diff --git a/lib/lchmod.c b/lib/lchmod.c > > index e113211..77a0060 100644 > > --- a/lib/lchmod.c > > +++ b/lib/lchmod.c > > @@ -76,7 +76,7 @@ lchmod

Re: [PATCH] fchmodat: Use /proc on Cygwin

2020-07-23 Thread Paul Eggert
Thanks, I installed that.

Re: new module 'aligned-malloc'

2020-07-23 Thread Paul Eggert
On 7/23/20 5:24 AM, Florian Weimer wrote: Ah, 4096 is too small. For large allocations (above the mmap threshold), what happens in the example is that the process VMA limit is eventually exhausted, at which malloc falls back to sbrk, and then the algorithm succeeds. I don't think it's a good

Re: new module 'aligned-malloc'

2020-07-23 Thread Florian Weimer
* Paul Eggert: > On 7/23/20 5:24 AM, Florian Weimer wrote: >> Ah, 4096 is too small. >> >> For large allocations (above the mmap threshold), what happens in the >> example is that the process VMA limit is eventually exhausted, at which >> malloc falls back to sbrk, and then the algorithm

Re: [PATCH] fchmodat: Use /proc on Cygwin

2020-07-23 Thread Bruno Haible
Ken Brown wrote: > diff --git a/lib/fchmodat.c b/lib/fchmodat.c > index 895016860..eee0a1c56 100644 > --- a/lib/fchmodat.c > +++ b/lib/fchmodat.c > @@ -98,7 +98,7 @@ fchmodat (int dir, char const *file, mode_t mode, int flags) >return -1; > } > > -# if defined __linux__ ||