Re: Four or Two Bytes?



Joachim Schmitz wrote:

Martin wrote:
On Fri, 30 May 2008 10:19:31 +0100, Joachim Schmitz
<nospam.jojo@xxxxxxxxxxxxxxxxxx> wrote:
Guess Keith's point is that you should cast it to whatever the format
specified expects.

I'll wait for Keith's response, but I would say that sometimes it may
be better to change the format specified. Casting an unsigned type to
signed type of equal or less width has the potential for data loss.
Yes it might have, but how likely is it that a data type is really larger
than INT_MAX?

As I recall, "huge model" on real-mode x86 processors use 32-bit
pointers, yet 16-bit ints. As such, I would expect that size_t
could hold values larger than INT_MAX.

--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:ThisIsASpamTrap@xxxxxxxxx>

.



Relevant Pages

  • Re: Four or Two Bytes?
    ... Martin wrote: ... I'll wait for Keith's response, but I would say that sometimes it may ... Casting an unsigned type to ... signed type of equal or less width has the potential for data loss. ...
    (comp.lang.c)
  • Re: Four or Two Bytes?
    ... I'll wait for Keith's response, but I would say that sometimes ... potential for data loss. ... is roughly twice the size of INT_MAX. ...
    (comp.lang.c)