Re: Gnulib and nullptr (and m4_provide_if)

2023-02-12 Thread Akim Demaille
Hi Friends, > Le 9 févr. 2023 à 01:42, Paul Eggert a écrit : > > On 2/8/23 15:15, Bruno Haible wrote: >> m4_provide_if is not documented in the Autoconf manual. Let's hope >> it won't change incompatibly... > > Yes, I hope so too. Gnulib is already using m4_provide_if in > gnulib/m4/largefile.

Re: Gnulib and nullptr (and m4_provide_if)

2023-02-08 Thread Paul Eggert
On 2/8/23 15:15, Bruno Haible wrote: m4_provide_if is not documented in the Autoconf manual. Let's hope it won't change incompatibly... Yes, I hope so too. Gnulib is already using m4_provide_if in gnulib/m4/largefile.m4 (in code stolen from Autoconf) so to some extent we're exposed already, t

Re: Gnulib and nullptr

2023-02-08 Thread Bruno Haible
Paul Eggert wrote: > + m4_provide_if([AC_PROG_CC], Note that m4_provide_if is not documented in the Autoconf manual. Let's hope it won't change incompatibly... Bruno

Re: Gnulib and nullptr

2023-02-07 Thread Paul Eggert
On 2/6/23 18:30, Paul Eggert wrote: 1. Since the nullptr issue affects C++ so much (something I wasn't aware of until now), I'm inclined to rename the module from c-nullptr to nullptr as was hinted earlier. It's not just C so the "c-" is a bit misleading. 2. The issues you mentioned about C++

Re: Gnulib and nullptr

2023-02-06 Thread Paul Eggert
On 2/6/23 15:16, Bruno Haible wrote: Ignoring or underestimating the "barrier to entry" issue was my biggest mistake in GNU clisp development so far. Fair enough, but surely there are differences between the clisp and Gnulib cases. In C++ there are more advantages to nullptr (so more of a pr

Re: Gnulib and nullptr

2023-02-06 Thread Bruno Haible
Paul Eggert wrote: > > The diffutils patch shows that the possible bugs had already been caught > > Sure, but the idea is to make such bugs less likely in the future, by > encouraging the use of nullptr now. The gain here is small (it's only varargs and contrived cases), whereas ... > > 2) We

Re: Gnulib and nullptr

2023-02-06 Thread Dmitrii Pasechnik
On Mon, Feb 06, 2023 at 04:22:46PM -0500, Jeffrey Walton wrote: > On Sun, Feb 5, 2023 at 9:45 PM Paul Eggert wrote: > > > > On 2023-02-05 18:00, Bruno Haible wrote: > > > Why call it 'c-nullptr', not 'nullptr'? > > > > I was worried about C++, not that I know much about it, and operated by > > ana

Re: Gnulib and nullptr

2023-02-06 Thread Jeffrey Walton
On Sun, Feb 5, 2023 at 9:45 PM Paul Eggert wrote: > > On 2023-02-05 18:00, Bruno Haible wrote: > > Why call it 'c-nullptr', not 'nullptr'? > > I was worried about C++, not that I know much about it, and operated by > analogy with the name of m4/c-bool.m4. If 'nullptr' is a better name > then let's

Re: Gnulib and nullptr

2023-02-06 Thread Paul Eggert
On 2/5/23 16:57, Bruno Haible wrote: The diffutils patch shows that the possible bugs had already been caught Sure, but the idea is to make such bugs less likely in the future, by encouraging the use of nullptr now. The last platform in which pointers and integers were passed different

Re: Gnulib and nullptr

2023-02-06 Thread Bruno Haible
Paul Eggert wrote: > > Why call it 'c-nullptr', not 'nullptr'? > > I was worried about C++, not that I know much about it, and operated by > analogy with the name of m4/c-bool.m4. OK, I see. So the prefix 'c-' in 'c-bool' and 'c-nullptr' means something like "ISO C standard compliant". We could

Re: Gnulib and nullptr

2023-02-06 Thread Simon Josefsson via Gnulib discussion list
Bruno Haible writes: > Therefore, I would be in favour of EITHER > * doing this when the community as a whole has adopted 'nullptr' in C, i.e. > this keyword is no longer something that is new to an average newcomer, > (even if that's only 10 years from now), > OR > * doing the change only in

Re: Gnulib and nullptr

2023-02-05 Thread Paul Eggert
On 2023-02-05 18:00, Bruno Haible wrote: Why call it 'c-nullptr', not 'nullptr'? I was worried about C++, not that I know much about it, and operated by analogy with the name of m4/c-bool.m4. If 'nullptr' is a better name then let's switch to it. I assume we'd also switch the file names, the

Re: Gnulib and nullptr

2023-02-05 Thread Bruno Haible
Paul Eggert wrote: > the new c-nullptr module Why call it 'c-nullptr', not 'nullptr'?

Re: Gnulib and nullptr

2023-02-05 Thread Bruno Haible
Paul Eggert wrote: > Assuming this works out, ... Bjarni's report indicates that we need unit tests for this module. 2023-02-05 Bruno Haible c-nullptr: Add tests. * tests/test-nullptr.c: New file. *

Re: Gnulib and nullptr

2023-02-05 Thread Bruno Haible
Paul Eggert wrote: > To support an approximation to C23's nullptr keyword I installed the > attached patch into Gnulib. Thanks for that. > at some point I would like to change Gnulib > itself to prefer nullptr to NULL, due to nullptr's somewhat-better > properties. There's no rush of course.

Gnulib and nullptr

2023-02-05 Thread Paul Eggert
To support an approximation to C23's nullptr keyword I installed the attached patch into Gnulib. To test it a bit I'm using the new c-nullptr module in GNU diffutils, by preferring nullptr to NULL in the diffutils source. See: https://git.savannah.gnu.org/cgit/diffutils.git/commit/?id=09f8e2b0