"Malcolm McLean" <> writes:
> "Keith Thompson" <kst-> wrote in message
> news:...
>> "Malcolm McLean" <> writes:
[...]
>>> There's a very obvious answer to that one. As a compiler-writer, youa
>>> re in a position to do it.
>>
>> I presume the solution you're suggesting is to make int 64 bits. How
>> does this help? strlen() still returns size_t, and if int and size_t
>> are both 64 bits, there will still be size_t values that cannot be
>> stored in an int.
>>
> Yes, but then you'd need an extremely long string to break the code,
> so the warning can be suppressed with some confidence that it won't
> cause a malfunction.
That's assuming you're able to suppress the warning for 64-bit
unsigned to 64-bit signed conversions without supressing warnings for,
say, 8-bit unsigned to 8-bit signed conversions. I don't know of any
compiler that allow that kind of find-grained control.
It's better to fix the code. It's even better to write it correctly
in the first place.
--
Keith Thompson (The_Other_Keith)
kst- <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"