delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/13/18:25:22

From: XXguille AT XXiies DOT XXes (Guillermo Rodriguez Garcia)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Portability and size_t type related question
Date: Thu, 13 May 1999 21:58:26 GMT
Organization: Telefonica Transmision de Datos
Lines: 42
Message-ID: <373ab719.990094@noticias.iies.es>
References: <Pine DOT SOL DOT 4 DOT 10 DOT 9905130944050 DOT 5527-100000 AT cs DOT joensuu DOT fi>
NNTP-Posting-Host: iies249.iies.es
Mime-Version: 1.0
X-Newsreader: Forte Agent 1.5/32.451
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

El día Thu, 13 May 1999 09:47:48 +0300 (EET DST), Pasi Franti
<franti AT cs DOT joensuu DOT fi> escribió:

>
>> Ok. thanx. it is like here then:
>> 
>> typedef  unsigned short    U16;
>> typedef  unsigned long     U32;
>> typedef  unsigned char     BYTE;
>
>I disagree.
>
>I did not follow your discussion but how did you come up to such
>conclusion? You can never be sure of how many bits are int and 
>long types without checking it! So what makes you think that 
>unsigned long would be different case? As far as I know, it is
>more likely to be U64 as we use 32-bit compilers where int is
>32 bits and long 64 bits.

In djgpp (and many other 32 bit compilers) int and long int are
exactly the same thing (32 bits). 

>In fact, even char is not necessary 8 bits even though it is
>so almost everywhere.

No, but a char is always one byte wide (a byte is not always 8-bit
wide, though).

>
>If you have some reasoning for this, please let me know.
>

He was just saying that he would use those typedefs (U16, U32, BYTE)
in his code and then define them as appropiate for every supported
compiler / OS.

Regards,
GUILLE

----
Guillermo Rodriguez Garcia
XXguille AT XXiies DOT XXes (ya sabes :-)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019