On Wed, Dec 18, 2013 at 06:09:40AM -0700, Eric Blake wrote:
On 12/18/2013 02:35 AM, Martin Kletzander wrote:
> When test-locking is enabled, CFLAGS have -Dbool=char, which makes
Huh? bool should never be defined to char in CFLAGS; it should only be
replaced if gnulib thinks the compiler is too old.
Gnulib doesn't do that, it's our configure.ac thing (but I must say I
don't know whether that's copied from somewhere or not) introduced in
6962a2dd7e:
AC_ARG_ENABLE([test-locking],
[AS_HELP_STRING([--enable-test-locking],
[thread locking tests using CIL @<:@default=no@:>@])],
[case "${enableval}" in
yes|no) ;;
*) AC_MSG_ERROR([bad value ${enableval} for test-locking option]) ;;
esac],
[enableval=no])
enable_locking=$enableval
if test "$enable_locking" = "yes"; then
LOCK_CHECKING_CFLAGS="-Dbool=char -D_Bool=char -save-temps"
AC_SUBST([LOCK_CHECKING_CFLAGS])
fi
AM_CONDITIONAL([WITH_CIL],[test "$enable_locking" = "yes"])
> pipefd[bool] fail (obviously). Forcing the subscript to be bool
by
> double negation fixes the build breaker.
I don't get how this could possibly make a difference. The 'output'
variable is declared bool, and then only ever assigned 'false' or
'true', which if bool is replaced by gnulib are still guaranteed to be 0
and 1, so using it directly as an array index is still safe.
But the thing is that due to -Dbool=char the variable is declared
char, not bool.
>
> Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
> ---
>
> Notes:
> I still can't build with '--enable-test-locking' and I'm not
sure this
> is the proper way to fix it. Also, the code wasn't touched for
> months, so I'm not pushing it as a build-breaker.
NACK. I need more details about the actual failure you are seeing, but
this is not the right patch.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org