Date: Thu, 13 May 1999 12:38:28 +0300 (EET DST) From: Eugene Ageenko To: Pasi Franti cc: Eli Zaretskii , djgpp AT delorie DOT com Subject: Re: Portability and size_t type related question In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Thu, 13 May 1999, Pasi Franti wrote: > > > 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. You did not followed the discussion. We have said that these definitions above are system dependnet and should be set separately for each system. Therefore .H files are so long sometimes. All these system dependent definitions are better done in a separate .h file for easier checking. (like owntypes.h) The user of system will check this file. If he has 64-bit system hw would be probably need to change definition for UINT32 type. But it is easier to do in a separate file than to dig the software again and again, and find which int's should go to long's and vice versa. Currently there is no PORTABLE way in the current ANSI C to specify how many bytes will take the variable. > > In fact, even char is not necessary 8 bits even though it is > so almost everywhere. It is what Eli and Dj said, exactly > > If you have some reasoning for this, please let me know. > Eugene