[fpc-devel]possible bug in sockets.pp

Sebastian Kaliszewski Sebastian.Kaliszewski at softax.com.pl
Mon Nov 5 12:13:19 CET 2001

From: "Thomas Schatzl" <tom_at_work at yline.com>
> > > That's not correct, in the C headers family is an "unsigned short",
> which
> > > is the same as a byte in Pascal.


> >
> > No, "unsigned short" equals the Pascal "Word" type (usually). Pascal
> "Byte"
> > equals "unsigned char".
> Well forget above paragraph of mine, it's wrong. "Unsigned char" doesn't
> exist and I'm starting to mix up everything. Nevertheless sizeof(unsigned
> short) gives 2 with VC++. [Not that I'd take VC++ for compliance testing
> anything but it is a point].

Well, unsigned short is in allmost all implementations 2 bytes (i.e. 16bit),
this is true in VC as well as GCC as well as Watcom as well ac DEC C as well
as Sun Pro C as well as Intel C as well as Borland C as well as... The only
what C definition says is that plain int must be no longer than long int and
no shorter than short int. De facto standard is 16bit for short and 32bit
for long, plain is usually but not allways 32bit (in 16bit architectures it
is rather 16bit) -- I dont know alny compiler making it differently
(probably Deep Blue C from 8-bit Atari was different, but it was not fully
fledged C, anyway)

As for unsigned char -- yes, it exists. There are all unsigned char, signed
char and just char (which is unknown if it is signed or not -- standard says
it could be anything).

Sebastian Kaliszewski

More information about the fpc-devel mailing list