This is the mail archive of the gcc-patches@gcc.gnu.org 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 RFA: Support --enable-build-with-cxx at top level


Ralf Wildenhues wrote:

>The most conservative quoting is something like
>   x"$withval"
> 
> as some old test programs (or shells) do the wrong thing when the
> arguments start with a hyphen.  

  The way I interpreted this extract from libtool/tests/sh.test (which I
happened to run into just the other day):

# Check for using test X... instead of test "X...
if $EGREP -n -e 'test[  ]+(![   ])?(-.[         ]+)?X' $scripts; then
  echo "use \`test \"X...\"' instead of \`test X'"
  status=$EXIT_FAILURE
fi

# Check for using test $... instead of test "$...
if $EGREP -n -e 'test[  ]+(![   ])?(-.[         ]+)?X?\$' $scripts; then
  echo "use \`test \"\$...\"' instead of \`test \$'"
  status=$EXIT_FAILURE
fi

... was that both the 'x' and the $variable should be inside the quotes when
using this syntax.  Did I misunderstand?

    cheers,
      DaveK


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