View Issue Details

IDProjectCategoryView StatusLast Update
0000234Perl for OS/2Bugpublic2020-08-24 03:11
Reporterydario Assigned Topsmedley  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Summary0000234: perl 5.10.0 requires lang=en_us
Descriptionif lang is not en_us, every number is translated to current locale, so most functions are failing.
TagsNo tags attached.

Activities

ydario

2008-01-30 15:36

reporter   ~0000828

the output is similar to ticket 225

Steven Levine

2013-12-29 22:17

manager   ~0002624

All builds other than Ilya's 5.8 appear to suffer from this defect. It appears that for 5.16.3, the problem is located in S_force_version near toke.c:2202 which says:

#ifdef USE_LOCALE_NUMERIC
        char *loc = savepv(setlocale(LC_NUMERIC, NULL));
        setlocale(LC_NUMERIC, "C");
#endif
            s = scan_num(s, &pl_yylval);
#ifdef USE_LOCALE_NUMERIC
        setlocale(LC_NUMERIC, loc);
        Safefree(loc);
#endif

This might be a configuration error. I would expect USE_LOCALE_NUMERIC to be defined.

Steven Levine

2013-12-29 23:26

manager   ~0002626

Turns out it's probably not a configuration error. It's more likely a kLIBC nit. Perl builds with locale.h which defines

#define LC_MONETARY 2 /* bird: was 3 */
#define LC_NUMERIC 3 /* bird: was 4 */

kLIBC builds set_locale with unidef.h which defines

#define LC_NUMERIC 2
#define LC_MONETARY 3

The Warp4 toolkit unidef.h and locale.h define

      #define LC_NUMERIC 2
      #define LC_MONETARY 3

I plan to update my local copies of kLIBC's locale.h to

#define LC_NUMERIC 2
#define LC_MONETARY 3

to match what everything I use regularly use. This should fix the next Perl build because LC_NUMERIC will now work as expected.

Just to keep things interesting, the antique emx gcc toolkit locale.h and unidef.h have yet another set of dueling definitions. This is probably where the kLIBC code came from and sorta explains why the defect exists.

Steven Levine

2013-12-30 18:44

manager   ~0002628

Appears to be fully resolved by

  http://smedley.id.au/tmp/perle147.zip

ydario

2013-12-30 18:52

reporter   ~0002629

With header fix?

psmedley

2013-12-30 20:15

administrator   ~0002632

yes - header fix only per Steven's suggestion

psmedley

2013-12-30 20:15

administrator   ~0002633

Note the fix above is for Perl 5.16.3

psmedley

2013-12-31 01:11

administrator   ~0002635

http://smedley.id.au/tmp/perl-5.16.3-os2-20131231.zip has a full rebuild - turns out some modules needed to be rebuilt too.

psmedley

2013-12-31 01:19

administrator   ~0002636

I believe this is resolved in the 31st December build

Issue History

Date Modified Username Field Change
2008-01-30 15:33 ydario New Issue
2008-01-30 15:36 ydario Note Added: 0000828
2008-12-01 12:37 psmedley Project Other Unix Port => Perl for OS/2
2013-12-29 22:17 Steven Levine Note Added: 0002624
2013-12-29 23:26 Steven Levine Note Added: 0002626
2013-12-30 18:44 Steven Levine Note Added: 0002628
2013-12-30 18:52 ydario Note Added: 0002629
2013-12-30 20:15 psmedley Note Added: 0002632
2013-12-30 20:15 psmedley Note Added: 0002633
2013-12-31 01:11 psmedley Note Added: 0002635
2013-12-31 01:19 psmedley Note Added: 0002636
2013-12-31 01:19 psmedley Assigned To => psmedley
2013-12-31 01:19 psmedley Status new => feedback
2014-02-08 06:37 psmedley Status feedback => resolved
2014-02-08 06:37 psmedley Resolution open => fixed
2020-08-24 03:11 psmedley Status resolved => closed