{
dTHR;
if (ckWARN(WARN_UNINITIALIZED))
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
}
return TRUE;
case SVt_IV:
#define vivify_defelem Perl_vivify_defelem
#define vivify_ref Perl_vivify_ref
#define wait4pid Perl_wait4pid
+#define report_uninit Perl_report_uninit
#define warn Perl_warn
#define vwarn Perl_vwarn
#define warner Perl_warner
#define vivify_defelem(a) Perl_vivify_defelem(aTHX_ a)
#define vivify_ref(a,b) Perl_vivify_ref(aTHX_ a,b)
#define wait4pid(a,b,c) Perl_wait4pid(aTHX_ a,b,c)
+#define report_uninit() Perl_report_uninit(aTHX)
#define vwarn(a,b) Perl_vwarn(aTHX_ a,b)
#define vwarner(a,b,c) Perl_vwarner(aTHX_ a,b,c)
#define watch(a) Perl_watch(aTHX_ a)
#define vivify_ref Perl_vivify_ref
#define Perl_wait4pid CPerlObj::Perl_wait4pid
#define wait4pid Perl_wait4pid
+#define Perl_report_uninit CPerlObj::Perl_report_uninit
+#define report_uninit Perl_report_uninit
#define Perl_warn CPerlObj::Perl_warn
#define warn Perl_warn
#define Perl_vwarn CPerlObj::Perl_vwarn
p |void |vivify_defelem |SV* sv
p |void |vivify_ref |SV* sv|U32 to_what
p |I32 |wait4pid |Pid_t pid|int* statusp|int flags
+p |void |report_uninit
p |void |warn |const char* pat|...
p |void |vwarn |const char* pat|va_list* args
p |void |warner |U32 err|const char* pat|...
Perl_vivify_defelem
Perl_vivify_ref
Perl_wait4pid
+Perl_report_uninit
Perl_warn
Perl_vwarn
Perl_warner
#define Perl_wait4pid pPerl->Perl_wait4pid
#undef wait4pid
#define wait4pid Perl_wait4pid
+#undef Perl_report_uninit
+#define Perl_report_uninit pPerl->Perl_report_uninit
+#undef report_uninit
+#define report_uninit Perl_report_uninit
#undef Perl_warn
#define Perl_warn pPerl->Perl_warn
#undef warn
"private value",
"push regexp",
"ref-to-glob cast",
- "scalar deref",
+ "scalar dereference",
"array length",
- "subroutine deref",
+ "subroutine dereference",
"anonymous subroutine",
"subroutine prototype",
"reference constructor",
# References and stuff.
rv2gv ref-to-glob cast ck_rvconst ds1
-rv2sv scalar deref ck_rvconst ds1
+rv2sv scalar dereference ck_rvconst ds1
av2arylen array length ck_null is1
-rv2cv subroutine deref ck_rvconst d1
+rv2cv subroutine dereference ck_rvconst d1
anoncode anonymous subroutine ck_anoncode $
prototype subroutine prototype ck_null s% S
refgen reference constructor ck_spair m1 L
/* handy constants */
EXTCONST char PL_warn_uninit[]
- INIT("Use of uninitialized value");
+ INIT("Use of uninitialized value%s%s");
EXTCONST char PL_warn_nosemi[]
INIT("Semicolon seems to be missing");
EXTCONST char PL_warn_reserved[]
return ((CPerlObj*)pPerl)->Perl_wait4pid(pid, statusp, flags);
}
+#undef Perl_report_uninit
+void
+Perl_report_uninit(pTHXo)
+{
+ ((CPerlObj*)pPerl)->Perl_report_uninit();
+}
+
#undef Perl_warn
void
Perl_warn(pTHXo_ const char* pat, ...)
PL_op->op_private & HINT_STRICT_REFS)
DIE(aTHX_ PL_no_usym, "a symbol");
if (ckWARN(WARN_UNINITIALIZED))
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
RETSETUNDEF;
}
sym = SvPV(sv, n_a);
PL_op->op_private & HINT_STRICT_REFS)
DIE(aTHX_ PL_no_usym, "a SCALAR");
if (ckWARN(WARN_UNINITIALIZED))
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
RETSETUNDEF;
}
sym = SvPV(sv, n_a);
PL_op->op_private & HINT_STRICT_REFS)
DIE(aTHX_ PL_no_usym, "an ARRAY");
if (ckWARN(WARN_UNINITIALIZED))
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
if (GIMME == G_ARRAY) {
(void)POPs;
RETURN;
PL_op->op_private & HINT_STRICT_REFS)
DIE(aTHX_ PL_no_usym, "a HASH");
if (ckWARN(WARN_UNINITIALIZED))
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
if (GIMME == G_ARRAY) {
SP--;
RETURN;
PERL_CALLCONV void Perl_vivify_defelem(pTHX_ SV* sv);
PERL_CALLCONV void Perl_vivify_ref(pTHX_ SV* sv, U32 to_what);
PERL_CALLCONV I32 Perl_wait4pid(pTHX_ Pid_t pid, int* statusp, int flags);
+PERL_CALLCONV void Perl_report_uninit(pTHX);
PERL_CALLCONV void Perl_warn(pTHX_ const char* pat, ...);
PERL_CALLCONV void Perl_vwarn(pTHX_ const char* pat, va_list* args);
PERL_CALLCONV void Perl_warner(pTHX_ U32 err, const char* pat, ...);
PL_sv_root = 0;
}
+void
+Perl_report_uninit(pTHX)
+{
+ if (PL_op)
+ Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit,
+ " in ", PL_op_desc[PL_op->op_type]);
+ else
+ Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit, "", "");
+}
+
STATIC XPVIV*
S_new_xiv(pTHX)
{
if (!(SvFLAGS(sv) & SVs_PADTMP)) {
dTHR;
if (ckWARN(WARN_UNINITIALIZED) && !PL_localizing)
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
}
return 0;
}
if (SvREADONLY(sv) && !SvOK(sv)) {
dTHR;
if (ckWARN(WARN_UNINITIALIZED))
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
return 0;
}
}
else {
dTHR;
if (ckWARN(WARN_UNINITIALIZED) && !PL_localizing && !(SvFLAGS(sv) & SVs_PADTMP))
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
if (SvTYPE(sv) < SVt_IV)
/* Typically the caller expects that sv_any is not NULL now. */
sv_upgrade(sv, SVt_IV);
if (!(SvFLAGS(sv) & SVs_PADTMP)) {
dTHR;
if (ckWARN(WARN_UNINITIALIZED) && !PL_localizing)
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
}
return 0;
}
if (SvREADONLY(sv) && !SvOK(sv)) {
dTHR;
if (ckWARN(WARN_UNINITIALIZED))
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
return 0;
}
}
if (!(SvFLAGS(sv) & SVs_PADTMP)) {
dTHR;
if (ckWARN(WARN_UNINITIALIZED) && !PL_localizing)
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
}
if (SvTYPE(sv) < SVt_IV)
/* Typically the caller expects that sv_any is not NULL now. */
if (!(SvFLAGS(sv) & SVs_PADTMP)) {
dTHR;
if (ckWARN(WARN_UNINITIALIZED) && !PL_localizing)
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
}
return 0;
}
if (SvREADONLY(sv) && !SvOK(sv)) {
dTHR;
if (ckWARN(WARN_UNINITIALIZED))
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
return 0.0;
}
}
else {
dTHR;
if (ckWARN(WARN_UNINITIALIZED) && !PL_localizing && !(SvFLAGS(sv) & SVs_PADTMP))
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
if (SvTYPE(sv) < SVt_NV)
/* Typically the caller expects that sv_any is not NULL now. */
sv_upgrade(sv, SVt_NV);
if (!(SvFLAGS(sv) & SVs_PADTMP)) {
dTHR;
if (ckWARN(WARN_UNINITIALIZED) && !PL_localizing)
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
}
*lp = 0;
return "";
if (SvREADONLY(sv) && !SvOK(sv)) {
dTHR;
if (ckWARN(WARN_UNINITIALIZED))
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
*lp = 0;
return "";
}
if (ckWARN(WARN_UNINITIALIZED)
&& !PL_localizing && !(SvFLAGS(sv) & SVs_PADTMP))
{
- Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit);
+ report_uninit();
}
*lp = 0;
if (SvTYPE(sv) < SVt_PV)
if ($x == 0) { print "" } else { print $x }
}
EXPECT
-Use of uninitialized value at - line 4.
+Use of uninitialized value in numeric eq (==) at - line 4.
$^W = 1 ;
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at - line 4.
+Use of uninitialized value in scalar chop at - line 4.
########
# warnings enabled at compile time, disabled at run time
$^W = 1 ;
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at - line 5.
+Use of uninitialized value in scalar chop at - line 5.
########
-w
--FILE-- abcd
--FILE--
require "./abcd";
EXPECT
-Use of uninitialized value at ./abcd line 1.
+Use of uninitialized value in scalar chop at ./abcd line 1.
########
--FILE-- abcd
#! perl -w
require "./abcd";
EXPECT
-Use of uninitialized value at ./abcd line 1.
+Use of uninitialized value in scalar chop at ./abcd line 1.
########
--FILE-- abcd
$^W =1 ;
require "./abcd";
EXPECT
-Use of uninitialized value at ./abcd line 1.
+Use of uninitialized value in scalar chop at ./abcd line 1.
########
--FILE-- abcd
require "./abcd";
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at - line 3.
+Use of uninitialized value in scalar chop at - line 3.
########
$^W = 1;
eval 'my $b ; chop $b ;' ;
print $@ ;
EXPECT
-Use of uninitialized value at (eval 1) line 1.
+Use of uninitialized value in scalar chop at (eval 1) line 1.
########
eval '$^W = 1;' ;
print $@ ;
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at - line 4.
+Use of uninitialized value in scalar chop at - line 4.
########
eval {$^W = 1;} ;
print $@ ;
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at - line 4.
+Use of uninitialized value in scalar chop at - line 4.
########
{
}
my $c ; chop $c ;
EXPECT
-Use of uninitialized value at - line 5.
+Use of uninitialized value in scalar chop at - line 5.
########
-w
-e undef
EXPECT
-Use of uninitialized value at - line 2.
+Use of uninitialized value in -e at - line 2.
########
$^W = 1 + 2 ;
fred() ;
}
EXPECT
-Use of uninitialized value at - line 2.
+Use of uninitialized value in scalar chop at - line 2.
}
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at - line 8.
+Use of uninitialized value in scalar chop at - line 8.
########
# Check runtime scope of pragma
}
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at - line 6.
+Use of uninitialized value in scalar chop at - line 6.
########
# Check runtime scope of pragma
}
&$a ;
EXPECT
-Use of uninitialized value at - line 6.
+Use of uninitialized value in scalar chop at - line 6.
########
use warnings 'deprecated' ;
my $a ; chop $a ;
EXPECT
Use of EQ is deprecated at ./abc line 2.
-Use of uninitialized value at - line 3.
+Use of uninitialized value in scalar chop at - line 3.
########
--FILE-- abc.pm
my $a ; chop $a ;
EXPECT
Use of EQ is deprecated at abc.pm line 2.
-Use of uninitialized value at - line 3.
+Use of uninitialized value in scalar chop at - line 3.
########
# Check scope of pragma with eval
}; print STDERR $@ ;
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at - line 6.
+Use of uninitialized value in scalar chop at - line 6.
########
# Check scope of pragma with eval
}; print STDERR $@ ;
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at - line 5.
-Use of uninitialized value at - line 7.
+Use of uninitialized value in scalar chop at - line 5.
+Use of uninitialized value in scalar chop at - line 7.
########
# Check scope of pragma with eval
}; print STDERR $@ ;
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at - line 8.
+Use of uninitialized value in scalar chop at - line 8.
########
# Check scope of pragma with eval
]; print STDERR $@;
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at (eval 1) line 3.
+Use of uninitialized value in scalar chop at (eval 1) line 3.
########
# Check scope of pragma with eval
'; print STDERR $@ ;
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at (eval 1) line 2.
-Use of uninitialized value at - line 7.
+Use of uninitialized value in scalar chop at (eval 1) line 2.
+Use of uninitialized value in scalar chop at - line 7.
########
# Check scope of pragma with eval
'; print STDERR $@ ;
my $b ; chop $b ;
EXPECT
-Use of uninitialized value at - line 8.
+Use of uninitialized value in scalar chop at - line 8.
########
# Check scope of pragma with eval
1 if $a EQ $b ;
EXPECT
Use of EQ is deprecated at - line 6.
-Use of uninitialized value at - line 9.
-Use of uninitialized value at - line 11.
-Use of uninitialized value at - line 11.
+Use of uninitialized value in scalar chop at - line 9.
+Use of uninitialized value in string eq at - line 11.
+Use of uninitialized value in string eq at - line 11.
}
EXPECT
-Use of uninitialized value at - line 6.
+Use of uninitialized value in scalar chop at - line 6.
########
# Check interaction of $^W and use warnings
}
EXPECT
-Use of uninitialized value at - line 6.
+Use of uninitialized value in scalar chop at - line 6.
########
# Check interaction of $^W and use warnings
my $b ;
chop $b ;
EXPECT
-Use of uninitialized value at - line 6.
+Use of uninitialized value in scalar chop at - line 6.
########
# Check interaction of $^W and use warnings
my $b ;
chop $b ;
EXPECT
-Use of uninitialized value at - line 6.
+Use of uninitialized value in scalar chop at - line 6.
########
# Check interaction of $^W and use warnings
my $b ;
chop $b ;
EXPECT
-Use of uninitialized value at - line 5.
+Use of uninitialized value in scalar chop at - line 5.
########
# Check interaction of $^W and use warnings
BEGIN { $^W = 0 }
fred() ;
EXPECT
-Use of uninitialized value at - line 6.
+Use of uninitialized value in scalar chop at - line 6.
########
# Check interaction of $^W and use warnings
my $b ;
chop $b ;
EXPECT
-Use of uninitialized value at - line 6.
+Use of uninitialized value in scalar chop at - line 6.
########
# Check interaction of $^W and use warnings
my $b ;
chop $b ;
EXPECT
-Use of uninitialized value at - line 6.
+Use of uninitialized value in scalar chop at - line 6.
########
# Check interaction of $^W and use warnings
my $b ;
chop $b ;
EXPECT
-Use of uninitialized value at - line 10.
+Use of uninitialized value in scalar chop at - line 10.
########
# Check interaction of $^W and use warnings
my $b ;
chop $b ;
EXPECT
-Use of uninitialized value at - line 7.
+Use of uninitialized value in scalar chop at - line 7.
my $a ; chop $a ;
EXPECT
Use of EQ is deprecated at abc.pm line 3.
-Use of uninitialized value at - line 3.
+Use of uninitialized value in scalar chop at - line 3.
########
-W
--FILE-- abc
my $a ; chop $a ;
EXPECT
Use of EQ is deprecated at ./abc line 3.
-Use of uninitialized value at - line 3.
+Use of uninitialized value in scalar chop at - line 3.
########
-W
--FILE-- abc.pm
my $a ; chop $a ;
EXPECT
Use of EQ is deprecated at abc.pm line 3.
-Use of uninitialized value at - line 3.
+Use of uninitialized value in scalar chop at - line 3.
########
-W
--FILE-- abc
my $a ; chop $a ;
EXPECT
Use of EQ is deprecated at ./abc line 3.
-Use of uninitialized value at - line 3.
+Use of uninitialized value in scalar chop at - line 3.
my $b ; chop $b ;
print STDERR "The End.\n" ;
EXPECT
-Use of uninitialized value at - line 8.
+Use of uninitialized value in scalar chop at - line 8.
########
# Check runtime scope of pragma
&$a ;
print STDERR "The End.\n" ;
EXPECT
-Use of uninitialized value at - line 6.
+Use of uninitialized value in scalar chop at - line 6.
########
--FILE-- abc
print STDERR "The End.\n" ;
EXPECT
Use of EQ is deprecated at ./abc line 2.
-Use of uninitialized value at - line 3.
+Use of uninitialized value in scalar chop at - line 3.
########
--FILE-- abc.pm
print STDERR "The End.\n" ;
EXPECT
Use of EQ is deprecated at abc.pm line 2.
-Use of uninitialized value at - line 3.
+Use of uninitialized value in scalar chop at - line 3.
########
# Check scope of pragma with eval
my $b ; chop $b ;
print STDERR "The End.\n" ;
EXPECT
--- Use of uninitialized value at - line 6.
+-- Use of uninitialized value in scalar chop at - line 6.
The End.
########
my $b ; chop $b ;
print STDERR "The End.\n" ;
EXPECT
--- Use of uninitialized value at - line 5.
-Use of uninitialized value at - line 7.
+-- Use of uninitialized value in scalar chop at - line 5.
+Use of uninitialized value in scalar chop at - line 7.
########
# Check scope of pragma with eval
my $b ; chop $b ;
print STDERR "The End.\n" ;
EXPECT
-Use of uninitialized value at - line 8.
+Use of uninitialized value in scalar chop at - line 8.
########
# Check scope of pragma with eval
my $b ; chop $b ;
print STDERR "The End.\n" ;
EXPECT
--- Use of uninitialized value at (eval 1) line 3.
+-- Use of uninitialized value in scalar chop at (eval 1) line 3.
The End.
########
my $b ; chop $b ;
print STDERR "The End.\n" ;
EXPECT
--- Use of uninitialized value at (eval 1) line 2.
-Use of uninitialized value at - line 7.
+-- Use of uninitialized value in scalar chop at (eval 1) line 2.
+Use of uninitialized value in scalar chop at - line 7.
########
# Check scope of pragma with eval
my $b ; chop $b ;
print STDERR "The End.\n" ;
EXPECT
-Use of uninitialized value at - line 8.
+Use of uninitialized value in scalar chop at - line 8.
########
# Check scope of pragma with eval
no warnings 'uninitialized' ;
print $b ;
EXPECT
-Use of uninitialized value at - line 3.
+Use of uninitialized value in print at - line 3.
########
# doio.c [Perl_my_stat Perl_my_lstat]
use warnings 'io' ;
no warnings 'uninitialized' ;
my $c = $$a;
EXPECT
-Use of uninitialized value at - line 4.
+Use of uninitialized value in scalar dereference at - line 4.
########
# pp.c
use warnings 'unsafe' ;
no warnings 'uninitialized' ;
my @c = @$a;
EXPECT
-Use of uninitialized value at - line 4.
+Use of uninitialized value in array dereference at - line 4.
########
# pp_hot.c [pp_rv2hv]
use warnings 'uninitialized' ;
no warnings 'uninitialized' ;
my %c = %$a;
EXPECT
-Use of uninitialized value at - line 4.
+Use of uninitialized value in hash dereference at - line 4.
########
# pp_hot.c [pp_aassign]
use warnings 'unsafe' ;
no warnings 'uninitialized' ;
$x = 1 + $b[0] ; # a
EXPECT
-Use of uninitialized value at - line 4.
+Use of uninitialized value in integer addition (+) at - line 4.
########
# sv.c (sv_2iv)
package fred ;
no warnings 'uninitialized' ;
$A *= 2 ;
EXPECT
-Use of uninitialized value at - line 10.
+Use of uninitialized value in integer multiplication (*) at - line 10.
########
# sv.c
use integer ;
no warnings 'uninitialized' ;
my $y *= 2 ; #b
EXPECT
-Use of uninitialized value at - line 4.
+Use of uninitialized value in integer multiplication (*) at - line 4.
########
# sv.c (sv_2uv)
package fred ;
$B = 0 ;
$B |= $A ;
EXPECT
-Use of uninitialized value at - line 10.
+Use of uninitialized value in bitwise or (|) at - line 10.
########
# sv.c
use warnings 'uninitialized' ;
my $Y = 1 ;
$x = 1 | $b[$Y] ;
EXPECT
-Use of uninitialized value at - line 4.
+Use of uninitialized value in bitwise or (|) at - line 4.
########
# sv.c
use warnings 'uninitialized' ;
no warnings 'uninitialized' ;
my $y *= 1 ; # d
EXPECT
-Use of uninitialized value at - line 3.
+Use of uninitialized value in multiplication (*) at - line 3.
########
# sv.c
use warnings 'uninitialized' ;
no warnings 'uninitialized' ;
$x = 1 + $b[0] ; # e
EXPECT
-Use of uninitialized value at - line 3.
+Use of uninitialized value in addition (+) at - line 3.
########
# sv.c (sv_2nv)
package fred ;
no warnings 'uninitialized' ;
$A *= 2 ;
EXPECT
-Use of uninitialized value at - line 9.
+Use of uninitialized value in multiplication (*) at - line 9.
########
# sv.c
use warnings 'uninitialized' ;
no warnings 'uninitialized' ;
$x = $z + 1 ; # f
EXPECT
-Use of uninitialized value at - line 3.
+Use of uninitialized value in addition (+) at - line 3.
########
# sv.c
use warnings 'uninitialized' ;
no warnings 'uninitialized' ;
$x = chop $z ; # h
EXPECT
-Use of uninitialized value at - line 3.
+Use of uninitialized value in scalar chop at - line 3.
########
# sv.c (sv_2pv)
package fred ;
$C = "" ;
$C .= $A ;
EXPECT
-Use of uninitialized value at - line 10.
+Use of uninitialized value in concatenation (.) at - line 10.
########
# sv.c
use warnings 'numeric' ;