Re: Portability problems of "Usual Tools" not described in manual

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Russ Allbery on 3/12/2009 10:32 PM:
> (This is Debian bug http://bugs.debian.org/466990 against the autoconf-doc
> Debian package.)
> 
> Attached is a bug report from a Debian user that notes some additional
> shell portability issues that aren't included in the Autoconf 2.63
> documentation.  (I have not personally verified the reported behavior.)

Thanks for the report.  I would like to verify these claims before
applying any patches, but agree that they are probably worth mentioning.

> 1. sed behaves entirely unpredictable on lines that are not newline-terminated.

Confirmed.  POSIX states that sed is only required to operate on text
files, and also that a file without a trailing newline is not a text file.
 Therefore, there are no requirements on how sed must behave on a file
without a trailing newline.  I'll probably just add a mention to that in
the paragraph that mentions that sed cannot operate on lines longer than
about 4000 bytes, also due to the POSIX restriction that sed need only
handle text files.

> 2. On HP-UX 11.23, regexp matching with expr does not allow multiple sub-
>    expressions:
> 
>      bash-3.1$ expr 'Xfoo' : 'X\(f\(oo\)*\)$'
>      expr: More than one '\(' was used.

Ouch.  I don't have access to HP-UX to verify, but this means we need to
audit autoconf source to make sure we don't violate this restriction.

> 3. On GNU/Linux the regexp "$", when used with older versions of expr,
>    matches newlines embedded in the match string:
> 
>      bash-3.1$ baz='foo
>      > bar'
>      bash-3.1$ expr "X$baz" : 'X\(foo\)$' || echo baz
>      foo

I'm assuming this was from an older version of coreutils?  Can someone
determine 'expr --version' in the broken case, to see when it was fixed?

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@xxxxxxx
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkm/txQACgkQ84KuGfSFAYB0rgCeJ6Rkvq236jYknGwfKP43Ly9L
BCkAoLC1NTOI2SEs3OPYJGViuYqN+N5K
=xtgJ
-----END PGP SIGNATURE-----


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux