This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: enable Ada test suite

On Oct 29, 2003, "Zack Weinberg" <> wrote:

> I see extensive use of this construct in

It looks hopelessly unportable :-(  If it's meant to be portable, it
almost has to be rewritten from scratch.

There's a shell portability guide in the autoconf manual.  Some notes
I can point out:

It uses (and the patch under discussion introduces) shell functions
that are regarded as an almost-portable feature.  Not all shells
support shell functions, but all known systems offer at least one
built-in shell that supports them.

It doesn't seem very careful with regards to quoting of variable
expansions to prevent accidental word-splitting.  In particular, $* is
generally to be avoided.  ${1+"$@"} is the portable and correct
choice, except when you actually want word-splitting.

Using $* as a command is a very bad idea.  Not only would "$@" be a
far better choice, but also there are shells that break when an
argument expression expands to the command name.  You're better off
with something like: cmd=$1; shift; $cmd ${1+"$@"}

Instead of mkdir -p, it would be more portable to use the
`${CONFIG_SHELL-/bin/sh} mkinstalldirs' command.

The sed commands would break should $dir (computed from `pwd`) contain
a comma.

cp -pr is not portable.  GCC uses one of tar, cpio or cp to the same
effect, depending on configure tests.

[ ... -ne ... ] is not as portable as [ ... != ... ]

cut, comm and wc are not portable, but I suppose they're ok to require
in this case.

Other than that, it looks sort of reasonable.

Alexandre Oliva   Enjoy Guarana', see
Red Hat GCC Developer                 aoliva@{,}
CS PhD student at IC-Unicamp        oliva@{,}
Free Software Evangelist                Professional serial bug killer

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]