though it's silently converted to ""
p4raw-id: //depot/perl@27725
Perl_magic_setenv(pTHX_ SV *sv, MAGIC *mg)
{
dVAR;
- STRLEN len, klen;
- const char *s = SvPV_const(sv,len);
+ STRLEN len = 0, klen;
+ const char *s = SvOK(sv) ? SvPV_const(sv,len) : "";
const char * const ptr = MgPV_const(mg,klen);
my_setenv(ptr, s);
length $3;
EXPECT
Use of uninitialized value $3 in length at - line 3.
+########
+# mg.c
+use warnings 'uninitialized';
+$ENV{FOO} = undef; # should not warn
+EXPECT