zutils-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Zutils-bug] Version 1.0-rc3 of zutils released


From: Antonio Diaz Diaz
Subject: Re: [Zutils-bug] Version 1.0-rc3 of zutils released
Date: Wed, 31 Oct 2012 12:50:59 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7.11) Gecko/20050905

Dagobert Michelsen wrote:
The code in zcat
str.insert( 0U, 1, '1' );

matches the first declaration (0U is a position in str),

for 32 bit this is correct, however on 64 bit the type is 0UL which causes the
ambiguity. When I change the type to 0UL it works for 64 bit, but not 32 bit.
What is needed is a type that works on both 32 and 64 bit.

I have just tried on a 64 bit Slackware with gcc 4.5.2 and both 0U and 0 alone work perfectly without a warning, even with --pedantic.

Moreover, in zdiff.cc line 127 you can find
  do { fifonames[i].insert( pos, 1, codes[n % num_codes] );

where 'pos' is an unsigned int. I guess it can be considered a bug in the compiler to promote 'pos' to size_type and fail to do the same with 0 or 0U.


Best regards,
Antonio.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]