[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gettext.m4 bug
Re: gettext.m4 bug
Tue, 21 Nov 2006 07:08:57 -0700
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:22.214.171.124) Gecko/20061025 Thunderbird/126.96.36.199 Mnenhy/0.7.4.666
-----BEGIN PGP SIGNED MESSAGE-----
According to Bruno Haible on 11/21/2006 6:53 AM:
> Thanks for reporting this. Your patch works, but I'm applying a different
> patch, for maintainability reasons.
> --- 137,150 ----
> dnl to fall back to GNU NLS library.
> if test $gt_api_version -ge 3; then
> ! gt_revision_test_code='
> #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
> #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
> + changequote(,)dnl
> typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
> ! changequote([,])dnl
> ! '
The autoconf manual recommends against changequote when possible, because
of a tendency to misuse it (such as forgetting to restore the quotes),
although it looks like you managed to get it right here. Furthermore, you
used a raw m4 macro changequote; inside of autoconf, you should instead be
using the m4sugar wrapper m4_changequote (as it is, how does this even
work? m4sugar intentionally disables raw m4 macro names so that they will
not be inadvertently expanded).
One other thought - would it be worth making this code rely on
AC_COMPUTE_INT, rather than open-coding your own checker based on typedef
array size, to take advantage of the portability tricks that autoconf has
learned over the years about causing a guaranteed compile failure when
checking for an integer result?
Life is short - so eat dessert first!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----