comp.lang.ada
 help / color / mirror / Atom feed
From: math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!sunic!seunet!enea!s ommar@uunet.uu.net  (Erland Sommarskog)
Subject: Re: Uninitialized subtype variables
Date: 25 Oct 92 11:37:42 GMT	[thread overview]
Message-ID: <1992Oct25.113742.1164@enea.se> (raw)

Robert I. Eachus (eachus@Dr_No.mitre.org) writes:
>     One slight addition to Tucker's list.  Another alternative that a
>compiler can take is to choose to initialize the variable instead of
>doing the check.  This turns out to be a pretty "neat" trick when the
>compiler back-end eliminates assignments of unused values.  If the
>initial value is never used (and the compiler can figure it out) the
>extra assignment is eliminated, otherwise the assignment is usually
>cheaper than the check (for scalars).

Sounds indeed palatable, but...

The variable is no more initialized because the compiler assigned
a value to it, and your program may still behave in mysterious
ways. And since you never stumble on a range check you're likely
to be even more confused.

Or even worse, you develop with the compiler initialization, con-
sciounsly or by mistake, everything works fine, until the day you
port to new compiler which never initializes variables and what used
to be a fine working program is now an inferno of unexplainable random
behaviour.
-- 
Erland Sommarskog - ENEA Data, Stockholm - sommar@enea.se
N{r busen hejdar sin st}lskodda klack en centimeter innan din t}h{tta,
och v{ser "n{sta g}ng...", det {r d} du f}tt andrum till varnagel.

             reply	other threads:[~1992-10-25 11:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-10-25 11:37 math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!sunic!seunet!enea!s [this message]
  -- strict thread matches above, loose matches on Subject: below --
1992-10-27  1:26 Uninitialized subtype variables Robert I. Eachus
1992-10-27  1:22 munnari.oz.au!ariel!ucsvc.ucs.unimelb.edu.au!phillip.edu.au!dale
1992-10-24 18:44 Alex Blakemore
1992-10-23 20:43 Michael Feldman
1992-10-23 16:49 cis.ohio-state.edu!news.sei.cmu.edu!ajpo.sei.cmu.edu!falis
1992-10-22 17:38 bloom-picayune.mit.edu!enterpoop.mit.edu!snorkelwacker.mit.edu!tamsun.tam
1992-10-22 13:46 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!wupost!micro-heart-of-gold.m
1992-10-21 23:47 Richard Pattis
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox