www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/06/22:18:01

From: "Carolyn Kelly-Pajot" <dehacked72 AT hotmail DOT com>
References: <3460bcb1 DOT 8980759 AT news DOT image DOT dk>
Subject: Re: Is it possible to set int=16bit
Date: Wed, 5 Nov 1997 15:18:22 -0500
Lines: 34
Message-ID: <O5zIrdi68GA.122@upnetnews02.moswest.msn.net>
Newsgroups: comp.os.msdos.djgpp
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Sam Ravnborg wrote in message <3460bcb1 DOT 8980759 AT news DOT image DOT dk>...
>I have downloded DJGPP and like the look and feel of RHIDE (yes, I
>used Borland in the past).
>I am looking for an easy way to test my programs which int the end
>will run on an embedded target.
>I would like to use RHIDE/GCC to compile my programs if possible.
>
>In first place GCC fails because sizeof(int) == 4bytes == 32 bits.
>
>The requirements I have is:
>sizeof(int) == 2 bytes
>little endian
>alignment within records: ints are aligned to an even address.
>enums with less than 128 members s one byte in size.
>one byte equals 8 bits.
>
>My question is:
>Are there any easy way to setup GCC to these requirements - I know I
>have to figure out how to compile GCC etc. but want to hear any
>suggestion to the above first.
>
>--
>/Sam Ravnborg - sam DOT ravnborg AT image DOT dk

The best thing to do is to use he keyword short. You may be able to do a minor
change.
#define int short

Probably have some problems if you have used the word long in your code.
short long some_number; // :)
As for the number format, i'm not sure about little endian...


- Raw text -


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