This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] libjava: avoid using escape sequence with undefined behaviour in echo
Paolo Bonzini writes:
> >>>I do think requiring a POSIX-compliant shell is reasonable.
> >>
> >>POSIX compliance wouldn't help much here, since it makes the issue
> >>implementation-defined. A better alternative might be to use printf
> >>instead.
> >
> > Agreed; I failed to verify the original claim that ash was non-compliant
> > in this regard.
>
> I'm sorry for having put out a false claim. I should have read the
> standard. However, this undefined behavior apparently rules out ash
> from running configure
>
> sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
> /^X\(\/\/\)[^/].*/{ s//\1/; q; }
> /^X\(\/\/\)$/{ s//\1/; q; }
> /^X\(\/\).*/{ s//\1/; q; }
> s/.*/./; q'
>
> (no I don't want to know what this does).
no, it does not, because it doesn't use \1 in an argument to the *echo*
builtin.
Matthias