Subject: bug#51457: closed (Re: bug#51457: grep - fails to compile after following steps in README-hacking)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 24 Nov 2021 02:42:02 +0000

Your bug report

#51457: grep - fails to compile after following steps in README-hacking

which was filed against the grep package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
51457: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=51457
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#51457: grep - fails to compile after following steps in README-hacking
From: Paul Eggert <[email-masked]>
To: Duncan Roe <[email-masked]>
Cc: [email-masked]
Date: Tue, 23 Nov 2021 18:41:12 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

The original bug reported in 51457 seems to have been fixed, so I'm 
closing the bug report.

Subject: grep - fails to compile after following steps in README-hacking
From: Duncan Roe <[email-masked]>
To: [email-masked]
Cc: Duncan Roe <[email-masked]>
Date: Thu, 28 Oct 2021 18:14:44 +1100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

I downloaded grep commit f0d97db2. Bypassed export GNULIB_SRCDIR. Did
./bootstrap, git submodule..., git commit...., ./configure and make -j17.

Got this error:
>   CC       dirname-lgpl.o
> In file included from basename-lgpl.c:25:
> ./string.h:624:5: error: token "@" is not valid in preprocessor expressions
>   624 | #if @GNULIB_FREE_POSIX@
Also:
> make[3]: *** Waiting for unfinished jobs....
> In file included from ./localeinfo.h:24,
>                  from localeinfo.c:24:
> ./wchar.h:687:5: error: token "@" is not valid in preprocessor expressions
>   687 | #if @GNULIB_FREE_POSIX@

s/@GNULIB_FREE_POSIX@/1/ in string.h and wchar.h. Now:
>   CC       malloc/dynarray_at_failure.o
> In file included from basename-lgpl.c:25:
> ./string.h:625:7: error: token "@" is not valid in preprocessor expressions
>   625 | # if (@REPLACE_FREE@ && !defined free \
Also:
> In file included from ./localeinfo.h:24,
>                  from localeinfo.c:24:
> ./wchar.h:688:7: error: token "@" is not valid in preprocessor expressions
>   688 | # if (@REPLACE_FREE@ && !defined free \

s/@REPLACE_FREE@/0/ in string.h and wchar.h. Now grep builds.

I went back to the clone and tried ./bootstrap &c. but without updating gnulib.
That builds.

Ran `git bisect` in gnulib. The problem starts with commit a4a2d039:
> Author: Paul Eggert <[email-masked]>
> Date:   Tue Sep 7 17:51:39 2021 -0700
>
>     string, wchar: avoid some namespace pollution
>
>     * lib/string.in.h, lib/wchar.in.h:
>     (free): Declare by hand instead of including stdlib.h.
>     This avoids some namespace pollution.  It should also avoid some
>     nested-include problems described by Lucy Phipps in:
>     https://lists.gnu.org/r/bug-gnulib/2021-09/msg00018.html
>     * modules/string, modules/wchar:
>     (Depends-on): Add stdlib, so that REPLACE_FREE has the right value.
>     (Makefile.am): Replace @REPLACE_FREE@ when creating the include file.

Diffed with previous version but my grasp of autotools is inadequate to figure
out what needs to be done.

Over to you,

Cheers ... Duncan.