This is the mail archive of the mailing list for the binutils 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: [RFA v2] Make it easy to make --disable-werror the default for both binutils and gdb

On Tue, 3 Jun 2014, Joel Brobecker wrote:

> This is V2 of the patch series. Hopefully, I incorporated all comments
> made so far. The changes compared to the previous version are:
>   . Use "-a" instead of "&&" in the test expression; (H-P)

 I think Hans-Peter's suggestion was the other way round, its "&&" that is 
portable while "-a" is likely not to work with non-GNU `test' or with 
plain Bourne shells (where it is a builtin).  This is what the autoconf 
manual has to say about it in its portability section:

     The `test' program is the way to perform many file and string
     tests.  It is often invoked by the alternate name `[', but using
     that name in Autoconf code is asking for trouble since it is an M4
     quote character.

     The `-a', `-o', `(', and `)' operands are not portable and should
     be avoided.  Thus, portable uses of `test' should never have more
     than four arguments, and scripts should use shell constructs like
     `&&' and `||' instead.  If you combine `&&' and `||' in the same
     statement, keep in mind that they have equal precedence, so it is
     often better to parenthesize even when this is redundant.  For

          # Not portable:
          test "X$a" = "X$b" -a \
            '(' "X$c" != "X$d" -o "X$e" = "X$f" ')'

          # Portable:
          test "X$a" = "X$b" &&
            { test "X$c" != "X$d" || test "X$e" = "X$f"; }


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