develooper Front page | perl.perl5.porters | Postings from December 2004

[perl #32884] API doc for SvUTF8

Thread Next
perl-5 . 8 . 0 @ ton . iguana . be
December 6, 2004 01:18
[perl #32884] API doc for SvUTF8
Message ID:
# New Ticket Created by 
# Please include the string:  [perl #32884]
# in the subject line of all future correspondence about this issue. 
# <URL: >

This is a bug report for perl from,
generated with the help of perlbug 1.35 running under perl v5.8.4.

[Please enter your report here]

The doc for SvUTF8 says:

       SvUTF8  Returns a boolean indicating whether the SV contains UTF-8
               encoded data.

                       bool    SvUTF8(SV* sv)

The code however does:

#define SvUTF8(sv)         (SvFLAGS(sv) & SVf_UTF8)

which results in an U32

That is of course no problem in constructs like:

if (SvUTF8(sv)) { ... }

but if you do:

   bool utf8 = SvUTF8(sv);
   if (utf8) { ... }

things fail badly because (at least on my system) the bool enum becomes a
char, and since SVf_UTF8 is 0x20000000, utf8 will always be 0 after truncate.

Either the docs or the macro should be updated I think

Several other things that are called "bool" in the api doc have the same
problem (e.g. SvIOK, SvIOKp, SvPOK, etc)

[Please do not change anything below this line]
This perlbug was built using Perl v5.8.5 - Sun Nov  7 13:52:55 CET 2004
It is being executed now by  Perl v5.8.4 - Thu Jun  3 13:28:19 CEST 2004.

Site configuration information for perl v5.8.4:

Configured by ton at Thu Jun  3 13:28:19 CEST 2004.

Summary of my perl5 (revision 5 version 8 subversion 4) configuration:
    osname=linux, osvers=2.6.5, archname=i686-linux-64int-ld
    uname='linux quasar 2.6.5 #8 mon apr 5 05:41:20 cest 2004 i686 gnulinux '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=define use64bitall=undef uselongdouble=define
    usemymalloc=y, bincompat5005=undef
    cc='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2 -fomit-frame-pointer',
    cppflags='-fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='3.4.0 20031231 (experimental)', 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='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:

@INC for perl v5.8.4:

Environment for perl v5.8.4:
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About