comp.lang.ada
 help / color / mirror / Atom feed
From: "Jean-Pierre Rosen" <rosen@adalog.fr>
Subject: Re: Zero_Fill pragma
Date: Tue, 20 Jul 2004 19:37:18 +0200
Date: 2004-07-20T19:37:18+02:00	[thread overview]
Message-ID: <d8ljdc.5bl.ln@skymaster> (raw)
In-Reply-To: opsbf2fpb0p4pfvb@bram-2

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1011 bytes --]


"Nick Roberts" <nick.roberts@acm.org> a �crit dans le message de news:opsbf2fpb0p4pfvb@bram-2...
> Am I too late to make a proposal for a new pragma for
> the Ada 2005 Amendment?
Yes

> It would have the syntax:
>
>     pragma Zero_Fill(simple_name);
>[...]
> Either way, I think the pragma would be useful in real
> programs,
I would not think so.
1) There is nothing special with the value 0 in Ada. You can have (easily) types where value 0 does not belong to the type,
therefore 0 would not be better than any random value.
2) An uninitialized variable is a bug. This would help hiding bugs, not finding them.
3) Because of 2), there is already pragma Initialize_Scalars, which purposedly initializes all scalars to an *invalid* value (if
possible). Therefore, you'll get Constraint_Error during the first tests, not in production use. Much better.

-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr





  reply	other threads:[~2004-07-20 17:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-20 16:22 Zero_Fill pragma Nick Roberts
2004-07-20 17:37 ` Jean-Pierre Rosen [this message]
2004-07-20 20:14   ` Nick Roberts
2004-07-20 21:06     ` Jacob Sparre Andersen
2004-07-20 22:15     ` Georg Bauhaus
2004-07-21  7:21     ` Jean-Pierre Rosen
2004-07-21  9:00     ` Martin Dowie
2004-07-20 21:57 ` Frank
  -- strict thread matches above, loose matches on Subject: below --
2004-07-20 17:13 Lionel.DRAGHI
2004-07-21 12:27 ` Marin David Condic
2004-07-22  9:02   ` Dale Stanbrough
2004-07-21  9:24 Lionel.DRAGHI
2004-07-21 12:59 Lionel.DRAGHI
2004-07-21 21:54 ` Marin David Condic
replies disabled

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