bug-readline
[Top][All Lists]
Advanced

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

Re: readline does not compile anymore on HP-UX since d5f26b1287916c17903


From: Osipov, Michael (LDA IT PLM)
Subject: Re: readline does not compile anymore on HP-UX since d5f26b1287916c1790323965d46f5e0acad89155
Date: Tue, 17 Aug 2021 16:01:41 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0

Am 2021-08-17 um 15:11 schrieb Chet Ramey:
On 8/17/21 6:36 AM, Osipov, Michael (LDA IT PLM) wrote:
Folks,

+if test -n "$want_auto_cflags" ; then
+    AUTO_CFLAGS="-g ${GCC+-O2}"
+    STYLE_CFLAGS="${GCC+-Wno-parentheses} ${GCC+-Wno-format-security}"
+fi

This hunks seems not to be POSIX shell compliant.

It's absolutely POSIX shell compliant.

Both vars are set for me
on HP-UX because the expansion is incomplete.

The expansion is not incomplete. The gcc-specific options will be set if
the GCC variable has a value.

  According to [1] it has to be
$(GCC:+..} and not $(GCC+..}.

POSIX does not say that. What it says is:

"In the parameter expansions shown previously, use of the <colon> in the
format shall result in a test for a parameter that is unset or null;
omission of the <colon> shall result in a test for a parameter that is only
unset. "


I have changed ./configure locally and it
works with /bin/sh.

It sounds like you've found a bug in the HP-UX sh.

I assume that this should also work on any other POSIX compliant shell.

It doesn't mean the same thing. Maybe you should try adding a space between
the `+' and `-' to get around the sh bug.

Darn! Chet, you are absolutely right. According to the manpage of sh(1) on HP-Ux is is supposed to be POSIX compliant:
      ${parameter:+word}
                     If parameter is set and is nonnull, substitute word;
                     otherwise, substitute nothing.
...
      If the colon (:) is omitted from the above expressions, the shell only
      checks to determine whether or not parameter is set.

But is still logically doesn't add up. From ./configure:
if test $ac_compiler_gnu = yes; then
  GCC=yes
else
  GCC=
fi

So the variable is *always* set. Thus word is always substituted. I would expect no else branch in the if clause then I would competely agree with Chet. Removing the else block makes the sript works as expected.

What am I missing here?

Michael



reply via email to

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