logo       

Re: Mail::Box::Parser::C V 3.001: msg#00031

Subject: Re: Mail::Box::Parser::C V 3.001
On Tue, Aug 26, 2003 at 03:06:00PM +0200 Mark Overmeer wrote:

> * Tassilo von Parseval (tassilo.parseval@xxxxxxxxxxxxxxxxxxx) [030826 14:48]:

> >     if(box==NULL) return XSRETURN_UNDEF;
> > It should be either just
> >     if(box==NULL) XSRETURN_UNDEF;
> 
> Yeh, and gcc is not complaining.  Happily someone is.

VisualC is extremely strict in what it will accept. Initially I hated it
for its outdatedness, but after a while I realized that this is a good
thing. Make it compile on VisualC and chances are good that it will
compile almost anywhere else, too.

> > > Output C.xs(986) : warning C4133: 'function' : incompatible types - from 
> > > 'char *' to 'struct _iobuf *'
> > > Output C.xs(986) : warning C4133: 'function' : incompatible types - from 
> > > 'struct _iobuf *' to 'const char *'
> 
> Above is strange.  The prototype of fputs is
>    (const char *, FILE *)
> not the reverse.

Hehe, enjoy this. Grepping the headers in the Perl source-tree for fputs
gives:

XSUB.h:#    define fputs                PerlSIO_fputs
fakesdio.h:#undef fputs
fakesdio.h:#define fputs(s,f)           PerlIO_puts(f,s)
iperlsys.h:#define PerlSIO_fputs(f,s)
\iperlsys.h:#define PerlSIO_fputs(f,s)           fputs(s,f)
nostdio.h:#undef fputs
nostdio.h:#define fputs(s,f)  _CANNOT _fputs_
perl.h:#   ifndef fputs
perl.h:#        define fputs(sv,fp) fprintf(fp,"%s",sv)
perlsdio.h:#define PerlIO_puts(f,s)             PerlSIO_fputs(f,s)

So indeed, arguments somehow swapped somewhere in the #define-hell of
the Perl headers. You are probably best off using PerlIO_puts() (see
perlapio.pod). Also, it might be worth having a look at perlclib.pod
since it explicitely mentions such gotchas. The mantra of it is that you
should avoid more or less anything from the libc and instead use the
wrappers provided by the Perl API.

Interestingly enough, I learnt about perlclib just a few days ago and
didn't know it existed before.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe