[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug in __GNU_GETTEXT_SUPPORTED_REVISION macro definition in gettext.
From: |
Bruno Haible |
Subject: |
Re: Bug in __GNU_GETTEXT_SUPPORTED_REVISION macro definition in gettext.m4 |
Date: |
Sat, 16 Jan 2010 21:37:20 +0100 |
User-agent: |
KMail/1.9.9 |
Hi,
Martin Jacobs wrote:
> file m4/gettext.m4 defines
>
> #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
> #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
> #endif
> changequote(,)dnl
> typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
> changequote([,])dnl
>
> This makes test compilation fail on systems that are lacking
> __GNU_GETTEXT_SUPPORTED_REVISION in libintl.h because test
> code calls this macro with argument value 0 which is expanded
> to 0 and makes array declaration fail with negative array
> dimension.
This is as expected. Systems that don't have __GNU_GETTEXT_SUPPORTED_REVISION
defined in libintl.h are, for example, Solaris or glibc 2.0 systems. These
systems support only the first revision of GNU .mo files, namely major = 0,
minor = 0, and don't support formatstring macros in msgid or msgstr.
> Changing that macro definition to
>
> #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 1 : -1)
>
> makes configure and compilation happy and work fine.
But then the use of <inttypes.h> formatstring macros in msgid or msgstr
will not work, i.e. the program will malfunction.
If you have been compiling a program on such a platform, you need to install
GNU gettext in order to get the support for <inttypes.h> formatstring macros
in msgid.
Bruno