Mail Archives: djgpp/1997/11/05/23:46:14
Sam Ravnborg <sam DOT ravnborg AT image DOT dk> 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) -]
- Raw text -