comp.lang.ada
 help / color / mirror / Atom feed
From: adambeneschan@gmail.com
Subject: Re: confusing string error
Date: Fri, 14 Feb 2014 17:50:52 -0800 (PST)
Date: 2014-02-14T17:50:52-08:00	[thread overview]
Message-ID: <418563f9-4ec0-4eec-bb47-3a42a09fd19f@googlegroups.com> (raw)
In-Reply-To: <3kdtf9l42gimm37vgia3eibsmr638r27ig@4ax.com>

On Friday, February 14, 2014 4:46:51 PM UTC-8, ag...@drrob1.com wrote:

Just one note: this comment:

  HOLDTKNBUF := Null_unbounded_string; -- looks like Ada automatically 
init's all declarations to either 0 or null, as suits the data type

is wrong.  Integers are not initialized to anything and cannot be counted on; same for floats, booleans, other enumeration types, etc.  Access types *are* initialized to null by default, though, and the language specifically requires that Unbounded_String types be initialized by default.  It's possible that everything could get initialized to 0 in a particular implementation, though, either because the compiler vendors decided to make the code do that, or the OS does that when loading the program, or often just by luck.

                               -- Adam


  reply	other threads:[~2014-02-15  1:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-14 12:38 confusing string error agent
2014-02-14 13:03 ` Jacob Sparre Andersen
2014-02-15  0:46   ` agent
2014-02-15  1:50     ` adambeneschan [this message]
2014-02-15  8:41       ` Simon Wright
2014-02-15  1:57     ` adambeneschan
2014-02-15  9:33     ` Simon Wright
2014-02-15 12:53       ` agent
2014-02-15 16:58         ` adambeneschan
2014-02-15 18:29           ` Simon Wright
2014-02-17 12:57             ` agent
2014-02-15 13:15       ` agent
2014-02-15 17:56         ` Jeffrey Carter
replies disabled

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