Subject: | Conflict between LC_* constants of Locale::Gettext and POSIX in perl 5.10 |
Date: | Wed, 7 May 2008 10:08:55 +0200 |
To: | bug-Gettext [...] rt.cpan.org |
From: | Raphael Hertzog <hertzog [...] debian.org> |
Hello,
in Debian bug #479803 (http://bugs.debian.org/479803) Aaron M. Ucko
reported us that the LC_* symbols are exported by default
by both Locale::Gettext and POSIX. Up to perl 5.10 this was fine as their
definition was strictly identic. Now we get such warnings:
$ perl -MLocale::gettext -MPOSIX -e ''
Prototype mismatch: sub main::LC_ALL: none vs () at -e line 0
Prototype mismatch: sub main::LC_NUMERIC: none vs () at -e line 0
Prototype mismatch: sub main::LC_TIME: none vs () at -e line 0
Prototype mismatch: sub main::LC_MONETARY: none vs () at -e line 0
Prototype mismatch: sub main::LC_CTYPE: none vs () at -e line 0
Prototype mismatch: sub main::LC_MESSAGES: none vs () at -e line 0
Prototype mismatch: sub main::LC_COLLATE: none vs () at -e line 0
$ perl -MPOSIX -MLocale::gettext -e ''
Constant subroutine main::LC_CTYPE redefined at /usr/share/perl/5.10/Exporter.pm line 66.
at -e line 0
Prototype mismatch: sub main::LC_CTYPE () vs none at /usr/share/perl/5.10/Exporter.pm line 66.
at -e line 0
Constant subroutine main::LC_NUMERIC redefined at /usr/share/perl/5.10/Exporter.pm line 66.
at -e line 0
Prototype mismatch: sub main::LC_NUMERIC () vs none at /usr/share/perl/5.10/Exporter.pm line 66.
at -e line 0
Constant subroutine main::LC_TIME redefined at /usr/share/perl/5.10/Exporter.pm line 66.
at -e line 0
Prototype mismatch: sub main::LC_TIME () vs none at /usr/share/perl/5.10/Exporter.pm line 66.
at -e line 0
Constant subroutine main::LC_COLLATE redefined at /usr/share/perl/5.10/Exporter.pm line 66.
at -e line 0
Prototype mismatch: sub main::LC_COLLATE () vs none at /usr/share/perl/5.10/Exporter.pm line 66.
at -e line 0
Constant subroutine main::LC_MONETARY redefined at /usr/share/perl/5.10/Exporter.pm line 66.
at -e line 0
Prototype mismatch: sub main::LC_MONETARY () vs none at /usr/share/perl/5.10/Exporter.pm line 66.
at -e line 0
Constant subroutine main::LC_MESSAGES redefined at /usr/share/perl/5.10/Exporter.pm line 66.
at -e line 0
Prototype mismatch: sub main::LC_MESSAGES () vs none at /usr/share/perl/5.10/Exporter.pm line 66.
at -e line 0
Constant subroutine main::LC_ALL redefined at /usr/share/perl/5.10/Exporter.pm line 66.
at -e line 0
Prototype mismatch: sub main::LC_ALL () vs none at /usr/share/perl/5.10/Exporter.pm line 66.
at -e line 0
Since I believe that we should only have one module providing the values for
those variables and since POSIX is a core module I wrote the attached patch so
that Locale::Gettext merely re-exports the LC_* constants coming from POSIX
instead of providing its own XS implementation of those constants. This will avoid
any further problem like this one.
I also attach a second patch that we apply in Debian, it's a trivial
documentation fix in the POD.
$ perl -v
This is perl, v5.10.0 built for i486-linux-gnu-thread-multi
$ uname -a
Linux rivendell 2.6.24-1-686 #1 SMP Sat Apr 19 00:37:55 UTC 2008 i686 GNU/Linux
Cheers,
--
Raphaël Hertzog -+- http://www.ouaza.com
Freexian : des développeurs Debian au service des entreprises
http://www.freexian.com
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.