[MPlayer-dev-eng] [PATCH] clean up tests in configure

Diego Biurrun diego at biurrun.de
Mon Jul 4 20:11:21 CEST 2005


On Sat, Jul 02, 2005 at 12:20:28AM +0300, Ivan Kalvachev wrote:
> On 6/30/05, Zoltan Hidvegi <mplayer at hzoli.2y.net> wrote:
> > Diego Biurrun wrote:
> > >
> > > I don't agree in principle but I don't see how -a/-o is less readable than
> > > &&/||.  It's shorter and faster so it should be preferred.
> > 
> > There is hardly any speed difference between -a/-o vs. &&/|| if you
> > use {...} for scoping instead of (...).  This is getting a bit off
> > topic, but the problem with -a/-o is that it can be ambiguous:
> > 
> > test "$foo" = "$bar" -a -z "$x"
> > 
> > And suppose that foo=-a bar=-o x=1, so it expands to:
> > 
> > test -n = -a -a -z 1
> > 
> > And this can be parsed as test (-n =) -a (-a -z 1) which is a syntax
> > error.  Sure, this does not happen often, and may never happen in
> > mplayer's configure script, but exactly because of these ambiguities
> > POSIX does not define -a/-o and recommends the use of &&/|| instead.
> > And also that's why you often see
> > 
> > test "x$foo" = "x$bar"
> > 
> > which ensures that there is no ambiguity.
> 
> I think this is enough reason to reject the patch.

I disagree unless you can come up with a case where this might fail in
practise and not just in theory.

> As for the rest of 'cleanups' I think that they could be trown away in
> favor of the proposed change from () to {} . {faster speed while more
> readable}.

I think the other changes apart from -a/-o and uncontroversial so I'll
apply these anyway.

Diego




More information about the MPlayer-dev-eng mailing list