Hi,
There's a new warning in perl-5.38.0 in relation to locales that have the potential to crash perl. On Windows:
> perl -MPOSIX="setlocale" -le "$loc = setlocale( LC_ALL, 'Korean_Kore
+a.949' ); print 'LOCALE: ' . $loc;"
Locale 'Korean_Korea.949' is unsupported, and may crash the interprete
+r.
LOCALE: Korean_Korea.949
Note that there's no accompanying info indicating which line of code triggered the error.
Is that a bug ? Is there some documentation that definitively answers that question ?
Are there any precedents of other warnings that also don't provide that information ?
The line number info is suppressed because the diagnostic message terminates with "\n".
The warning originates from locale.c, and removing the "\n" enables the line number info to be provided. Inline::C demo:
### try.pl ###
use strict;
use warnings;
use Inline C => <<'EOC';
void foo() {
Perl_ck_warner_d(aTHX_ packWARN(WARN_LOCALE),
"Locale is unsupported, and may crash the"
" interpreter.\n"
);
}
void bar() {
Perl_ck_warner_d(aTHX_ packWARN(WARN_LOCALE),
"Locale is unsupported, and may crash the"
" interpreter"
);
}
EOC
foo();
bar();
__END__
Outputs:
Locale is unsupported, and may crash the interpreter.
Locale is unsupported, and may crash the interpreter at try.pl line 24
+.
I suppose I could just file an issue, and see what the response is.
But anyway, I'm interested to know how others here assess this issue.
Cheers,
Rob
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.