autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A simplification of _AC_CANONICAL_SPLIT


From: Paul Eggert
Subject: Re: A simplification of _AC_CANONICAL_SPLIT
Date: Fri, 19 Aug 2005 14:01:05 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Stepan Kasal <address@hidden> 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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]