Mail Archives: djgpp/1993/05/10/21:57:45
Original From: Timothy Wilson <wilsont AT rahul DOT net>
[ stuff deleted... ]
2. Lots of Memory segmentation errors.
My 4 Meg ST has no problems what so ever running my code. I copy the
source directly over to my clone (386SX-16, 4 Megs) and it craps out when i
access certain parts of my program.
(and no, its not hardware specific code, its all standard C)
What gives? Am i wrong in the assumption that djgpp has a truly flat memory
model? (ie, whats the catch).
Please help me conquer this wretched clone.
Thank you!
The ST (680x0) and SUNs (680x0 and sparc) use a different byte order from Intel
which can cause some interesting late nite debugging sessions.
Obvious ( documented ) things to watch out for are 'C' structures transfered via
network or written to disk. Alignment, padding, and internal representation
become issues.
More subtle are errors in the code which are hidden by the "big-endian" machines.
The only ST code I ever ported was a ray-tracer which contained:
newstr = malloc( strlen( oldstr ) );
The allocation is one-too-small but went undiscovered because ints and pointers
usually start with a zero byte.
Hope some of this helps.
- Raw text -