Mail Archives: djgpp/2000/05/18/15:20:10
"A. Sinan Unur" wrote:
>
> "Alexei A. Frounze" <alex DOT fru AT mtu-net DOT ru> wrote in message
> news:3923BA11 DOT AD387617 AT mtu-net DOT ru...
> > Eli Zaretskii wrote:
> > >
> > > On Thu, 18 May 2000, Alexei A. Frounze wrote:
> > >
> > > > I don't use size_t in my sources.
> > >
> > > You cannot do that if those sources call standard functions which
> > > accept or return size_t values, such as strlen, memcpy, malloc,
> > > etc. If you use int instead of size_t in these cases, your code
> > > becomes non-portable.
> >
> > Really? How about type casting? It doesn't work at all for int<->size_t?
>
> are you seriously asking this or is this just a troll?
Well, let it be "unsigned int" <-> "size_t".
> what do you expect the following code to produce:
>
> #include <stdio.h>
>
> int main(void) {
> char c;
> unsigned int i2;
> unsigned int i1 = 0x12345678;
>
> c = (char) i1;
i1 exceeds valid range. Actually I mean values that can be represented by
both "<unsigned>int" and "size_t".
> i2 = (unsigned int) c;
Don't overact.
>
> printf("i1: %8.8x\tc: %2.2x\ti2: %8.8x\n", i1, c, i2);
>
> return 0;
> }
>
> do you think i1 == i2?
Am I that stupid???
>
> Sinan.
> --
> mailto:Sinan_Unur AT mail DOT com
> http://unur.com/
--
Alexei A. Frounze
-----------------------------------------
Homepage: http://alexfru.chat.ru
Mirror: http://members.xoom.com/alexfru
- Raw text -