Re: [PATCH] full-read: Add extern "C" for C++.

2024-04-17 Thread Miro Palmu via Gnulib discussion list
On 2024-04-18 01:36, Bruno Haible wrote: > Thanks for the report. In fact, many .h files in Gnulib still are not > C++-safe. > Instead of fixing it one by one, let me do it for all (except the two > modules 'glibc-internal/scratch_buffer' and 'glibc-internal/dynarray', for > which the priority

totalorder* tests: Strengthen tests

2024-04-17 Thread Bruno Haible
In the specification of totalorder* [1] we read: "in the following order: - negative quiet NaNs, in order of decreasing payload; - negative signaling NaNs, in order of decreasing payload; - negative infinity; - finite numbers, in ascending order, with negative zero before

Re: gnulib-tool.py: Fix pylint 'attribute-defined-outside-init' warnings.

2024-04-17 Thread Collin Funk
Hi Bruno, On 4/17/24 3:18 PM, Bruno Haible wrote: > In this example, the property 'attribute' is used outside of the class, > that is, it is public. (In the OO world, the concept of "class" and of > "private"/"public" are tightly related, because one of the main purposes > of a class is to hide

nan: Relicense under LGPLv2+

2024-04-17 Thread Bruno Haible
The module 'nan' (previously tests/nan.h, now lib/nan.h) defines functions for getting a NaN value reliably. This module is, so far, under GPL, because historically only the tests use it. I would like to use it under LGPLv2+, for the modules 'setpayload*' and 'getpayloadl' (functions defined by

gnulib-tool.py: Use same warning style as gnulib-tool.sh

2024-04-17 Thread Bruno Haible
These two commands differ in the style of warning output: $ ./gnulib-tool.sh --create-testdir --dir=../testdir2 --single-configure getpayloadl gnulib-tool: warning: module getpayloadl depends on a module with an incompatible license: nan gnulib-tool: warning: module getpayloadl depends on a

Re: [PATCH] full-read: Add extern "C" for C++.

2024-04-17 Thread Bruno Haible
Hi, Miro Palmu wrote: > * lib/full-read.h: Add extern "C" for C++. Thanks for the report. In fact, many .h files in Gnulib still are not C++-safe. Instead of fixing it one by one, let me do it for all (except the two modules 'glibc-internal/scratch_buffer' and 'glibc-internal/dynarray', for

Re: gnulib-tool.py: Fix pylint 'attribute-defined-outside-init' warnings.

2024-04-17 Thread Bruno Haible
Hi Collin, Both patches applied. > The reason I dislike defining instance variables outside of __init__ > is that you can run into situations like this, which I find hard to > follow: > > var = GLImport(...) # self.assistant does not exist. > var.assistant.do_something() #

Re: gnulib-tool.py: Fix pylint 'attribute-defined-outside-init' warnings.

2024-04-17 Thread Collin Funk
Hi Bruno, On 4/17/24 11:02 AM, Bruno Haible wrote: >> $ pylint *.py | grep W0201 >> GLError.py:119:12: W0201: Attribute 'message' defined outside __init__ >> (attribute-defined-outside-init) > > This warning is bogus. In a dynamic language like Python, it is > perfectly fine to have a property

Re: gnulib-tool.py: Fix pylint 'attribute-defined-outside-init' warnings.

2024-04-17 Thread Bruno Haible
Hi Collin, > $ pylint *.py | grep W0201 > GLError.py:119:12: W0201: Attribute 'message' defined outside __init__ > (attribute-defined-outside-init) This warning is bogus. In a dynamic language like Python, it is perfectly fine to have a property used only by one method. Only if it is used by

[PATCH] full-read: Add extern "C" for C++.

2024-04-17 Thread Miro Palmu via Gnulib discussion list
Same what commit a0b977a430af88ff58d9596a60670936eb7f1d31 does for module full-write, but for full-read. * lib/full-read.h: Add extern "C" for C++. Copyright-paperwork-exempt: Yes --- ChangeLog | 4 lib/full-read.h | 11 +++ 2 files changed, 15 insertions(+) diff --git

Re: Refactoring rewrite_filename functions

2024-04-17 Thread Bruno Haible
Hi Collin, > This will require some code reordering first though. The > GLFileAssistant used by GLImport is not defined until > GLImport.execute(). The file name transformations are done in > GLImport.prepare(). Good point. > I think the correct solution there is to define the GLFileAssistant

new modules getpayload, getpayloadf, getpayloadl

2024-04-17 Thread Bruno Haible
ISO C 23 specifies in the (optional, but normative) Annex F also functions for extracting the payload of a quiet or signalling NaN. This patch series implements them. 2024-04-17 Bruno Haible getpayloadl: Add tests. * tests/test-getpayloadl.c: New file. *