TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Andrew Clegg
from: Jonathan de Boyne Pollard
date: 1995-04-23 11:10:08
subject: Warp Backwards compATIBL

Once Upon a time, the fair prince Maintenance Programmer of the
  Kingdom of TLA and his Guru were working on a rather large program.

  This was around the time that the Prince had instructed the Guru to
  compile the program using MetaWare High C++ instead of IBM CSet++,
  which is Another Tale.

  The Prince was having some trouble.  On OS/2 version 2.xx it would
  work fine, but on OS/2 WARP Three whenever one of the Foul Users from
  the Kingdoms of the Outer Darkness dropped a colour on his application
  from the colour palette, the application would crash.

  Upset at this, both the Prince and the Guru worked hard and long,
  labouring for why 'twas so.  Long were the nights spent in (unpaid)
  overtime seeking the bug.  They sought it with thimbles; they sought
  it with care.  They sought it with forks and a hope.

  After threatening its life with a railway share they eventually
  discovered that the application was keeping a linked list of
  presentation parameters, which it was updating every time a
  WM_PRESPARMCHANGED message was received on any window.  This list was
  working fine on OS/2 version 2.xx, and going completely haywire on
  OS/2 WARP.

  One day, the Guru spotted the fact that a temporary pointer used in
  this list was not being initialised, even though it was being checked
  halfway through a routine to see whether it was NULL.  Belatedly, he
  remembered that when The Application had been compiled with High C++
  the compiler had spat out all sorts of curses and Vile Incantations at
  him about variables not being initialised before use, and told Prince
  Maintenance Programmer about this.

  And indeed 'twas so.  The Original Programmer (may he rest in peace)
  had been a C programmer, had declared all variables up at the top of
  each function, and had usually assigned to them before their first use
  rather than explicitly initialising them.

  After a week of The Hunt, a four byte source change (adding the
  initialiser " = 0" to the declaration of the variable), cured the
  problem.  This was the cause of much exclamation amongst the subjects
  of the Kingdom of TLA.  And yea the Prince did beat the Guru over the
  head for not thinking of this earlier.

  The Guru suspected that since Presentation Manager on OS/2 2.xx was
  partiallly 16-bit, the relevant pointer (which was an auto variable)
  was defaulting to zero, because the stack was zero-filled at that
  point, PM using a 16-bit stack to do its work.  However, PM on OS/2
  WARP Three, with its bits numbering the twain for every one of
  previous versions, was using the 32-bit stack, and so the stack at
  that point thus held non-zero data from the Internal Magic of PM and
  the pointer was pointing to garbage values.

  Whereupon the Prince and the Guru spent several man days going through
  the entire application looking for uninitialised automatic pointer
  variables, and putting " = 0" after them ...

  ... and the Foul Users in the Kingdoms of the Outer Darkness were
  shipped a fixpack.

  > JdeBP <
___
 X MegaMail 2.10 #0:
--- Maximus/2 2.02
* Origin: DoNoR/2,Woking UK (44-1483-722344) (2:440/4)
SEEN-BY: 105/42 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 712/515 628 704 713/888 800/1 7877/2809
@PATH: 440/4 141/209 270/101 105/103 42 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.