[Top][All Lists]

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

Re: [PATCH] Fix treatment of --enable-assert in AC_HEADER_ASSERT

From: Paolo Bonzini
Subject: Re: [PATCH] Fix treatment of --enable-assert in AC_HEADER_ASSERT
Date: Mon, 08 Dec 2008 10:47:42 -0600
User-agent: Thunderbird (Macintosh/20081105)

> I've applied your suggestions, and also added a warning
> for the pathological case where a user does something like
> "--enable-assert=kj".  It seems unnecessary, but probably
> doesn't hurt.  How does one typically deal with that
> sort of (ab)usage?  And why does "--disable-assert=kj" cause
> configure to throw an "invalid feature name" warning,
> but "--enable-assert=kj" works okay.  Is that a bug or
> expected behavior?

The error message is a bug, but the error is right because
--disable-assert is just a synonym for --enable-assert=no (and as such
cannot accept parameters).

I'll apply your patch later, just note that...

>    AC_ARG_ENABLE([assert],
> +    AS_HELP_STRING([--disable-assert],[turn off assertions]),
> +    AS_IF([test "x$enableval" = xno],
> +      AC_DEFINE([NDEBUG], [1], [Define to 1 if assertions should be 
> disabled.]),
> +      [test "x$enableval" != xyes],
> +      AC_MSG_WARN([invalid argument supplied to --enable-assert.])
> +      [enable_assert=no]
> +    )dnl
> +  )
> +  AC_MSG_RESULT([$enable_assert])

... all arguments of AC_ARG_ENABLE have to be quoted (the number of
cases in which you do not quote arguments that invoke macros, can be
counted on a single hand probably).


reply via email to

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