Re: Stack module and -Wsign-compare

2022-01-06 Thread Marc Nieper-Wißkirchen
Thank you, Paul. My local tests also show that it behaves better now. Am Mi., 5. Jan. 2022 um 20:54 Uhr schrieb Paul Eggert : > > On 1/5/22 10:00, Bruno Haible wrote: > > Another possible fix would be to change > >size_t size; > > to > >idx_t size; > > in the struct. > > Yes, that fits

Re: Stack module and -Wsign-compare

2022-01-05 Thread Paul Eggert
On 1/5/22 10:00, Bruno Haible wrote: Another possible fix would be to change size_t size; to idx_t size; in the struct. Yes, that fits better into our strategy of preferring signed to unsigned types for sizes. Plus, it avoids a cast that's too powerful in C. I installed the

Re: Stack module and -Wsign-compare

2022-01-05 Thread Bruno Haible
Marc Nieper-Wißkirchen: > If "stack.h" is included by client code that is supposed to be > compiled with "-Wsign-compare", the compiler will complain about the > comparison on line 121. Indeed: although we don't care about -Wsign-compare warnings in Gnulib code, consumers of .h files from Gnulib

Stack module and -Wsign-compare

2022-01-05 Thread Marc Nieper-Wißkirchen
Commit 3dc36216f168f4e752b648b19d85eab32a037827 by Paul Eggert introduced a regression in the stack module. If "stack.h" is included by client code that is supposed to be compiled with "-Wsign-compare", the compiler will complain about the comparison on line 121. There wasn't a problem before