autoconf
[Top][All Lists]
Advanced

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

Re: expr ... and `expr ...` return different results on QNX 4.2.5


From: Paul Eggert
Subject: Re: expr ... and `expr ...` return different results on QNX 4.2.5
Date: Thu, 30 Nov 2000 10:03:12 -0800 (PST)

> From: Akim Demaille <address@hidden>
> Date: 30 Nov 2000 09:48:35 +0100

> Pavel> I don't know how many times we rely on similar
> Pavel> constructs. There may be more serious problems. To fix them, we
> Pavel> should never use $? after _any_ assignments.
> 
> That's really bad in theory, I hope its impact is not too strong.  For
> instance in the case you mention, the error message is still
> displayed, which softens the issue.

I should mention that I dimly recall another host type that had this
problem, long ago.  I believe it was a BSD variant.  When I ran into
this problem, I looked at all the shell scripts that it broke,
blanched, and told the users involved to get a working shell instead,
as it was just not worth the effort to work around that particular
brain damage.  I suggest doing the same here.

> ac_output=`command; echo $? >confstat`; ac_status=`cat confstat`
> 
> ?  Gross.

Yes.  I wouldn't bother doing that.  Just tell them to get a working
shell.  You have to draw the line somewhere.

If you want to quote chapter and verse, you can tell them that
POSIX.2-1992 section 3.9.1 page 136 lines 755-759 says that x=`FOO`
must yield FOO's exit status.  Any shell that doesn't do this is
seriously broken.

It wouldn't hurt to put something like the following at the start of
"configure" to test the current shell:

if x=`false`; then
  echo >&2 "$0: fatal error: /bin/sh mishandles assignment exit status"
  exit 1
fi



reply via email to

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