develooper Front page | perl.perl5.porters | Postings from September 2001

printf not working in XSUBs on OS X

Thread Next
From:
Brian Ingerson
Date:
September 28, 2001 02:32
Subject:
printf not working in XSUBs on OS X
Message ID:
20010928023253.A1103@ttul.org
This fails:

    perl -e 'use Inline C=>q|void foo(){printf("FOO!");}|;foo'

with:

/Users/ingy/perl/blead/bin/perl /Users/ingy/perl/blead/lib/5.7.2/ExtUtils/xsubpp  -typemap /Users/ingy/perl/blead/lib/5.7.2/ExtUtils/typemap   e_520f.xs > e_520f.xsc && mv e_520f.xsc e_520f.c
cc -c  -pipe -fno-common -DINT32_MIN_BROKEN -DINT64_MIN_BROKEN -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -g   -DVERSION=\"0.00\" -DXS_VERSION=\"0.00\"  -I/Users/ingy/perl/blead/lib/5.7.2/darwin/CORE e_520f.c
e_520f.xs:3657: bad macro argument list
cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode
make: *** [e_520f.o] Error 1

Simon says that I shouldn't be using printf() (opting for PerlIO), but I
think that's a little silly since printf() has always worked in XSUBs.

Arthur tested it on Linux and it works fine.

Cheers, Brian
----
Summary of my perl5 (revision 5.0 version 7 subversion 2 patch 12243)
configuration:
  Platform:
    osname=darwin, osvers=1.3.7, archname=darwin
    uname='darwin localhost 1.3.7 darwin kernel version 1.3.7: sat jun 9
11:12:48 pdt 2001; root:xnuxnu-124.13.obj~1release_ppc power macintosh
powerpc '
    config_args='-Doptimize=-g -Dprefix=/Users/ingy/perl/blead -ders
-Dusedevel'
    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=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=define
  Compiler:
    cc='cc', ccflags ='-pipe -fno-common -DINT32_MIN_BROKEN
-DINT64_MIN_BROKEN -DDEBUGGING -fno-strict-aliasing -I/usr/local/include',
    optimize='-g',
    cppflags='-traditional-cpp -pipe -fno-common -DINT32_MIN_BROKEN
-DINT64_MIN_BROKEN -DDEBUGGING -fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='Apple DevKit-based CPP 6.0alpha',
gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib
    libs=-lm -lc
    perllibs=-lm -lc
    libc=, so=dylib, useshrplib=true, libperl=libperl.dylib
  Dynamic Linking:
    dlsrc=dl_dyld.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags=' -bundle -undefined suppress -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Compile-time options: DEBUGGING USE_LARGE_FILES
  Locally applied patches:
        DEVEL12238
  Built under darwin
  Compiled at 09/27/01 19:34:20
  %ENV:
    PERL5OPT="-MData::Dumper"
  @INC:
    /Users/ingy/perl/blead/lib/5.7.2/darwin
    /Users/ingy/perl/blead/lib/5.7.2
    /Users/ingy/perl/blead/lib/site_perl/5.7.2/darwin
    /Users/ingy/perl/blead/lib/site_perl/5.7.2
    /Users/ingy/perl/blead/lib/site_perl
    .

Thread Next


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