Stepan Kasal <[EMAIL PROTECTED]> writes: > The main goal is not to catch non-canonical values. The goal is to > catch evil values which would break the code below.
OK, but in that case let's use a different diagnostic, e.g., "invalid value of canonical host". (That's a better diagnostic anyway, since mentioning ac_cv_$1 is a bit obscure.) >> Also, the [!-] doesn't look portable to me. > > I thought that it was a portable way to match any character other than "-". The Autoconf manual warns against it (look for "negated character classes"). > If I were wrong, we can use: > > ac_good=: > case $ac_cv_$1 in > -*) ac_good=false;; > *-?*-?*) ;; > *) ac_good=false;; > esac > ac_good || AC_MSG_ERROR([non-canonical value of ac_cv_$1: $ac_cv_$1]) This would be a bit cleaner: case $ac_cv_$1 in -*) false;; *-?*-?*) : ;; *) false;; esac || AC_MSG_ERROR([non-canonical value of ac_cv_$1: $ac_cv_$1]) but I'm afraid I still don't understand why it's needed. Why is it important to reject an empty cpu? Also, why are the ?* patterns needed? They don't reject all instances of empty vendors or os, since (for example) *-?*-?* matches the value abc---def-ghi.
