From: firewind Newsgroups: comp.os.msdos.djgpp Subject: Re: GCC: Is it possible to set int=16bit Date: 6 Nov 1997 02:18:10 GMT Organization: Netcom Lines: 40 Message-ID: <63r9d2$t54@dfw-ixnews8.ix.netcom.com> References: <3460bcb1 DOT 8980759 AT news DOT image DOT dk> NNTP-Posting-Host: elp-tx3-15.ix.netcom.com Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Sam Ravnborg wrote: > 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. a 'short' under DJGPP is two bytes long. Specific length requirements for variables should definetly be hidden behind typedefs in C89. This makes porting much easier, since changing a single line: typedef int two_bytes; to typedef short two_bytes; is much easier then changing ten thousand instances of 'int' to 'short.' -- [- firewind -] [- email: firewind AT metroid DOT dyn DOT ml DOT org (home), firewind AT aurdev DOT com (work) -] [- "You're just jealous because the voices talk to -me-." -] [- Have a good day, and enjoy your C. -] [- (on a crusade of grumpiness where grumpiness is due) -]