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

Bit-fields patch causes warnings on Win32/VC6

Thread Next
From:
Steve Hay
Date:
February 13, 2008 01:29
Subject:
Bit-fields patch causes warnings on Win32/VC6
Message ID:
1B32FF956ABF414C9BCE5E487A1497E7014738CE@ukmail02.planit.group
My smoke from last night has a bunch of warnings introduced by #33292:

..\op.c(551) : warning C4244: '=' : conversion from 'unsigned long ' to
'unsigned short ', possible loss of data
..\op.c(5036) : warning C4244: '=' : conversion from 'long ' to
'unsigned short ', possible loss of data

B.c(1797) : warning C4244: '=' : conversion from 'unsigned short ' to
'unsigned char ', possible loss of data
B.c(1924) : warning C4244: '=' : conversion from 'unsigned short ' to
'unsigned char ', possible loss of data

These are all because the op.h hunk of that change changed some members
from unsigned (meaning unsigned int) to PERL_BITFIELD16 (which is
unsigned short). Had they been made PERL_BITFIELD32 (unsigned int)
instead (as per the similar hunk that changed sv.h) then the warnings go
away. The attached patch shows what I mean.

I didn't follow what the thread leading upto that patch was about, but
was there some reason why the op.h changes use PERL_BITFIELD16 instead
of PERL_BITFIELD32 like the sv.h changes?

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