Mail Archives: djgpp/2001/07/14/00:18:12
On 11 Jul 2001 21:44:56 GMT, Hans-Bernhard Broeker
<broeker AT physik DOT rwth-aachen DOT de> sat on a tribble, which squeaked:
>jansb000 <jansb000 AT wxs DOT nl> wrote:
>[...]
>
>> Recently I added the line "ULONG spr" and to my suprise the application that
>> I spoke about doesn't work any more.
>
>You'll really have to be a bit more specific: how does it "not work", now?
>What are the symptoms of the problem?
Actually, much can be deduced without more info. All he changed was
the object layout and the program broke. Ergo, its behavior has a
dependency on object layout, which is bad. Most probably, this came
from one of three causes:
* A bug involving uninitialized memory or pointer wildness; the
program happened to always work before the spr was added perhaps
because a padding zero was there before, or another field.
* The code was unwisely depending on fields of the object being at
certain hardcoded offsets in bytes, rather than using offsetof.
* The code was unwisely writing out and reading the objects
byte-by-byte to and from binary files, and so the object format
changed when the spr field was added, making the program choke on
earlier versions' files.
--
Bill Gates: "No computer will ever need more than 640K of RAM." -- 1980
"There's nobody getting rich writing software that I know of." -- 1980
"This antitrust thing will blow over." -- 1998
Combine neo, an underscore, and one thousand sixty-one to make my hotmail addy.
- Raw text -