develooper Front page | perl.perl5.porters | Postings from June 2013

[perl #118693] No warning for undef'd variables returned from XS under -w

Thread Previous
From:
karl williamson
Date:
June 30, 2013 00:24
Subject:
[perl #118693] No warning for undef'd variables returned from XS under -w
Message ID:
rt-3.6.HEAD-2552-1372551812-68.118693-75-0@perl.org
# New Ticket Created by  karl williamson 
# Please include the string:  [perl #118693]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=118693 >



This is a bug report for perl from khw@karl.(none),
generated with the help of perlbug 1.39 running under perl 5.19.2.


-----------------------------------------------------------------
This is fallout from
https://rt.perl.org/rt3/Ticket/Display.html?id=115808

Uupon error POSIX::setlocale is setting RETVAL to NULL.  According to
Leon Timmermans, the char* return should typemap that to undef, but the
ticket indicates no undef warning is generated:

$ perl -wle 'use POSIX; print setlocale LC_ALL, "mtfnpy"'

If I change the setlocale code to instead do an XSRETURN_UNDEF, the
warning gets generated.

Leon did some digging and says that 91bba347 suppresses the warnings for
PADTMP SVs


-----------------------------------------------------------------
---
Flags:
     category=core
     severity=medium
---
Site configuration information for perl 5.19.2:

Configured by khw at Sat Jun 29 07:57:06 MDT 2013.

Summary of my perl5 (revision 5 version 19 subversion 2) configuration:
   Commit id: fcfc2536982bb48db2c6690dc9011ed4a091fefc
   Platform:
     osname=linux, osvers=2.6.35-32-generic-pae, 
archname=i686-linux-thread-multi-64int-ld
     uname='linux karl 2.6.35-32-generic-pae #67-ubuntu smp mon mar 5 
21:23:19 utc 2012 i686 gnulinux '
     config_args='-des -Dprefix=/home/khw/blead -Dusedevel 
-D'optimize=-ggdb3' -A'optimize=-ggdb3' -A'optimize=-O0' 
-Accflags=-Winline -Dman1dir=none -Dman3dir=none -DDEBUGGING -Dcc=g++ 
-Dusemorebits -Dusethreads'
     hint=recommended, useposix=true, d_sigaction=define
     useithreads=define, usemultiplicity=define
     useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
     use64bitint=define, use64bitall=undef, uselongdouble=define
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='g++', ccflags ='-D_REENTRANT -D_GNU_SOURCE -Winline -DDEBUGGING 
-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
     optimize=' -ggdb3 -O0',
     cppflags='-D_REENTRANT -D_GNU_SOURCE -Winline -DDEBUGGING 
-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
     ccversion='', gccversion='4.4.5', gccosandvers=''
     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
     ivtype='long long', ivsize=8, nvtype='long double', nvsize=12, 
Off_t='off_t', lseeksize=8
     alignbytes=4, prototype=define
   Linker and Libraries:
     ld='g++', ldflags =' -fstack-protector -L/usr/local/lib'
     libpth=/usr/local/lib /lib/../lib /usr/lib/../lib /lib /usr/lib 
/usr/lib/i686-linux-gnu
     libs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
     perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
     libc=/lib/libc-2.12.1.so, so=so, useshrplib=false, libperl=libperl.a
     gnulibc_version='2.12'
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
     cccdlflags='-fPIC', lddlflags='-shared -ggdb3 -ggdb3 -O0 
-L/usr/local/lib -fstack-protector'

Locally applied patches:


---
@INC for perl 5.19.2:
     /home/khw/perl/blead/lib
 
/home/khw/blead/lib/perl5/site_perl/5.19.2/i686-linux-thread-multi-64int-ld
     /home/khw/blead/lib/perl5/site_perl/5.19.2
     /home/khw/blead/lib/perl5/5.19.2/i686-linux-thread-multi-64int-ld
     /home/khw/blead/lib/perl5/5.19.2
     /home/khw/blead/lib/perl5/site_perl
     .

---
Environment for perl 5.19.2:
     HOME=/home/khw
     LANG=en_US.UTF-8
     LANGUAGE=en_US:en
     LD_LIBRARY_PATH (unset)
     LOGDIR (unset)
 
PATH=/home/khw/bin:/home/khw/perl5/perlbrew/bin:/home/khw/print/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/usr/games:/home/khw/cxoffice/bin
     PERL5OPT=-w
     PERL_BADLANG (unset)
     SHELL=/bin/ksh


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About