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

[ID 20010224.003] Syslog.xs`PerlIO_stdoutf' is an unrecognizedformat function type

Thread Next
From:
dcd
Date:
February 24, 2001 13:51
Subject:
[ID 20010224.003] Syslog.xs`PerlIO_stdoutf' is an unrecognizedformat function type
Message ID:
200102242151.NAA21063@dd.tc.fluke.com
This is a bug report for perl from dcd@tc.fluke.com,
generated with the help of perlbug 1.33 running under perl v5.7.0.


-----------------------------------------------------------------
[Please enter your report here]



Moments ago I rsynced through 8922.gz (Feb 24 08:38) and my build
process failed in perl-current/ext/Sys/Syslog
 (I last Compiled perl at Jan 12 2001 16:05:37)

cc -c  -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3 -g   -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" -fpic -I../../..  Syslog.c
In file included from /usr/include/syslog.h:1,
                 from Syslog.xs:6:
/usr/include/sys/syslog.h:189: `PerlIO_stdoutf' is an unrecognized format function type
make[1]: *** [Syslog.o] Error 1

Taking a look at /usr/include/syslog.h I have
void	syslog __P((int, __const char * __DOTS))
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5)
	__attribute__ ((format (printf, 2, 0)))
#endif
	;

If I look at the pre-processor output these lines expand to

void	syslog  (int, __const char * , ... )

	__attribute__ ((format (PerlIO_stdoutf , 2, 0)))

	;

--

the first argument to  __attribute__ ((format (
	ARCHETYPE, STRING-INDEX, FIRST-TO-CHECK)))
should be `printf', `scanf', or `strftime'


in my perl.h I find the line
    #define printf PerlIO_stdoutf


I see that there is some special code to deal with __attribute__
in perl.h

    #if !defined(PERLIO_IS_STDIO) && defined(HASATTRIBUTE)
    /*
     * Now we have __attribute__ out of the way
     * Remap printf
     */
    #undef printf
    #define printf PerlIO_stdoutf
    #endif

I can see that PERLIO_IS_STDIO gets defined in perlio.h
but I couldn't identify what change since January caused
this to break.

I did apply the following patch and was able to compile and test
the latest perl-current, and only pod/find.t failed test 2.

--- ext/Sys/Syslog/Syslog.xs.dist	Mon Jul 31 19:31:41 2000
+++ ext/Sys/Syslog/Syslog.xs	Sat Feb 24 11:15:58 2001
@@ -3,6 +3,7 @@
 #include "XSUB.h"

 #ifdef I_SYSLOG
+#undef printf
 #include <syslog.h>
 #endif


Is there a better way to fix this, perhaps <syslog.h> needs
to be included earlier inside Syslog.xs?

David Dyck

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=high
---
This perlbug was built using Perl v5.7.0 - Fri Jan 12 16:03:35 PST 2001
It is being executed now by  Perl v5.7.0 - Sat Feb 24 10:15:46 PST 2001.

Site configuration information for perl v5.7.0:

Configured by dcd at Sat Feb 24 10:15:46 PST 2001.

Summary of my perl5 (revision 5.0 version 7 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.4.2-ac3, archname=i686-linux
    uname='linux dd 2.4.2-ac3 #2 fri feb 23 16:00:06 pst 2001 i686 '
    config_args='-Dusedevel -Doptimize=-O3 -g -de -Dcf_email=dcd@tc.fluke.com'
    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
  Compiler:
    cc='cc', ccflags ='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O3 -g',
    cppflags='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='egcs-2.91.66.1 19990314/Linux (egcs-1.1.2 release)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lgdbm -ldbm -ldb -ldl -lm -lc
    perllibs=-ldl -lm -lc
    libc=/lib/libc.so.5.4.44, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    DEVEL8403

---
@INC for perl v5.7.0:
    /usr/local/lib/perl5/5.7.0/i686-linux
    /usr/local/lib/perl5/5.7.0
    /usr/local/lib/perl5/site_perl/5.7.0/i686-linux
    /usr/local/lib/perl5/site_perl/5.7.0
    /usr/local/lib/perl5/site_perl
    .

---
Environment for perl v5.7.0:
    HOME=/home/dcd
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/dcd/bin:/sbin:/usr/local/bin:/bin:/usr/bin:/usr/X11/bin:/usr/games:/usr/local/samba:/home/hobbes/tools/scripts:/home/hobbes/tools/linux:/usr0/hobbes/tools/scripts:/usr0/dcd/bin:/apps/general/bin:/usr/public
    PERL_BADLANG (unset)
    SHELL=/bin/bash


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