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

Re: Change 28877: [PATCH] deal with some gcc warnings

Thread Previous | Thread Next
From:
SADAHIRO Tomoyuki
Date:
September 25, 2006 05:26
Subject:
Re: Change 28877: [PATCH] deal with some gcc warnings
Message ID:
20060925211916.3C66.BQW10602@nifty.com

On Sun, 24 Sep 2006 22:30:04 +0100, Nicholas Clark wrote

> > ==== //depot/perl/reentr.pl#46 (text) ====
> > Index: perl/reentr.pl
> > --- perl/reentr.pl#45~28750~	2006-08-22 20:04:47.000000000 -0700
> > +++ perl/reentr.pl	2006-09-21 00:54:10.000000000 -0700
> > @@ -547,7 +547,7 @@
> >  	    push @size, <<EOF;
> >  #   if defined(HAS_SYSCONF) && defined($sc) && !defined(__GLIBC__)
> >  	PL_reentrant_buffer->$sz = sysconf($sc);
> > -	if (PL_reentrant_buffer->$sz == -1)
> > +	if ((IV)PL_reentrant_buffer->$sz == (IV)-1)
> >  		PL_reentrant_buffer->$sz = REENTRANTUSUALSIZE;
> >  #   else
> >  #       if defined(__osf__) && defined(__alpha) && defined(SIABUFSIZ)
> > 
> 
> causes these failures with -Duse64bitint on x86 FreeBSD:

In reentr.pl, the size of $sz is declared in

    size_t _${genfunc}_size;
    my $sz = "_${genfunc}_size";

Supposing that sizeof(size_t) == 4 and sizeof(IV) == 8; then
(IV)((size_t)-1) will be (IV)0xFFFFFFFF, which will not
be equal to (IV)-1.   No, 4294967295 != -1.

I think that should be (PL_reentrant_buffer->$sz == (size_t)-1).

Regards,
SADAHIRO Tomoyuki



Thread Previous | 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