Interesting.
Try adding `set -x' before and `set +x' after the parsing loop.
Please report exact shell version used, the exact version of coreutils
(expr), whether configure restarts under another shell (try `sh -x
configure ...' to find that out: if it restarts, debug output stops at a
restart line, before the normal checks).
It may help if you also post the configure script (or tell which package
it came from), which Autoconf version it was produced with, and whether
this happens with more than just this one package.
The configure line which caused the problems was
../configure -C --prefix=/usr "CXXFLAGS=-Wall -Werror" "CFLAGS=-Wall
- -Werror"