Skip Menu |

This queue is for tickets about the Text-Unaccent CPAN distribution.

Report information
The Basics
Id: 21177
Status: open
Priority: 0/
Queue: Text-Unaccent

People
Owner: Nobody in particular
Requestors: mcummings [...] gentoo.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 1.01
  • 1.08
Fixed in: (no value)



Subject: patch for broken c code
Since sizeof(size_t) != sizeof(int), on amd64's in particular your typical build process will fail, most relevant during a make test (see below). This is the same issue as bug 5511, but since that was specifically marked for 1.01, I didn't want to step on their toes. Patch included to fix this, tested on a sparc, x86, and amd64 (all running gentoo linux) $ perl Makefile.PL && make test Checking if your kit is complete... Looks good Note (probably harmless): No library found for -liconv Writing Makefile for Text::Unaccent cp Unaccent.pm blib/lib/Text/Unaccent.pm /usr/bin/perl5.8.8 /usr/lib64/perl5/5.8.8/ExtUtils/xsubpp -typemap /usr/lib64/p erl5/5.8.8/ExtUtils/typemap Unaccent.xs > Unaccent.xsc && mv Unaccent.xsc Unacc ent.c x86_64-pc-linux-gnu-gcc -c -I. -fno-strict-aliasing -pipe -Wdeclaration-after-s tatement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -pipe -DVERSION=\"1.08 \" -DXS_VERSION=\"1.08\" -fPIC "-I/usr/lib64/perl5/5.8.8/x86_64-linux/CORE" -DH AVE_CONFIG_H Unaccent.c Unaccent.xs: In function 'XS_Text__Unaccent_unac_string': Unaccent.xs:71: warning: passing argument 5 of 'unac_string' from incompatible p ointer type Unaccent.xs: In function 'XS_Text__Unaccent_unac_string_utf16': Unaccent.xs:88: warning: passing argument 4 of 'unac_string_utf16' from incompat ible pointer type x86_64-pc-linux-gnu-gcc -c -I. -fno-strict-aliasing -pipe -Wdeclaration-after-s tatement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -pipe -DVERSION=\"1.08 \" -DXS_VERSION=\"1.08\" -fPIC "-I/usr/lib64/perl5/5.8.8/x86_64-linux/CORE" -DH AVE_CONFIG_H unac.c unac.c: In function 'unac_string': unac.c:13888: warning: passing argument 6 of 'convert' from incompatible pointer type unac.c:13892: warning: passing argument 4 of 'unac_string_utf16' from incompatib le pointer type Running Mkbootstrap for Text::Unaccent () chmod 644 Unaccent.bs rm -f blib/arch/auto/Text/Unaccent/Unaccent.so x86_64-pc-linux-gnu-gcc -shared -L/usr/local/lib64 Unaccent.o unac.o -o blib/a rch/auto/Text/Unaccent/Unaccent.so \ \ chmod 755 blib/arch/auto/Text/Unaccent/Unaccent.so cp Unaccent.bs blib/arch/auto/Text/Unaccent/Unaccent.bs chmod 644 blib/arch/auto/Text/Unaccent/Unaccent.bs PERL_DL_NONLAZY=1 /usr/bin/perl5.8.8 "-MExtUtils::Command::MM" "-e" "test_harnes s(0, 'blib/lib', 'blib/arch')" t/*.t t/unac....# Test 1 got: <UNDEF> (t/unac.t at line 24) # Expected: "ete" (removing accents from été (1)) # t/unac.t line 24 is: ok(unac_string("ISO-8859-1", "été"), "ete", "removing ac cents from été (1)"); # Test 2 got: <UNDEF> (t/unac.t at line 25) # Expected: "ete" (removing accents from été (2)) # t/unac.t line 25 is: ok(unac_string("ISO-8859-1", "été"), "ete", "removing ac cents from été (2)"); t/unac....FAILED tests 1-2 Failed 2/4 tests, 50.00% okay Failed Test Stat Wstat Total Fail List of Failed ------------------------------------------------------------------------------- t/unac.t 4 2 1-2 Failed 1/1 test scripts. 2/4 subtests failed. Files=1, Tests=4, 0 wallclock secs ( 0.01 cusr + 0.02 csys = 0.03 CPU) Failed 1/1 test programs. 2/4 subtests failed. make: *** [test_dynamic] Error 255
Subject: text-unaccent_size_t.diff
diff -ur Text-Unaccent-1.08/unac.c Text-Unaccent-1.08-mod/unac.c --- Text-Unaccent-1.08/unac.c 2004-10-17 12:00:36.000000000 -0700 +++ Text-Unaccent-1.08-mod/unac.c 2006-08-24 22:37:35.000000000 -0700 @@ -13881,9 +13881,9 @@ *out_lengthp = 0; } else { char* utf16 = 0; - int utf16_length = 0; + size_t utf16_length = 0; char* utf16_unaccented = 0; - int utf16_unaccented_length = 0; + size_t utf16_unaccented_length = 0; if(convert(charset, utf16be(), in, in_length, &utf16, &utf16_length) < 0) { return -1; diff -ur Text-Unaccent-1.08/Unaccent.xs Text-Unaccent-1.08-mod/Unaccent.xs --- Text-Unaccent-1.08/Unaccent.xs 2004-12-29 03:45:18.000000000 -0800 +++ Text-Unaccent-1.08-mod/Unaccent.xs 2006-08-24 22:35:57.000000000 -0700 @@ -35,7 +35,7 @@ #include "unac.h" static char* buffer; -static int buffer_length; +static size_t buffer_length; static void unac_debug_print(const char* message, void* data) {
Just a quick note that this also helps for making it not segfault on mac os x (64bit) as well.