bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ptrdiff_t overflow checks for malloc-posix etc.


From: Paul Eggert
Subject: Re: ptrdiff_t overflow checks for malloc-posix etc.
Date: Sun, 18 Apr 2021 11:37:43 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

On 4/18/21 5:13 AM, Bruno Haible wrote:

* m4/realloc.m4 (_AC_FUNC_REALLOC_IF):
Don’t start with a newline.

This is not very robust. We usually don't care about newlines or useless
indentation in the generated configure.ac any more.

Yes, I made that change only because I ran into some shell syntax error and the change fixed it. I don't recall what the error was and can't reproduce it now, so the attached first patch reverts that change.

If we run into further problems in this area, though, perhaps the patch should go back in. Autoconf (which _AC_FUNC_REALLOC_IF is taken from) does care about leading newlines, and even if we have a different API in Gnulib surely it's better to stick to the Autoconf API in Autoconf-replacing macros.

  if test $REPLACE_REALLOC = 0; then
    _AC_FUNC_REALLOC_IF([], [REPLACE_REALLOC=1])
  fi

I confess I don't like the style as much: it makes the shell code a bit less readable, at least to me. But it appears that this style isn't needed anyway.

I noticed some other incompatibilities with Autoconf _AC_FUNC_REALLOC_IF etc. and fixed them too in the attached first patch.

The second patch switches from AS_IF to AS_CASE as that's cleaner in the Gnulib version.

Attachment: 0001-malloc-gnu-etc.-sync-better-with-Autoconf.patch
Description: Text Data

Attachment: 0002-malloc-gnu-etc.-prefer-AS_CASE-to-woolly-AS_IF.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]